diff options
-rw-r--r-- | mjit_worker.c | 12 | ||||
-rw-r--r-- | test/ruby/test_jit.rb | 9 |
2 files changed, 10 insertions, 11 deletions
diff --git a/mjit_worker.c b/mjit_worker.c index 184a4a92e1..0b5d27fa35 100644 --- a/mjit_worker.c +++ b/mjit_worker.c @@ -756,8 +756,16 @@ compile_c_to_so(const char *c_file, const char *so_file) free(args); if (exit_code == 0) { - /* remove never-used .obj file. XXX: Is there any way not to generate this? */ - if (!mjit_opts.save_temps) remove_file(obj_file); + /* remove never-used files (.obj, .lib, .exp, .pdb). XXX: Is there any way not to generate this? */ + if (!mjit_opts.save_temps) { + char *before_dot; + remove_file(obj_file); + + before_dot = obj_file + strlen(obj_file) - rb_strlen_lit(".obj"); + append_lit(before_dot, ".lib"); remove_file(obj_file); + append_lit(before_dot, ".exp"); remove_file(obj_file); + append_lit(before_dot, ".pdb"); remove_file(obj_file); + } } else { verbose(2, "compile_c_to_so: compile error: %d", exit_code); diff --git a/test/ruby/test_jit.rb b/test/ruby/test_jit.rb index 701e3d109a..ac5ea211f4 100644 --- a/test/ruby/test_jit.rb +++ b/test/ruby/test_jit.rb @@ -552,7 +552,6 @@ class TestJIT < Test::Unit::TestCase end def test_unload_units - skip_on_mswin Dir.mktmpdir("jit_test_unload_units_") do |dir| # MIN_CACHE_SIZE is 10 out, err = eval_with_jit({"TMPDIR"=>dir}, "#{<<~"begin;"}\n#{<<~'end;'}", verbose: 1, min_calls: 1, max_cache: 10) @@ -717,7 +716,6 @@ class TestJIT < Test::Unit::TestCase end def test_clean_so - skip_on_mswin Dir.mktmpdir("jit_test_clean_so_") do |dir| code = "x = 0; 10.times {|i|x+=i}" eval_with_jit({"TMPDIR"=>dir}, code) @@ -797,13 +795,6 @@ class TestJIT < Test::Unit::TestCase private - # Some tests are stil failing on VC++. - def skip_on_mswin - if RUBY_PLATFORM.match?(/mswin/) - skip 'This test does not succeed on mswin yet.' - end - end - def skip_on_mingw if RUBY_PLATFORM.match?(/mingw/) skip 'This test does not succeed on mingw yet.' |