diff options
-rw-r--r-- | tests/runner.py | 12 | ||||
-rw-r--r-- | tools/shared.py | 18 |
2 files changed, 16 insertions, 14 deletions
diff --git a/tests/runner.py b/tests/runner.py index 83042d65..b0df18b3 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -137,14 +137,13 @@ class RunnerCore(unittest.TestCase): try: # Make sure we notice if compilation steps failed os.remove(f + '.o') - os.remove(f + '.o.ll') except: pass - output = Popen([Building.COMPILER, '-emit-llvm'] + COMPILER_OPTS + Building.COMPILER_TEST_OPTS + - ['-I', dirname, '-I', os.path.join(dirname, 'include')] + - map(lambda include: '-I' + include, includes) + - ['-c', f, '-o', f + '.o'], - stdout=PIPE, stderr=STDOUT).communicate()[0] + args = [Building.COMPILER, '-emit-llvm'] + COMPILER_OPTS + Building.COMPILER_TEST_OPTS + \ + ['-I', dirname, '-I', os.path.join(dirname, 'include')] + \ + map(lambda include: '-I' + include, includes) + \ + ['-c', f, '-o', f + '.o'] + output = Popen(args, stdout=PIPE).communicate()[0] assert os.path.exists(f + '.o'), 'Source compilation error: ' + output os.chdir(cwd) @@ -1390,6 +1389,7 @@ if 'benchmark' not in str(sys.argv) and 'sanity' not in str(sys.argv): def test_alloca(self): src = ''' #include <stdio.h> + #include <stdlib.h> int main() { char *pc; diff --git a/tools/shared.py b/tools/shared.py index 2b3ac951..12490cdf 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -147,14 +147,16 @@ COMPILER_OPTS = COMPILER_OPTS + ['-m32', '-U__i386__', '-U__x86_64__', '-U__i386 USE_EMSDK = not os.environ.get('EMMAKEN_NO_SDK') if USE_EMSDK: - EMSDK_OPTS = [ '-nostdinc', - '-I' + path_from_root('system', 'include'), - '-I' + path_from_root('system', 'include', 'bsd'), # posix stuff - '-I' + path_from_root('system', 'include', 'libc'), - '-I' + path_from_root('system', 'include', 'libcxx'), - '-I' + path_from_root('system', 'include', 'gfx'), - '-I' + path_from_root('system', 'include', 'net'), - '-I' + path_from_root('system', 'include', 'SDL'), + # Disable system C and C++ include directories, and add our own (using -idirafter so they are last, like system dirs, which + # allows projects to override them) + EMSDK_OPTS = [ '-nostdinc', '-nostdinc++', + '-idirafter' + path_from_root('system', 'include'), + '-idirafter' + path_from_root('system', 'include', 'bsd'), # posix stuff + '-idirafter' + path_from_root('system', 'include', 'libc'), + '-idirafter' + path_from_root('system', 'include', 'libcxx'), + '-idirafter' + path_from_root('system', 'include', 'gfx'), + '-idirafter' + path_from_root('system', 'include', 'net'), + '-idirafter' + path_from_root('system', 'include', 'SDL'), ] + [ '-U__APPLE__' ] |