Skip to content

Commit 12b98d7

Browse files
committed
fix(tests): fix tracer name detection
When running tests, the test runner determines the name of the tracer ('pure' or 'native', based on the name of the tracer). This name is used to create a proper 'pure' or 'native' subdirectory for the trace output. The tracer name detection used to check for the presence of the substring 'native' in the tracer name. Unfortunately, this didn't work at all, because the 'native' tracer doesn't have 'native' in its name. The two tracers are called: 1) codetracer-pure-ruby-recorder 2) codetracer-ruby-recorder So, both tracers were detected as 'pure' (not 'native'), and wrote their output in the 'pure' subdirectory. This commit inverts the check, so now we test for the presence of the word 'pure', instead of 'native'.
1 parent 6a522b6 commit 12b98d7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/test_tracer.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def setup
1818

1919
def run_trace(tracer_script, program_name, *args)
2020
base = File.basename(program_name, '.rb')
21-
tracer_name = tracer_script.include?('native') ? 'native' : 'pure'
21+
tracer_name = tracer_script.include?('pure') ? 'pure' : 'native'
2222
Dir.chdir(File.expand_path('..', __dir__)) do
2323
program = File.join('test', 'programs', program_name)
2424
out_dir = File.join('test', 'tmp', base, tracer_name)
@@ -34,7 +34,7 @@ def run_trace(tracer_script, program_name, *args)
3434

3535
def run_trace_with_separator(tracer_script, program_name, *args)
3636
base = File.basename(program_name, '.rb')
37-
tracer_name = tracer_script.include?('native') ? 'native' : 'pure'
37+
tracer_name = tracer_script.include?('pure') ? 'pure' : 'native'
3838
Dir.chdir(File.expand_path('..', __dir__)) do
3939
program = File.join('test', 'programs', program_name)
4040
out_dir = File.join('test', 'tmp', "#{base}_dashdash", tracer_name)

0 commit comments

Comments
 (0)