diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-03-26 10:43:07 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-03-26 10:43:07 -0700 |
commit | c4038a1fc9adba8c1a833717ec3145da98365c09 (patch) | |
tree | 0b6a8d5faabe385a8a100a21e566a50943306b02 /tests | |
parent | bffcb8c7fe594af93749c7313d784b2341ed7532 (diff) |
handle --default-object-ext properly, and other emcc fixes
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_other.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/test_other.py b/tests/test_other.py index 21c9ed25..e5fe49d7 100644 --- a/tests/test_other.py +++ b/tests/test_other.py @@ -65,6 +65,7 @@ Options that are modified or new in %s include: # emcc src.cpp -c and emcc src.cpp -o src.[o|bc] ==> should give a .bc file # regression check: -o js should create "js", with bitcode content for args in [['-c'], ['-o', 'src.o'], ['-o', 'src.bc'], ['-o', 'src.so'], ['-o', 'js']]: + print '-c stuff', args target = args[1] if len(args) == 2 else 'hello_world.o' self.clear() Popen([PYTHON, compiler, path_from_root('tests', 'hello_world' + suffix)] + args, stdout=PIPE, stderr=PIPE).communicate() @@ -943,11 +944,12 @@ This pointer might make sense in another type signature: i: 0 args=['-I' + path_from_root('tests', 'zlib')], suffix='c') def test_symlink(self): + self.clear() if os.name == 'nt': return self.skip('Windows FS does not need to be tested for symlinks support, since it does not have them.') open(os.path.join(self.get_dir(), 'foobar.xxx'), 'w').write('int main(){ return 0; }') os.symlink(os.path.join(self.get_dir(), 'foobar.xxx'), os.path.join(self.get_dir(), 'foobar.c')) - Popen([PYTHON, EMCC, os.path.join(self.get_dir(), 'foobar.c'), '-o', os.path.join(self.get_dir(), 'foobar')], stdout=PIPE, stderr=PIPE).communicate() + Popen([PYTHON, EMCC, os.path.join(self.get_dir(), 'foobar.c'), '-o', os.path.join(self.get_dir(), 'foobar')]).communicate() assert os.path.exists(os.path.join(self.get_dir(), 'foobar')) try_delete(os.path.join(self.get_dir(), 'foobar')) try_delete(os.path.join(self.get_dir(), 'foobar.xxx')) @@ -955,7 +957,7 @@ This pointer might make sense in another type signature: i: 0 open(os.path.join(self.get_dir(), 'foobar.c'), 'w').write('int main(){ return 0; }') os.symlink(os.path.join(self.get_dir(), 'foobar.c'), os.path.join(self.get_dir(), 'foobar.xxx')) - Popen([PYTHON, EMCC, os.path.join(self.get_dir(), 'foobar.xxx'), '-o', os.path.join(self.get_dir(), 'foobar')], stdout=PIPE, stderr=PIPE).communicate() + Popen([PYTHON, EMCC, os.path.join(self.get_dir(), 'foobar.xxx'), '-o', os.path.join(self.get_dir(), 'foobar')]).communicate() assert os.path.exists(os.path.join(self.get_dir(), 'foobar')) try_delete(os.path.join(self.get_dir(), 'foobar')) try_delete(os.path.join(self.get_dir(), 'foobar.xxx')) @@ -2294,11 +2296,16 @@ mergeInto(LibraryManager.library, { def test_default_obj_ext(self): outdir = os.path.join(self.get_dir(), 'out_dir') + '/' + + self.clear() os.mkdir(outdir) - process = Popen([PYTHON, EMCC, '-c', path_from_root('tests', 'hello_world.c'), '-o', outdir], stdout=PIPE, stderr=PIPE) + process = Popen([PYTHON, EMCC, '-c', path_from_root('tests', 'hello_world.c'), '-o', outdir]) process.communicate() assert(os.path.isfile(outdir + 'hello_world.o')) - process = Popen([PYTHON, EMCC, '-c', path_from_root('tests', 'hello_world.c'), '-o', outdir, '--default-obj-ext', 'obj'], stdout=PIPE, stderr=PIPE) + + self.clear() + os.mkdir(outdir) + process = Popen([PYTHON, EMCC, '-c', path_from_root('tests', 'hello_world.c'), '-o', outdir, '--default-obj-ext', 'obj']) process.communicate() assert(os.path.isfile(outdir + 'hello_world.obj')) |