aboutsummaryrefslogtreecommitdiff
path: root/tests/runner.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-xtests/runner.py137
1 files changed, 70 insertions, 67 deletions
diff --git a/tests/runner.py b/tests/runner.py
index bb6ffac8..47c1f1be 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -904,26 +904,26 @@ if 'benchmark' not in str(sys.argv) and 'sanity' not in str(sys.argv) and 'brows
void interface_clock_changed()
{
- UINT8 m_divshift;
- INT32 m_divisor;
+ UINT8 m_divshift;
+ INT32 m_divisor;
- //INT64 attos = m_attoseconds_per_cycle;
- INT64 attos = 279365114840;
- m_divshift = 0;
- while (attos >= (1UL << 31))
- {
- m_divshift++;
- printf("m_divshift is %i, on %Ld >?= %lu\n", m_divshift, attos, 1UL << 31);
- attos >>= 1;
- }
- m_divisor = attos;
+ //INT64 attos = m_attoseconds_per_cycle;
+ INT64 attos = 279365114840;
+ m_divshift = 0;
+ while (attos >= (1UL << 31))
+ {
+ m_divshift++;
+ printf("m_divshift is %i, on %Ld >?= %lu\n", m_divshift, attos, 1UL << 31);
+ attos >>= 1;
+ }
+ m_divisor = attos;
- printf("m_divisor is %i\n",m_divisor);
+ printf("m_divisor is %i\n",m_divisor);
}
int main() {
- interface_clock_changed();
- return 0;
+ interface_clock_changed();
+ return 0;
}
'''
self.do_run(src, '''m_divshift is 1, on 279365114840 >?= 2147483648
@@ -997,8 +997,8 @@ m_divisor is 1091269979
volatile UINT64 testu64a = 14746250828952703000U;
while ((UINT64)testu32a * (UINT64)bigu32 < testu64a) {
- printf("testu64a is %llu\n", testu64a);
- testu64a /= 2;
+ printf("testu64a is %llu\n", testu64a);
+ testu64a /= 2;
}
return 0;
@@ -1456,28 +1456,28 @@ c5,de,15,8a
quint64 v = strtoull("4433ffeeddccbb00", NULL, 16);
printf("%lld\n", v);
- const string string64bitInt = "4433ffeeddccbb00";
- stringstream s(string64bitInt);
- quint64 int64bitInt = 0;
+ const string string64bitInt = "4433ffeeddccbb00";
+ stringstream s(string64bitInt);
+ quint64 int64bitInt = 0;
printf("1\n");
- s >> hex >> int64bitInt;
+ s >> hex >> int64bitInt;
printf("2\n");
- stringstream out;
- out << hex << qbswap(int64bitInt);
+ stringstream out;
+ out << hex << qbswap(int64bitInt);
- cout << out.str() << endl;
- cout << hex << int64bitInt << endl;
- cout << string64bitInt << endl;
+ cout << out.str() << endl;
+ cout << hex << int64bitInt << endl;
+ cout << string64bitInt << endl;
- if (out.str() != "bbccddeeff3344")
- {
- cout << "Failed!" << endl;
- }
- else
- {
- cout << "Succeeded!" << endl;
- }
+ if (out.str() != "bbccddeeff3344")
+ {
+ cout << "Failed!" << endl;
+ }
+ else
+ {
+ cout << "Succeeded!" << endl;
+ }
return 0;
}
@@ -4030,15 +4030,15 @@ def process(filename):
// see related things in openjpeg
typedef struct opj_mqc_state {
- unsigned int qeval;
- int mps;
- struct opj_mqc_state *nmps;
- struct opj_mqc_state *nlps;
+ unsigned int qeval;
+ int mps;
+ struct opj_mqc_state *nmps;
+ struct opj_mqc_state *nlps;
} opj_mqc_state_t;
static opj_mqc_state_t mqc_states[2] = {
- {0x5600, 0, &mqc_states[2], &mqc_states[3]},
- {0x5602, 1, &mqc_states[3], &mqc_states[2]},
+ {0x5600, 0, &mqc_states[2], &mqc_states[3]},
+ {0x5602, 1, &mqc_states[3], &mqc_states[2]},
};
int main() {
@@ -4533,6 +4533,8 @@ The current type of b is: 9
self.do_run(src, '*1*', force_c=True)
def test_strtoll_hex(self):
+ if self.emcc_args is None: return self.skip('requires emcc')
+
# tests strtoll for hex strings (0x...)
src = r'''
#include <stdio.h>
@@ -4559,6 +4561,8 @@ The current type of b is: 9
self.do_run(src, '111111')
def test_strtoll_dec(self):
+ if self.emcc_args is None: return self.skip('requires emcc')
+
# tests strtoll for decimal strings (0x...)
src = r'''
#include <stdio.h>
@@ -4585,6 +4589,8 @@ The current type of b is: 9
self.do_run(src, '111111')
def test_strtoll_bin(self):
+ if self.emcc_args is None: return self.skip('requires emcc')
+
# tests strtoll for binary strings (0x...)
src = r'''
#include <stdio.h>
@@ -4606,6 +4612,8 @@ The current type of b is: 9
self.do_run(src, '111')
def test_strtoll_oct(self):
+ if self.emcc_args is None: return self.skip('requires emcc')
+
# tests strtoll for decimal strings (0x...)
src = r'''
#include <stdio.h>
@@ -4807,25 +4815,25 @@ The current type of b is: 9
typedef struct
{
- int (*f)(void *);
- void *d;
- char s[16];
+ int (*f)(void *);
+ void *d;
+ char s[16];
} LMEXFunctionStruct;
int f(void *user)
{
- return 0;
+ return 0;
}
static LMEXFunctionStruct const a[] =
{
- {f, (void *)(int)'a', "aa"}
+ {f, (void *)(int)'a', "aa"}
};
int main()
{
printf("ok\n");
- return a[0].f(a[0].d);
+ return a[0].f(a[0].d);
}
'''
self.do_run(src, 'ok\n')
@@ -6824,7 +6832,7 @@ def process(filename):
printf("f_blocks: %lu\n", s.f_blocks);
printf("f_bfree: %lu\n", s.f_bfree);
printf("f_bavail: %lu\n", s.f_bavail);
- printf("f_files: %lu\n", s.f_files);
+ printf("f_files: %d\n", s.f_files > 5);
printf("f_ffree: %lu\n", s.f_ffree);
printf("f_favail: %lu\n", s.f_favail);
printf("f_fsid: %lu\n", s.f_fsid);
@@ -6842,7 +6850,7 @@ def process(filename):
f_blocks: 1000000
f_bfree: 500000
f_bavail: 500000
- f_files: 10
+ f_files: 1
f_ffree: 1000000
f_favail: 1000000
f_fsid: 42
@@ -10463,8 +10471,8 @@ f.close()
#define _TESTA_H_
class TestA {
- public:
- TestA();
+ public:
+ TestA();
};
#endif
@@ -10474,8 +10482,8 @@ f.close()
#define _TESTB_H_
class TestB {
- public:
- TestB();
+ public:
+ TestB();
};
#endif
@@ -10485,7 +10493,7 @@ f.close()
#include <testa.h>
TestA::TestA() {
- printf("TestA\n");
+ printf("TestA\n");
}
''')
open('testb.cpp', 'w').write(r'''
@@ -10495,8 +10503,8 @@ f.close()
/*
*/
TestB::TestB() {
- printf("TestB\n");
- TestA* testa = new TestA();
+ printf("TestB\n");
+ TestA* testa = new TestA();
}
''')
open('main.cpp', 'w').write(r'''
@@ -10507,9 +10515,9 @@ f.close()
/*
*/
int main(int argc, char** argv) {
- printf("Main\n");
- TestA* testa = new TestA();
- TestB* testb = new TestB();
+ printf("Main\n");
+ TestA* testa = new TestA();
+ TestB* testb = new TestB();
}
''')
@@ -12438,6 +12446,9 @@ elif 'browser' in str(sys.argv):
self.run_browser('something.html', 'You should see animating gears.', '/report_gl_result?true')
assert ('var GLEmulation' in open(self.in_dir('something.html')).read()) == emulation, "emulation code should be added when asked for"
+ def test_fulles2_sdlproc(self):
+ self.btest('full_es2_sdlproc.c', '1', args=['-s', 'GL_TESTING=1', '-DHAVE_BUILTIN_SINCOS', '-s', 'FULL_ES2=1'])
+
def test_glgears_deriv(self):
self.reftest(path_from_root('tests', 'gears.png'))
Popen([PYTHON, EMCC, path_from_root('tests', 'hello_world_gles_deriv.c'), '-o', 'something.html', '-s', 'GL_TESTING=1',
@@ -12551,14 +12562,6 @@ elif 'browser' in str(sys.argv):
shutil.copyfile(path_from_root('tests', 'screenshot.png'), os.path.join(self.get_dir(), 'screenshot.png'))
self.btest('gl_ps_packed.c', reference='gl_ps.png', args=['--preload-file', 'screenshot.png'])
- def test_gl_ps_workaround(self):
- shutil.copyfile(path_from_root('tests', 'screenshot.png'), os.path.join(self.get_dir(), 'screenshot.png'))
- self.btest('gl_ps_workaround.c', reference='gl_ps.png', args=['--preload-file', 'screenshot.png'])
-
- def test_gl_ps_workaround2(self):
- shutil.copyfile(path_from_root('tests', 'screenshot.png'), os.path.join(self.get_dir(), 'screenshot.png'))
- self.btest('gl_ps_workaround2.c', reference='gl_ps.png', args=['--preload-file', 'screenshot.png'])
-
def test_gl_ps_strides(self):
shutil.copyfile(path_from_root('tests', 'screenshot.png'), os.path.join(self.get_dir(), 'screenshot.png'))
self.btest('gl_ps_strides.c', reference='gl_ps_strides.png', args=['--preload-file', 'screenshot.png'])
@@ -14007,7 +14010,7 @@ if __name__ == '__main__':
which = map(lambda mode: mode+'.'+test, test_modes)
else:
which = [which]
-
+
print >> sys.stderr, ','.join(which)
for test in which:
print >> sys.stderr, 'will skip "%s"' % test