From 969d717924c0ddb0fda84dd8029c6503437ef548 Mon Sep 17 00:00:00 2001 From: Andreas Bergmeier Date: Sun, 30 Mar 2014 10:20:40 +0200 Subject: Add test for warning about abspath and selectively disabling it. --- tests/test_other.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests') 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) -- cgit v1.2.3-18-g5258