aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndreas Bergmeier <andreas.bergmeier@gmx.net>2014-03-30 10:20:40 +0200
committerAndreas Bergmeier <andreas.bergmeier@gmx.net>2014-03-30 10:21:27 +0200
commit969d717924c0ddb0fda84dd8029c6503437ef548 (patch)
treedf16bee2eaed4bf945d5ec5222354ace6400cf2a /tests
parent47df13e72b43ceba91acbe63c8afac99a6b5f17c (diff)
Add test for warning about abspath and selectively disabling it.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_other.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_other.py b/tests/test_other.py
index 7200b9fd..7585bc2b 100644
--- a/tests/test_other.py
+++ b/tests/test_other.py
@@ -2574,4 +2574,17 @@ int main()
out, err = Popen([PYTHON, EMCC, 'a.bc'], stdout=PIPE, stderr=PIPE).communicate()
assert 'warning' in err, err
assert 'incorrect target triple' in err, err
+
+ def test_valid_abspath(self):
+ # Test whether abspath warning appears
+ abs_include_path = path_from_root('tests')
+ process = Popen([PYTHON, EMCC, '-I%s' % abs_include_path, path_from_root('tests', 'hello_world.c')], stdout=PIPE, stderr=PIPE)
+ out, err = process.communicate()
+ warning = '-I or -L of an absolute path "-I%s" encountered. If this is to a local system header/library, it may cause problems (local system files make sense for compiling natively on your system, but not necessarily to JavaScript). Pass \'-Wno-warn-absolute-paths\' to emcc to hide this warning.' % abs_include_path
+ assert(warning in err)
+
+ # Hide warning for this include path
+ process = Popen([PYTHON, EMCC, '--valid-abspath', abs_include_path,'-I%s' % abs_include_path, path_from_root('tests', 'hello_world.c')], stdout=PIPE, stderr=PIPE)
+ out, err = process.communicate()
+ assert(warning not in err)