Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,20 @@ To run the test suite, execute:
just test
```

The tester executes a number of sample programs in `test/programs` and compares their outputs to the fixtures in `test/fixtures`.
The test suite executes a number of sample programs in `test/programs` under
the two separate recorders/tracers:

* One based on a Ruby native extension in `gems/native-tracer`
* Another based on pure Ruby code in `gems/pure-ruby-tracer`

Their outputs are compared structurally to known good outputs stored
in `test/fixtures`.

When `just test` fails, I suggest running the two tracers directly and
analyzing where their outputs differs.

Please note that only the pure-ruby-tracer formats the output json for
human readability. Thus, you must use `jq -S` when comparing the outputs.

To run the benchmark, execute:

Expand Down
9 changes: 7 additions & 2 deletions examples/selective_tracing.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/usr/bin/env ruby
ext_base = File.expand_path('../gems/native-tracer/ext/native_tracer/target/release/libcodetracer_ruby_recorder', __dir__)
require ext_base

# Load the native extension only if RubyRecorder is not already available
# (e.g., when running directly without the codetracer wrapper)
unless defined?(RubyRecorder)
ext_base = File.expand_path('../gems/native-tracer/ext/native_tracer/target/release/libcodetracer_ruby_recorder', __dir__)
require ext_base
end

recorder = RubyRecorder.new

Expand Down
Loading
Loading