aboutsummaryrefslogtreecommitdiff
path: root/tests/test_other.py
diff options
context:
space:
mode:
authorDominic Wong <dom@dominic-wong.name>2013-11-19 02:08:27 +0800
committerDominic Wong <dom@dominic-wong.name>2013-11-19 02:08:27 +0800
commite4ce6ee11b5048404c71065e8253b34e7eb8dd29 (patch)
treea0abf86af07fd8caa3abf641bbdc39a583532ead /tests/test_other.py
parent1b0899f7a171dcb5c74e833763509c31adba8417 (diff)
Added test for change for issue #1732.
Diffstat (limited to 'tests/test_other.py')
-rw-r--r--tests/test_other.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/test_other.py b/tests/test_other.py
index 0dd0bd12..1144ec26 100644
--- a/tests/test_other.py
+++ b/tests/test_other.py
@@ -2074,3 +2074,27 @@ int main()
Popen([PYTHON, EMCC, path_from_root('tests', 'linpack.c'), '-O2', '-DSP', '--llvm-opts', '''['-O3', '-vectorize', '-vectorize-loops', '-bb-vectorize-vector-bits=128', '-force-vector-width=4']''']).communicate()
self.assertContained('Unrolled Single Precision', run_js('a.out.js'))
+ def test_dependency_file(self):
+ # Issue 1732: -MMD (and friends) create dependency files that need to be
+ # copied from the temporary directory.
+
+ open(os.path.join(self.get_dir(), 'test.cpp'), 'w').write(r'''
+ #include "test.hpp"
+
+ void my_function()
+ {
+ }
+ ''')
+ open(os.path.join(self.get_dir(), 'test.hpp'), 'w').write(r'''
+ void my_function();
+ ''')
+
+ Popen([PYTHON, EMCC, '-MMD', '-c', os.path.join(self.get_dir(), 'test.cpp'), '-o',
+ os.path.join(self.get_dir(), 'test.o')]).communicate()
+
+ assert os.path.exists(os.path.join(self.get_dir(), 'test.d')), 'No dependency file generated'
+ deps = open(os.path.join(self.get_dir(), 'test.d')).read()
+ head, tail = deps.split( ':', 2 )
+ assert 'test.o' in head, 'Invalid dependency target'
+ assert 'test.cpp' in tail and 'test.hpp' in tail, 'Invalid dependencies generated'
+