Skip to content

Commit 2637242

Browse files
committed
Update test suite to run with latest Emscripten. Use EMSCRIPTEN_BROWSER environment variable to configure the run. Update documentation to reflect the new steps to run the suite.
1 parent 6f7bf0d commit 2637242

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

README

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,7 @@ The Open POSIX Test Suite is not affiliated with the IEEE or The Open Group.
127127

128128
This github repository adds Emscripten testing harness for pthreads. To run the Emscripten pthreads tests, perform the following:
129129

130-
1. Adjust the Firefox Nightly pref dom.workers.maxPerDomain in about:config to at least 40 to allow that many simultaneous threads to run (some tests need it)
131-
2. Prepare Firefox Nightly prefs to be emrun-friendly by setting http://kripken.github.io/emscripten-site/docs/compiling/Running-html-files-with-emrun.html#running-web-pages-in-firefox
132-
3. Edit the file posixtestsuite/emcc/run_emcc_tests.py and configure the --browser=xx directive in the invocation of the 'emrun' cmd (line 24) to point to your pthreads-enabled Firefox Nightly build.
133-
4. Add directory posixtestsuite/emcc/ to PATH.
134-
5. Navigate to posixtestsuite/conformance/interfaces/ as the current directory.
135-
6. Make sure to close all existing instanced of Firefox tabs and processes, because the test runner will forcibly terminate browser processes during the run.
136-
7. Run 'run_all_tests.py'
130+
1. Set the environment EMSCRIPTEN_BROWSER to point to the executable of the target browser to run the test suite in.
131+
2. Close all existing instanced of Firefox tabs and processes, because the test runner will forcibly terminate browser processes during the run.
132+
3. Navigate to /path/to/posixtestsuite/conformance/interfaces/ as the current directory.
133+
4. Run '/path/to/posixtestsuite/emcc/run_all_tests.py'. This will run all the tests found in the subdirectories of the current working directory.

emcc/run_emcc_tests.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,16 @@
1616
indeterminate = []
1717
skipped = []
1818

19+
if not os.environ.get('EMSCRIPTEN_BROWSER'):
20+
print >> sys.stderr, 'Please set EMSCRIPTEN_BROWSER environment variable to point to the target browser executable to run!'
21+
sys.exit(1)
22+
1923
for f in tests:
2024
out = f.replace('.c', '.html')
21-
cmd = ['emcc', f, '-lpthread', '-Wno-format-security', '-s', 'TOTAL_MEMORY=268435456', '-s', 'PTHREAD_POOL_SIZE=40', '-o', out, '-I../../../include', '--emrun']
25+
cmd = ['emcc', f, '-s', 'USE_PTHREADS=1', '-Wno-format-security', '-s', 'TOTAL_MEMORY=268435456', '-s', 'PTHREAD_POOL_SIZE=40', '-o', out, '-I../../../include', '--emrun']
2226
print ' '.join(cmd)
2327
subprocess.call(cmd)
24-
cmd = ['emrun', '--kill_start', '--kill_exit', '--timeout=15', '--silence_timeout=15', '--browser=/Users/jjylanki/mozilla-inbound-2/obj-x86_64-apple-darwin14.0.0/dist/Nightly.app/Contents/MacOS/firefox', out]
28+
cmd = ['emrun', '--kill_start', '--kill_exit', '--timeout=15', '--silence_timeout=15', '--browser='+os.getenv('EMSCRIPTEN_BROWSER'), '--safe_firefox_profile', out]
2529
#print ' '.join(cmd)
2630
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
2731
(stdout, stderr) = proc.communicate()

0 commit comments

Comments
 (0)