do not emit temp .o files to curr dir, if target is not them; fixes #2644
This commit is contained in:
Родитель
bff7dd6cb6
Коммит
c2d449216c
3
emcc
3
emcc
|
@ -1447,7 +1447,8 @@ try:
|
|||
return os.path.join(specified_target, os.path.basename(unsuffixed(input_file))) + default_object_extension
|
||||
return specified_target
|
||||
return unsuffixed(input_file) + final_ending
|
||||
return unsuffixed(input_file) + default_object_extension
|
||||
else:
|
||||
if has_dash_c: return unsuffixed(input_file) + default_object_extension
|
||||
return in_temp(unsuffixed(uniquename(input_file)) + default_object_extension)
|
||||
|
||||
# First, generate LLVM bitcode. For each input file, we get base.o with bitcode
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import multiprocessing, os, re, shutil, subprocess, sys
|
||||
import glob
|
||||
import tools.shared
|
||||
from tools.shared import *
|
||||
from runner import RunnerCore, path_from_root, get_bullet_library, nonfastcomp
|
||||
|
@ -3911,3 +3912,19 @@ main(const int argc, const char * const * const argv)
|
|||
self.assertContained('Constructed locale "C"\nThis locale is the global locale.\nThis locale is the C locale.', run_js('a.out.js', args=['C']))
|
||||
self.assertContained('''Can't construct locale "waka": collate_byname<char>::collate_byname failed to construct for waka''', run_js('a.out.js', args=['waka'], assert_returncode=1))
|
||||
|
||||
def test_cleanup_os(self):
|
||||
# issue 2644
|
||||
def test(args, be_clean):
|
||||
print args
|
||||
self.clear()
|
||||
shutil.copyfile(path_from_root('tests', 'hello_world.c'), 'a.c')
|
||||
open('b.c', 'w').write(' ')
|
||||
Popen([PYTHON, EMCC, 'a.c', 'b.c'] + args).communicate()
|
||||
clutter = glob.glob('*.o')
|
||||
if be_clean: assert len(clutter) == 0, 'should not leave clutter ' + str(clutter)
|
||||
else: assert len(clutter) == 2, 'should leave .o files'
|
||||
test(['-o', 'c.bc'], True)
|
||||
test(['-o', 'c.js'], True)
|
||||
test(['-o', 'c.html'], True)
|
||||
test(['-c'], False)
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче