diff options
-rwxr-xr-x | emcc | 6 | ||||
-rw-r--r-- | tests/test_other.py | 9 |
2 files changed, 15 insertions, 0 deletions
@@ -663,6 +663,12 @@ if '-M' in sys.argv or '-MM' in sys.argv: logging.debug('just dependencies: ' + ' '.join(cmd)) exit(subprocess.call(cmd)) +if '-E' in sys.argv: + # Just run the preprocessor + cmd = [CC] + sys.argv[1:] + logging.debug('just preprocssor ' + ' '.join(cmd)) + exit(subprocess.call(cmd)) + # Check if a target is specified target = None for i in range(len(sys.argv)-1): diff --git a/tests/test_other.py b/tests/test_other.py index fd1a6245..c6f5c333 100644 --- a/tests/test_other.py +++ b/tests/test_other.py @@ -1884,3 +1884,12 @@ you should see two lines of text in different colors and a blue rectangle SDL_Quit called (and ignored) done. ''' in output, output + + def test_preprocess(self): + self.clear() + + out, err = Popen([PYTHON, EMCC, path_from_root('tests', 'hello_world.c'), '-E'], stdout=PIPE).communicate() + assert not os.path.exists('a.out.js') + assert '''tests/hello_world.c"''' in out + assert '''printf("hello, world!''' in out + |