aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFraser Adams <fraser.adams@blueyonder.co.uk>2013-10-05 08:03:24 +0100
committerFraser Adams <fraser.adams@blueyonder.co.uk>2013-10-05 08:03:24 +0100
commite851616ef033f58325141362dc139471531ab44b (patch)
treed481388241b7023d406cbb707eb421b222b75fe0
parent0eb049e51319675ecdc4f548a06063d6b3ffb6ef (diff)
replaced tests/Module-exports in path_from_root with 'tests', 'Module-exports' to be more friendly multiple OSs
-rwxr-xr-xtests/Module-exports/run-test13
-rw-r--r--tests/test_other.py28
2 files changed, 14 insertions, 27 deletions
diff --git a/tests/Module-exports/run-test b/tests/Module-exports/run-test
deleted file mode 100755
index ca6830f1..00000000
--- a/tests/Module-exports/run-test
+++ /dev/null
@@ -1,13 +0,0 @@
-# This test tests the case where we wish to export a C function called bufferTest and have it called
-# from JavaScript running on node.js. In particular this test checks that the C function is correctly
-# exported when minified by running the Closure compiler, testing a change made to src/shell.js
-# that replaced "module.exports = Module;" with "module['exports'] = Module;". The dot notation version
-# gets minified by Closure which means that Module doesn't get correctly exported to node.js, the
-# latter succeeds (and ironically actually gets minified to "module.exports = Module;" by Closure)
-
-rm -f test.js
-
-emcc -O2 --closure 1 -o test.js test.c --pre-js setup.js -s EXPORTED_FUNCTIONS="['_bufferTest']"
-
-node main.js
-
diff --git a/tests/test_other.py b/tests/test_other.py
index f81e9627..d4d2b7ec 100644
--- a/tests/test_other.py
+++ b/tests/test_other.py
@@ -1916,43 +1916,43 @@ done.
# Run with ./runner.py other.test_module_exports_with_closure
# First make sure test.js isn't present.
- try_delete(path_from_root('tests/Module-exports', 'test.js'))
- assert not os.path.exists(path_from_root('tests/Module-exports', 'test.js'))
+ try_delete(path_from_root('tests', 'Module-exports', 'test.js'))
+ assert not os.path.exists(path_from_root('tests', 'Module-exports', 'test.js'))
# compile with -O2 --closure 0
- Popen([PYTHON, EMCC, path_from_root('tests/Module-exports', 'test.c'), '-o', path_from_root('tests/Module-exports', 'test.js'), '-O2', '--closure', '0', '--pre-js', path_from_root('tests/Module-exports', 'setup.js'), '-s', 'EXPORTED_FUNCTIONS=["_bufferTest"]'], stdout=PIPE, stderr=PIPE).communicate()
+ Popen([PYTHON, EMCC, path_from_root('tests', 'Module-exports', 'test.c'), '-o', path_from_root('tests', 'Module-exports', 'test.js'), '-O2', '--closure', '0', '--pre-js', path_from_root('tests', 'Module-exports', 'setup.js'), '-s', 'EXPORTED_FUNCTIONS=["_bufferTest"]'], stdout=PIPE, stderr=PIPE).communicate()
# Check that compilation was successful
- assert os.path.exists(path_from_root('tests/Module-exports', 'test.js'))
- test_js_closure_0 = open(path_from_root('tests/Module-exports', 'test.js')).read()
+ assert os.path.exists(path_from_root('tests', 'Module-exports', 'test.js'))
+ test_js_closure_0 = open(path_from_root('tests', 'Module-exports', 'test.js')).read()
# Check that test.js compiled with --closure 0 contains "module['exports'] = Module;"
assert "module['exports'] = Module;" in test_js_closure_0
# Check that main.js (which includes test.js) completes successfully
- self.assertContained('bufferTest finished', run_js(path_from_root('tests/Module-exports', 'main.js')))
+ self.assertContained('bufferTest finished', run_js(path_from_root('tests', 'Module-exports', 'main.js')))
# Delete test.js again and check it's gone.
- try_delete(path_from_root('tests/Module-exports', 'test.js'))
- assert not os.path.exists(path_from_root('tests/Module-exports', 'test.js'))
+ try_delete(path_from_root('tests', 'Module-exports', 'test.js'))
+ assert not os.path.exists(path_from_root('tests', 'Module-exports', 'test.js'))
# compile with -O2 --closure 1
- Popen([PYTHON, EMCC, path_from_root('tests/Module-exports', 'test.c'), '-o', path_from_root('tests/Module-exports', 'test.js'), '-O2', '--closure', '1', '--pre-js', path_from_root('tests/Module-exports', 'setup.js'), '-s', 'EXPORTED_FUNCTIONS=["_bufferTest"]'], stdout=PIPE, stderr=PIPE).communicate()
+ Popen([PYTHON, EMCC, path_from_root('tests', 'Module-exports', 'test.c'), '-o', path_from_root('tests', 'Module-exports', 'test.js'), '-O2', '--closure', '1', '--pre-js', path_from_root('tests', 'Module-exports', 'setup.js'), '-s', 'EXPORTED_FUNCTIONS=["_bufferTest"]'], stdout=PIPE, stderr=PIPE).communicate()
# Check that compilation was successful
- assert os.path.exists(path_from_root('tests/Module-exports', 'test.js'))
- test_js_closure_1 = open(path_from_root('tests/Module-exports', 'test.js')).read()
+ assert os.path.exists(path_from_root('tests', 'Module-exports', 'test.js'))
+ test_js_closure_1 = open(path_from_root('tests', 'Module-exports', 'test.js')).read()
# Check that test.js compiled with --closure 1 contains "module.exports", we want to verify that
# "module['exports']" got minified to "module.exports" when compiling with --closure 1
assert "module.exports" in test_js_closure_1
# Check that main.js (which includes test.js) completes successfully
- self.assertContained('bufferTest finished', run_js(path_from_root('tests/Module-exports', 'main.js')))
+ self.assertContained('bufferTest finished', run_js(path_from_root('tests', 'Module-exports', 'main.js')))
# Tidy up files that might have been created by this test.
- try_delete(path_from_root('tests/Module-exports', 'test.js'))
- try_delete(path_from_root('tests/Module-exports', 'test.js.map'))
+ try_delete(path_from_root('tests', 'Module-exports', 'test.js'))
+ try_delete(path_from_root('tests', 'Module-exports', 'test.js.map'))
# ----------------------------- End of test_module_exports_with_closure -----------------------------