aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/test_other.py14
-rw-r--r--tools/shared.py6
2 files changed, 13 insertions, 7 deletions
diff --git a/tests/test_other.py b/tests/test_other.py
index 137a83b1..349a16b4 100644
--- a/tests/test_other.py
+++ b/tests/test_other.py
@@ -2291,15 +2291,17 @@ mergeInto(LibraryManager.library, {
self.clear()
os.mkdir(outdir)
- 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], stderr=PIPE)
+ out, err = process.communicate()
+ assert not err, err
+ assert os.path.isfile(outdir + 'hello_world.o')
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'))
+ process = Popen([PYTHON, EMCC, '-c', path_from_root('tests', 'hello_world.c'), '-o', outdir, '--default-obj-ext', 'obj'], stderr=PIPE)
+ out, err = process.communicate()
+ assert not err, err
+ assert os.path.isfile(outdir + 'hello_world.obj')
def test_doublestart_bug(self):
open('code.cpp', 'w').write(r'''
diff --git a/tools/shared.py b/tools/shared.py
index 826baa83..5305d46b 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -1836,7 +1836,11 @@ def unsuffixed_basename(name):
return os.path.basename(unsuffixed(name))
def safe_move(src, dst):
- if os.path.abspath(src) == os.path.abspath(dst):
+ src = os.path.abspath(src)
+ dst = os.path.abspath(dst)
+ if os.path.isdir(dst):
+ dst = os.path.join(dst, os.path.basename(src))
+ if src == dst:
return
shutil.move(src, dst)