diff options
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/runner.py | 11 | ||||
-rw-r--r-- | tests/s3tc_crunch.png | bin | 0 -> 224849 bytes | |||
-rw-r--r-- | tests/ship.dds | bin | 0 -> 65664 bytes |
3 files changed, 9 insertions, 2 deletions
diff --git a/tests/runner.py b/tests/runner.py index 852dce42..995cd770 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -7336,9 +7336,9 @@ elif 'browser' in str(sys.argv): img.src = '%s'; }; Module['postRun'] = doReftest; - Module['preRun'] = function() { + Module['preRun'].push(function() { setTimeout(doReftest, 0); // if run() throws an exception and postRun is not called, this will kick in - }; + }); ''' % basename) def test_html(self): @@ -7807,6 +7807,13 @@ elif 'browser' in str(sys.argv): shutil.copyfile(path_from_root('tests', 'screenshot.dds'), os.path.join(self.get_dir(), 'screenshot.dds')) self.btest('s3tc.c', reference='s3tc.png', args=['--preload-file', 'screenshot.dds']) + def test_s3tc_crunch(self): + shutil.copyfile(path_from_root('tests', 'ship.dds'), 'ship.dds') + Popen(['python', FILE_PACKAGER, 'test.data', '--pre-run', '--crunch', '--preload', 'ship.dds'], stdout=open('pre.js', 'w')).communicate() + assert os.stat('test.data').st_size < 0.5*os.stat('ship.dds').st_size, 'Compressed should be smaller than dds' + shutil.move('ship.dds', 'ship.donotfindme.dds') # make sure we load from the compressed + self.btest('s3tc_crunch.c', reference='s3tc_crunch.png', args=['--pre-js', 'pre.js']) + def test_pre_run_deps(self): # Adding a dependency in preRun will delay run open(os.path.join(self.get_dir(), 'pre.js'), 'w').write(''' diff --git a/tests/s3tc_crunch.png b/tests/s3tc_crunch.png Binary files differnew file mode 100644 index 00000000..d320bf61 --- /dev/null +++ b/tests/s3tc_crunch.png diff --git a/tests/ship.dds b/tests/ship.dds Binary files differnew file mode 100644 index 00000000..dd7b04e9 --- /dev/null +++ b/tests/ship.dds |