aboutsummaryrefslogtreecommitdiff
path: root/tests/runner.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-06-17 17:57:47 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-06-17 17:57:47 -0700
commit49686a2a0fa86fdf1db7e15af84d91081e756a8e (patch)
tree2bcfff1a4c6073e6cb37c9a5e06eebea1031f759 /tests/runner.py
parent1325723c82ff8cacdbe9dd3b493b1dd304ed84a8 (diff)
crunch support
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-xtests/runner.py11
1 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('''