aboutsummaryrefslogtreecommitdiff
path: root/tests/runner.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-xtests/runner.py30
1 files changed, 18 insertions, 12 deletions
diff --git a/tests/runner.py b/tests/runner.py
index a1fa8690..23937974 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -3289,13 +3289,16 @@ at function.:blag
printf("%f, %f\n", atof("1.234567"), atof("cheez"));
+ float a = -1;
+ sscanf("-3.03", "%f", &a);
+ printf("%.4f\n", a);
+
return 0;
}
'''
- self.do_run(src, 'en-us : 2*en-r : 99*en : 3*1.234567, 0.000000',
- output_nicerizer = lambda x: x.replace('\n', '*'))
+ self.do_run(src, 'en-us : 2\nen-r : 99\nen : 3\n1.234567, 0.000000\n-3.0300')
- # Part 2: doubles (issue 148)
+ # Part 2: doubles
if Settings.USE_TYPED_ARRAYS == 2:
for ftype in ['float', 'double']:
src = r'''
@@ -5645,16 +5648,8 @@ f.close()
class TestServerHandler(BaseHTTPServer.BaseHTTPRequestHandler):
def do_GET(s):
assert s.path == expectedResult, 'Expected %s, got %s' % (expectedResult, s.path)
- httpd.shutdown()
- def handle_timeout():
- assert False, 'Timed out while waiting for the browser test to finish'
- httpd.shutdown()
httpd = BaseHTTPServer.HTTPServer(('localhost', 8888), TestServerHandler)
- httpd.timeout = 5;
- server_thread = threading.Thread(target=httpd.serve_forever)
- server_thread.daemon = True
- server_thread.start()
- server_thread.join(5.5)
+ httpd.handle_request()
# Finally, do some web browser tests
def run_browser(html_file, message, expectedResult = None):
@@ -5707,6 +5702,17 @@ f.close()
assert os.path.exists('something.html'), output
run_browser('something.html', 'You should see animating gears.', '/report_gl_result?true')
+ # Make sure that OpenGL ES is not available if typed arrays are not used
+ clear()
+ output = Popen([EMCC, path_from_root('tests', 'hello_world_gles.c'), '-o', 'something.html',
+ '-DHAVE_BUILTIN_SINCOS',
+ '-s', 'USE_TYPED_ARRAYS=0',
+ '--shell-file', path_from_root('tests', 'hello_world_gles_shell.html')],
+ stdout=PIPE, stderr=PIPE).communicate()
+ assert len(output[0]) == 0, output[0]
+ assert os.path.exists('something.html'), output
+ run_browser('something.html', 'You should not see animating gears.', '/report_gl_result?false')
+
def test_eliminator(self):
input = open(path_from_root('tools', 'eliminator', 'eliminator-test.js')).read()
expected = open(path_from_root('tools', 'eliminator', 'eliminator-test-output.js')).read()