aboutsummaryrefslogtreecommitdiff
path: root/tests/runner.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-09-20 14:13:43 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-09-20 14:13:43 -0700
commitd9e13a5a3ceeaa500e9c75e52547c8b67950c441 (patch)
tree986b6af442e8c503bedab9912e8913dbd129d2e1 /tests/runner.py
parentafa818a5cbc78bb862f0cae8b305c8033a5b0fc3 (diff)
parent83c6675368ce14ee34b52147792b1073a074ed24 (diff)
Merge branch 'incoming'
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-xtests/runner.py23
1 files changed, 17 insertions, 6 deletions
diff --git a/tests/runner.py b/tests/runner.py
index e4aba0c9..792b8939 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -7829,11 +7829,13 @@ elif 'browser' in str(sys.argv):
var actual = actualCtx.getImageData(0, 0, actualImage.width, actualImage.height).data;
var total = 0;
- for (var x = 0; x < img.width; x++) {
- for (var y = 0; y < img.height; y++) {
- total += Math.abs(expected[y*img.width*4 + x*4 + 0] - actual[y*img.width*4 + x*4 + 0]);
- total += Math.abs(expected[y*img.width*4 + x*4 + 1] - actual[y*img.width*4 + x*4 + 1]);
- total += Math.abs(expected[y*img.width*4 + x*4 + 2] - actual[y*img.width*4 + x*4 + 2]);
+ var width = img.width;
+ var height = img.height;
+ for (var x = 0; x < width; x++) {
+ for (var y = 0; y < height; y++) {
+ total += Math.abs(expected[y*width*4 + x*4 + 0] - actual[y*width*4 + x*4 + 0]);
+ total += Math.abs(expected[y*width*4 + x*4 + 1] - actual[y*width*4 + x*4 + 1]);
+ total += Math.abs(expected[y*width*4 + x*4 + 2] - actual[y*width*4 + x*4 + 2]);
}
}
var wrong = Math.floor(total / (img.width*img.height*3)); // floor, to allow some margin of error for antialiasing
@@ -8805,7 +8807,7 @@ elif 'sanity' in str(sys.argv):
assert (open(CONFIG_FILE).read() == open(path_from_root('settings.py')).read()), 'Settings should be copied from settings.py'
# Second run, with bad EM_CONFIG
- for settings in ['blah', 'LLVM_ROOT="blah"; JS_ENGINES=[]; COMPILER_ENGINE=NODE_JS=SPIDERMONKEY_ENGINE=[]']:
+ for settings in ['blah', 'LLVM_ROOT="blarg"; JS_ENGINES=[]; COMPILER_ENGINE=NODE_JS=SPIDERMONKEY_ENGINE=[]']:
f = open(CONFIG_FILE, 'w')
f.write(settings)
f.close()
@@ -8901,6 +8903,15 @@ elif 'sanity' in str(sys.argv):
self.assertNotContained(SANITY_MESSAGE, output)
self.assertNotContained(SANITY_FAIL_MESSAGE, output)
+ # but with EMCC_DEBUG=1 we should check
+ assert not os.environ.get('EMCC_DEBUG'), 'do not run sanity checks in debug mode!'
+ os.environ['EMCC_DEBUG'] = '1'
+ output = self.check_working(EMCC)
+ self.assertContained(SANITY_MESSAGE, output)
+ del os.environ['EMCC_DEBUG']
+ output = self.check_working(EMCC)
+ self.assertNotContained(SANITY_MESSAGE, output)
+
# But the test runner should
output = self.check_working(commands[1])
self.assertContained(SANITY_MESSAGE, output)