diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-12-11 10:23:03 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-12-11 10:23:03 -0800 |
commit | 58f694a190e414af9f811a72952e0ba3f7d94b83 (patch) | |
tree | 81c142917d824abeccfbe2654954acb58a582ac6 | |
parent | 994e01663b94c16a681a71255d8a1f87f1a23973 (diff) |
emcc: --version
-rwxr-xr-x | em++ | 9 | ||||
-rwxr-xr-x | emcc | 21 | ||||
-rw-r--r-- | tests/runner.py | 10 | ||||
-rw-r--r-- | tools/shared.py | 2 |
4 files changed, 25 insertions, 17 deletions
@@ -5,13 +5,8 @@ See emcc.py. This script forwards to there, noting that we want C++ and not C by ''' import os, sys +from tools import shared -__rootpath__ = os.path.abspath(os.path.dirname(__file__)) -def path_from_root(*pathelems): - return os.path.join(__rootpath__, *pathelems) -exec(open(path_from_root('tools', 'shared.py'), 'r').read()) - -emmaken = path_from_root('tools', 'emmaken.py') os.environ['EMMAKEN_CXX'] = '1' -exit(os.execvp('python', ['python', emmaken] + sys.argv[1:])) +exit(os.execvp(shared.EMCC, [shared.EMCC] + sys.argv[1:])) @@ -95,25 +95,28 @@ emcc can be influenced by a few environment variables: import sys import os import subprocess +from tools import shared DEBUG = 0 ################### XXX -print >> sys.stderr, '***This is a WORK IN PROGRESS***' +print >> sys.stderr, '\n***This is a WORK IN PROGRESS***' +print >> sys.stderr, '***[%s]***\n' % str(sys.argv) ################### XXX if DEBUG: print >> sys.stderr, 'emcc.py: ', ' '.join(sys.argv) -__rootpath__ = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) -def path_from_root(*pathelems): - return os.path.join(__rootpath__, *pathelems) -exec(open(path_from_root('tools', 'shared.py'), 'r').read()) - # Handle some global flags + +if len(sys.argv) == 1: + print 'emcc: no input files' + exit(0) + if sys.argv[1] == '--version': - print '''emcc 2.X -This is drop-in compiler replacement for Emscripten -http://emscripten.org + print '''emcc (Emscripten GCC-like replacement) 2.0 +Copyright (C) 2011 the Emscripten authors. +This is free and open source software under the MIT license. +There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ''' exit(0) elif sys.argv[1] == '--help': diff --git a/tests/runner.py b/tests/runner.py index cdb2309b..34f76e70 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -4868,7 +4868,15 @@ TT = %s class other(RunnerCore): def test_emcc(self): - pass + for compiler in [EMCC, EMXX]: + # --version + output = Popen([compiler, '--version'], stdout=PIPE, stderr=PIPE).communicate(input)[0] + self.assertContained('''emcc (Emscripten GCC-like replacement) 2.0 +Copyright (C) 2011 the Emscripten authors. +This is free and open source software under the MIT license. +There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +''', output) + # TODO: make sure all of these match gcc # TODO: when this is done, more test runner to test these (i.e., test all -Ox thoroughly) # -- options: check these, warn about errors. valid gcc ones are help, version. Ours should be -- too, not -. diff --git a/tools/shared.py b/tools/shared.py index 0aead08a..5c5da098 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -26,6 +26,8 @@ COFFEESCRIPT = path_from_root('tools', 'eliminator', 'node_modules', 'coffee-scr EMSCRIPTEN = path_from_root('emscripten.py') DEMANGLER = path_from_root('third_party', 'demangler.py') NAMESPACER = path_from_root('tools', 'namespacer.py') +EMCC = path_from_root('emcc') +EMXX = path_from_root('em++') EMMAKEN = path_from_root('tools', 'emmaken.py') AUTODEBUGGER = path_from_root('tools', 'autodebugger.py') DFE = path_from_root('tools', 'dead_function_eliminator.py') |