diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-05-15 10:58:20 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-05-15 10:58:20 -0700 |
commit | 997ae359174d383de47cdb0decadc9a2d906f430 (patch) | |
tree | 3c553e7eb81c5bb5b347015b06eb2402f6b44934 /tests/runner.py | |
parent | 354a88d763284fae92a59d311f8562542ad10a97 (diff) | |
parent | 2b2add48545101de5776c9b26701245c43a8fcb0 (diff) |
Merge pull request #426 from ehsan/em-config
Add the em-config tool
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-x | tests/runner.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py index 126be5aa..848b29fe 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -6094,6 +6094,23 @@ def process(filename): ''' self.do_run(src, 'hello, world!\ncleanup\nExit Status: 118') + 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' + # Don't accept variables that do not exist + output = Popen(['python', EMCONFIG, 'VAR_WHICH_DOES_NOT_EXIST'], stdout=PIPE, stderr=PIPE).communicate()[0] + assert output == invalid + # Don't accept no arguments + output = Popen(['python', EMCONFIG], stdout=PIPE, stderr=PIPE).communicate()[0] + assert output == invalid + # Don't accept more than one variable + output = Popen(['python', EMCONFIG, 'LLVM_ROOT', 'EMCC'], stdout=PIPE, stderr=PIPE).communicate()[0] + assert output == invalid + # Don't accept arbitrary python code + output = Popen(['python', EMCONFIG, 'sys.argv[1]'], stdout=PIPE, stderr=PIPE).communicate()[0] + assert output == invalid + # Generate tests for everything def make_run(fullname, name=-1, compiler=-1, llvm_opts=0, embetter=0, quantum_size=0, typed_arrays=0, emcc_args=None): |