diff options
author | Jukka Jylänki <jujjyl@gmail.com> | 2012-11-06 17:24:11 +0200 |
---|---|---|
committer | Jukka Jylänki <jujjyl@gmail.com> | 2012-11-06 17:24:11 +0200 |
commit | 886066723acd95cd9aa690291e59e687833ba3a2 (patch) | |
tree | e62869b5b5ef23150c535f90055164b2f5732953 | |
parent | 6c843af716f29e9016dffa5ad0f29ade26f76e81 (diff) |
Trim line endings in test_emconfig since they vary per-platform.
-rwxr-xr-x | tests/runner.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/tests/runner.py b/tests/runner.py index 3cefe331..c5c2f998 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -8128,20 +8128,24 @@ fscanfed: 10 - hello self.assertIdentical('texte\n', output[1]) def test_emconfig(self): - output = Popen(['python', EMCONFIG, 'LLVM_ROOT'], stdout=PIPE, stderr=PIPE).communicate()[0] - assert output == LLVM_ROOT + "\n" - invalid = 'Usage: em-config VAR_NAME\n' + output = Popen(['python', EMCONFIG, 'LLVM_ROOT'], stdout=PIPE, stderr=PIPE).communicate()[0].strip() + try: + assert output == LLVM_ROOT + except: + print >> sys.stderr, 'Assertion failed: python %s LLVM_ROOT returned "%s" instead of expected "%s"!' % (EMCONFIG, output, LLVM_ROOT) + raise + invalid = 'Usage: em-config VAR_NAME' # Don't accept variables that do not exist - output = Popen(['python', EMCONFIG, 'VAR_WHICH_DOES_NOT_EXIST'], stdout=PIPE, stderr=PIPE).communicate()[0] + output = Popen(['python', EMCONFIG, 'VAR_WHICH_DOES_NOT_EXIST'], stdout=PIPE, stderr=PIPE).communicate()[0].strip() assert output == invalid # Don't accept no arguments - output = Popen(['python', EMCONFIG], stdout=PIPE, stderr=PIPE).communicate()[0] + output = Popen(['python', EMCONFIG], stdout=PIPE, stderr=PIPE).communicate()[0].strip() assert output == invalid # Don't accept more than one variable - output = Popen(['python', EMCONFIG, 'LLVM_ROOT', 'EMCC'], stdout=PIPE, stderr=PIPE).communicate()[0] + output = Popen(['python', EMCONFIG, 'LLVM_ROOT', 'EMCC'], stdout=PIPE, stderr=PIPE).communicate()[0].strip() assert output == invalid # Don't accept arbitrary python code - output = Popen(['python', EMCONFIG, 'sys.argv[1]'], stdout=PIPE, stderr=PIPE).communicate()[0] + output = Popen(['python', EMCONFIG, 'sys.argv[1]'], stdout=PIPE, stderr=PIPE).communicate()[0].strip() assert output == invalid def test_link_s(self): |