Skip to content

Commit 941e514

Browse files
authored
Remove HAVE_BUILTIN_SINCOS from hello_world_gles.c tests (#27820)
All these tests are based on the same original code. Simplify the build process by removing `HAVE_BUILTIN_SINCOS`.
1 parent 076fd4a commit 941e514

7 files changed

Lines changed: 6 additions & 57 deletions

‎test/full_es2_sdlproc.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,6 @@
5050
#include <GL/glut.h>
5151
#include <assert.h>
5252

53-
#ifndef HAVE_BUILTIN_SINCOS
54-
#include "sincos.h"
55-
#endif
56-
5753
#define STRIPS_PER_TOOTH 7
5854
#define VERTICES_PER_TOOTH 34
5955
#define GEAR_VERTEX_STRIDE 6

‎test/hello_world_gles.c‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,6 @@
6060
#define VERTICES_PER_TOOTH 34
6161
#define GEAR_VERTEX_STRIDE 6
6262

63-
#ifndef HAVE_BUILTIN_SINCOS
64-
#define sincos _sincos
65-
static void
66-
sincos (double a, double *s, double *c)
67-
{
68-
*s = sin (a);
69-
*c = cos (a);
70-
}
71-
#endif
72-
7363
/**
7464
* Struct describing the vertices in triangle strip
7565
*/

‎test/hello_world_gles_deriv.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@
5757
#include <GL/glut.h>
5858
#endif
5959

60-
#ifndef HAVE_BUILTIN_SINCOS
61-
#include "sincos.h"
62-
#endif
63-
6460
#define STRIPS_PER_TOOTH 7
6561
#define VERTICES_PER_TOOTH 34
6662
#define GEAR_VERTEX_STRIDE 6

‎test/hello_world_gles_full.c‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,6 @@
5858
#define VERTICES_PER_TOOTH 34
5959
#define GEAR_VERTEX_STRIDE 6
6060

61-
#ifndef HAVE_BUILTIN_SINCOS
62-
#define sincos _sincos
63-
static void
64-
sincos (double a, double *s, double *c)
65-
{
66-
*s = sin (a);
67-
*c = cos (a);
68-
}
69-
#endif
70-
7161
/**
7262
* Struct describing the vertices in triangle strip
7363
*/

‎test/hello_world_gles_full_944.c‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,6 @@
5858
#define VERTICES_PER_TOOTH 34
5959
#define GEAR_VERTEX_STRIDE 6
6060

61-
#ifndef HAVE_BUILTIN_SINCOS
62-
#define sincos _sincos
63-
static void
64-
sincos (double a, double *s, double *c)
65-
{
66-
*s = sin (a);
67-
*c = cos (a);
68-
}
69-
#endif
70-
7161
/**
7262
* Struct describing the vertices in triangle strip
7363
*/

‎test/hello_world_gles_proxy.c‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,6 @@
6666
#define VERTICES_PER_TOOTH 34
6767
#define GEAR_VERTEX_STRIDE 6
6868

69-
#ifndef HAVE_BUILTIN_SINCOS
70-
#define sincos _sincos
71-
static void
72-
sincos (double a, double *s, double *c)
73-
{
74-
*s = sin (a);
75-
*c = cos (a);
76-
}
77-
#endif
78-
7969
/**
8070
* Struct describing the vertices in triangle strip
8171
*/

‎test/test_browser.py‎

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1644,12 +1644,11 @@ def test_chunked_synchronous_xhr(self):
16441644
'pthreads': (['-pthread'],),
16451645
})
16461646
def test_glgears(self, args):
1647-
self.reftest('hello_world_gles.c', 'gears.png', reference_slack=3, cflags=['-DHAVE_BUILTIN_SINCOS', '-lGL', '-lglut'] + args)
1647+
self.reftest('hello_world_gles.c', 'gears.png', reference_slack=3, cflags=['-lGL', '-lglut'] + args)
16481648

16491649
@requires_graphics_hardware
16501650
def test_glgears_long(self):
1651-
args = ['-DHAVE_BUILTIN_SINCOS', '-DLONGTEST', '-lGL', '-lglut', '-DANIMATE']
1652-
self.btest('hello_world_gles.c', expected='0', cflags=args)
1651+
self.btest('hello_world_gles.c', expected='0', cflags=['-DLONGTEST', '-lGL', '-lglut', '-DANIMATE'])
16531652

16541653
@requires_graphics_hardware
16551654
@parameterized({
@@ -1660,8 +1659,7 @@ def test_glgears_long(self):
16601659
@flaky('https://github.com/emscripten-core/emscripten/issues/25329')
16611660
def test_glgears_animation(self, filename):
16621661
copy_asset('browser/fake_events.js')
1663-
args = ['-o', 'something.html',
1664-
'-DHAVE_BUILTIN_SINCOS', '-sGL_TESTING', '-lGL', '-lglut',
1662+
args = ['-o', 'something.html', '-sGL_TESTING', '-lGL', '-lglut',
16651663
'--shell-file', test_file('hello_world_gles_shell.html')]
16661664
if 'full' in filename:
16671665
args += ['-sFULL_ES2']
@@ -1670,14 +1668,13 @@ def test_glgears_animation(self, filename):
16701668

16711669
@requires_graphics_hardware
16721670
def test_fulles2_sdlproc(self):
1673-
self.btest_exit('full_es2_sdlproc.c', cflags=['-sGL_TESTING', '-DHAVE_BUILTIN_SINCOS', '-sFULL_ES2', '-lGL', '-lSDL', '-lglut', '-sGL_ENABLE_GET_PROC_ADDRESS', '-Wno-int-conversion'])
1671+
self.btest_exit('full_es2_sdlproc.c', cflags=['-sGL_TESTING', '-sFULL_ES2', '-lGL', '-lSDL', '-lglut', '-sGL_ENABLE_GET_PROC_ADDRESS', '-Wno-int-conversion'])
16741672

16751673
@requires_graphics_hardware
16761674
@flaky('https://github.com/emscripten-core/emscripten/issues/25329')
16771675
def test_glgears_deriv(self):
1678-
self.reftest('hello_world_gles_deriv.c', 'gears.png', reference_slack=2,
1679-
cflags=['-DHAVE_BUILTIN_SINCOS', '-lGL', '-lglut'])
1680-
assert 'gl-matrix' not in read_file('test.html'), 'Should not include glMatrix when not needed'
1676+
self.reftest('hello_world_gles_deriv.c', 'gears.png', reference_slack=2, cflags=['-lGL', '-lglut'])
1677+
self.assertNotIn('gl-matrix', read_file('test.html'), 'Should not include glMatrix when not needed')
16811678

16821679
@requires_graphics_hardware
16831680
@parameterized({

0 commit comments

Comments
 (0)