I exercise the long-lived GtBridge.Xref service end-to-end and the
refactored callers (function_references/3, module_graph/1) that
depend on it. Acts as a regression catcher for the substrate
cleanup — if anyone removes the xref subscription or the supervision
child, these examples go red.
Summary
Functions
I find callers of GtBridge.Xref.q/1 — known to be called from GtBridge.Analysis (function_references/3 and module_graph/1 both use it). Asserts the long-lived xref index sees these and returns hydrated entries with module/name/arity.
I run a real call-graph query and verify the long-lived index sees edges from this very module. Uses GtBridge.Analysis.module_graph/1 scoped to gt_bridge so the result set is bounded.
I prove the xref index reacts to BeamModuleRecompiled events. Insert a fake module in the index, broadcast a recompile event for a known module, and assert the xref query reflects the BEAM's current state.
I assert that the long-lived xref process is registered, indexed, and answering basic queries. Returns the loaded-modules count so callers can sanity-check it grew with the BEAM.
Callback implementation for ExExample.Behaviour.copy/1.
Callback implementation for ExExample.Behaviour.rerun?/1.
Functions
I find callers of GtBridge.Xref.q/1 — known to be called from GtBridge.Analysis (function_references/3 and module_graph/1 both use it). Asserts the long-lived xref index sees these and returns hydrated entries with module/name/arity.
I run a real call-graph query and verify the long-lived index sees edges from this very module. Uses GtBridge.Analysis.module_graph/1 scoped to gt_bridge so the result set is bounded.
I prove the xref index reacts to BeamModuleRecompiled events. Insert a fake module in the index, broadcast a recompile event for a known module, and assert the xref query reflects the BEAM's current state.
Indirect verification — we can't easily diff xref state before/after without another query — so we just assert the recompile path doesn't crash and the post-recompile query still works.
I assert that the long-lived xref process is registered, indexed, and answering basic queries. Returns the loaded-modules count so callers can sanity-check it grew with the BEAM.
Callback implementation for ExExample.Behaviour.copy/1.
@spec function_references_finds_callers() :: [map()]
@spec module_graph_finds_edges() :: non_neg_integer()
@spec recompile_event_keeps_index_valid() :: non_neg_integer()
Callback implementation for ExExample.Behaviour.rerun?/1.
@spec running() :: non_neg_integer()