Test suites
Unit tests (unit_test)
GTest-based, deterministic, no external data. Targets compiled when -DBUILD_UNIT_TEST=ON. Cover:
TestKalmanFilter: initiate/predict/update, Mahalanobis distance, gate flags, LLT cacheTestTracklet: lifecycle transitions, feature EMATestRect: TLWH/TLBR/XYWH conversionsTestReID: cosine similarity, max-history lookupTestCostMatrix: resize semantics, sentinel preservationTestTimingPolicies: frame vs wall-clock conversion and expiry symmetryTestDistanceStrategies: each cost calculator (IoU/DIoU/GIoU/SIoU/Cosine/ReIDFirst/PureReID/Fused/GatedIoU/FuseScoreDecorator)TestAssignmentSolvers: LAPJV correctness on dense and sparse matricesTestTrackerTentative: adaptive confirmation logicTestTrackerBuffers: track_buffer expiry under both timing modesTestLogger: callback dispatch, va_list pathTestSushiTrackC/TestCAPIErrors: C-API surface and error codesTestTracker/TestIntegration: end-to-end flowTestBoundaryConditions: empty inputs, oversized output buffer, null argsTestConfiguration: config-driven parameter parsing
Direct invocation:
st run unit_test
st run unit_test -- --gtest_filter="TrackletTest.*"
st test --suite unit # ctest --test-dir build -L '^unit$'
Regression tests (regression_test)
Parameterised GTest binary that iterates over Scenario × tracker_factory. For each pair it:
- Reads
det.txtframes viaMOTRunner. - Drives the tracker through
ITrackerAdapter(SushiTrackAdapter,ByteTrackAdapter,OCSORTAdapter). - Writes predictions to
<sequence>/pred/<tracker>/<sequence>.txt. - Emits a
[ PERF <tracker> ] <sequence>: <us/frame> us/frameline read back by the CLI (cli/sushitrack_cli/services/label.py).
Config resolution: SushiTrack loads sushitrack.json through the library ($SUSHITRACK_CONFIG, then an upward search); ByteTrack and OCSORT read tests/bytetrack.json and tests/ocsort.json.
Direct invocation:
./build/bin/Release/regression_test
./build/bin/Release/regression_test --gtest_filter="*MOT17_04_DPM_sushitrack*"
SUSHITRACK_CONFIG=./sushitrack.json ./build/bin/Release/regression_test
Integration tests (integration_test)
GTest binary that drives the tracker end-to-end exclusively through the C API, as a downstream FFI consumer would. Targets compiled when -DBUILD_INTEGRATION_TEST=ON. Cover:
TestByteAssociation: two-stage BYTE association: low-confidence sustain, new-track seeding rulesTestOcclusionRecovery: lost-track buffering, within/beyond-buffer recovery, no id transferTestMultiObject: identity separation, counter-moving pass, output capacity/priority contractTestConfigVariations: IoU variant sweep, XYAH coordinates, NSA KalmanTestAdvancedPath: ReID + Mahalanobis gatingTestFullStack: full advanced stack enabled at onceTestKinematicState: IMM-derived regime reported end-to-end (Stationary/Cruising/Maneuvering/Coasting)TestObservationMomentum: observation-centric momentum re-ranking and ORU recoveryTestDuplicateSuppression: cross-pool duplicate removal by track lifetimeTestTimeAware: wall-clock (time_aware) stepping and expiry
Direct invocation:
st run integration_test
st test --suite integration # ctest --test-dir build -L '^integration$'
CLI tests (cli/tests/)
A pytest suite for the st package. It needs no build.
sushitrack_cli imports sushicore at module load, so the suite cannot be collected without it.
sushicore is an ordinary PyPI dependency of the CLI, not a checkout to be found on disk, so
cli/tests/conftest.py searches for nothing: sushicore is installed or it is not, and
conftest.py raises when it is not.
The package under test sits in cli/, one level above conftest.py, and the suite is run from the
repository root as often as from cli/. conftest.py puts cli/ on sys.path so the same
command works from either.
Nothing in the fixtures reaches the machine. A test that runs a real tool, prints through the shared console, or reads the developer’s own project says something different on someone else’s machine.
Direct invocation:
python -m pytest cli/tests -q

