Skip to content

Commit 7891e89

Browse files
committed
feat(tracer): handle more Ruby types
Other changes: - Added more notes for Codex regaring running the test suite
1 parent 3e9e3d7 commit 7891e89

File tree

7 files changed

+516
-43
lines changed

7 files changed

+516
-43
lines changed

AGENTS.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,20 @@ To run the test suite, execute:
1212
just test
1313
```
1414

15-
The tester executes a number of sample programs in `test/programs` and compares their outputs to the fixtures in `test/fixtures`.
15+
The test suite executes a number of sample programs in `test/programs` under
16+
the two separate recorders/tracers:
17+
18+
* One based on a Ruby native extension in `gems/native-tracer`
19+
* Another based on pure Ruby code in `gems/pure-ruby-tracer`
20+
21+
Their outputs are compared structurally to known good outputs stored
22+
in `test/fixtures`.
23+
24+
When `just test` fails, I suggest running the two tracers directly and
25+
analyzing where their outputs differs.
26+
27+
Please note that only the pure-ruby-tracer formats the output json for
28+
human readability. Thus, you must use `jq -S` when comparing the outputs.
1629

1730
To run the benchmark, execute:
1831

examples/selective_tracing.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
#!/usr/bin/env ruby
2-
ext_base = File.expand_path('../gems/native-tracer/ext/native_tracer/target/release/libcodetracer_ruby_recorder', __dir__)
3-
require ext_base
2+
3+
# Load the native extension only if RubyRecorder is not already available
4+
# (e.g., when running directly without the codetracer wrapper)
5+
unless defined?(RubyRecorder)
6+
ext_base = File.expand_path('../gems/native-tracer/ext/native_tracer/target/release/libcodetracer_ruby_recorder', __dir__)
7+
require ext_base
8+
end
49

510
recorder = RubyRecorder.new
611

0 commit comments

Comments
 (0)