aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-11-07 18:01:17 -0800
committerAlon Zakai <alonzakai@gmail.com>2012-11-07 18:01:17 -0800
commit0cf742f9afe26865fca0dbfd79b958ff3dba57e7 (patch)
tree544013799b13027cdd931c82cec0589aeeb4f3ce /tests
parent29b01efc9599d74c4d2b71bf538ed0a897af5855 (diff)
parent886066723acd95cd9aa690291e59e687833ba3a2 (diff)
Merge pull request #677 from juj/test_emconfig
Trim line endings in test_emconfig since they vary per-platform.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/runner.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/tests/runner.py b/tests/runner.py
index d4150c6c..e7b4e6ad 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -8149,20 +8149,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):