Skip to content

Commit b99a7fb

Browse files
committed
refactor: use TMP_DIR everywhere in the test runner
1 parent 62b4b96 commit b99a7fb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/test_tracer.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def run_trace(tracer_script, program_name, *args)
2121
tracer_name = tracer_script.include?('pure') ? 'pure' : 'native'
2222
Dir.chdir(File.expand_path('..', __dir__)) do
2323
program = File.join('test', 'programs', program_name)
24-
out_dir = File.join('test', 'tmp', base, tracer_name)
24+
out_dir = File.join(TMP_DIR, base, tracer_name)
2525
FileUtils.mkdir_p(out_dir)
2626
stdout, stderr, status = Open3.capture3(RbConfig.ruby, tracer_script, '--out-dir', out_dir, program, *args)
2727
raise "trace failed: #{stderr}" unless status.success?
@@ -37,7 +37,7 @@ def run_trace_with_separator(tracer_script, program_name, *args)
3737
tracer_name = tracer_script.include?('pure') ? 'pure' : 'native'
3838
Dir.chdir(File.expand_path('..', __dir__)) do
3939
program = File.join('test', 'programs', program_name)
40-
out_dir = File.join('test', 'tmp', "#{base}_dashdash", tracer_name)
40+
out_dir = File.join(TMP_DIR, "#{base}_dashdash", tracer_name)
4141
FileUtils.mkdir_p(out_dir)
4242
stdout, stderr, status = Open3.capture3(
4343
RbConfig.ruby, tracer_script, '--out-dir', out_dir, '--', program, *args
@@ -97,7 +97,7 @@ def test_args_sum_with_separator
9797
def test_pure_debug_smoke
9898
Dir.chdir(File.expand_path('..', __dir__)) do
9999
env = { 'CODETRACER_RUBY_RECORDER_DEBUG' => '1' }
100-
out_dir = File.join('test', 'tmp', 'debug_smoke')
100+
out_dir = File.join(TMP_DIR, 'debug_smoke')
101101
FileUtils.rm_rf(out_dir)
102102
stdout, stderr, status = Open3.capture3(env, RbConfig.ruby, 'gems/codetracer-pure-ruby-recorder/bin/codetracer-pure-ruby-recorder', '--out-dir', out_dir, File.join('test', 'programs', 'addition.rb'))
103103
raise "trace failed: #{stderr}" unless status.success?

0 commit comments

Comments
 (0)