FileBarge tests
Run the complete test suite from the project directory:
make test
The target builds the normal binary, all *.test.c unit-test executables, and a special sender that always uses chunked transfer. It then runs every tests/stage*/test-*.sh script in shell glob order. A failing test stops the suite.
When enabled by BUILD_SKIFF=1, the suite also builds FileSkiff and its chunked-transfer test binary. The transfer tests run the applicable binary pairs: FileBarge to FileBarge, FileSkiff to FileSkiff, FileSkiff to FileBarge, and FileBarge to FileSkiff. Options unavailable in FileSkiff are omitted for pairs involving it.
Use TEST_STAGES to run only selected stages:
make TEST_STAGES='1 3' test
Stage 1: command line
tests/stage1/test-cli.sh checks version output, sender and receiver help headings, help aliases, complete top-level help, the supported optional protocol algorithms, invalid timeout and feature selections, and command-specific option validation. It runs against both FileBarge and FileSkiff.
Stage 2: unit tests
tests/stage2/test-units.sh discovers and runs every executable unit-test binary built below .test/bin. The current unit tests cover configuration, Fletcher32, compression, session behavior, protocol packets, and POSIX path, socket, and thread helpers.
Stage 3: transfer sessions
The stage 3 scripts exercise end-to-end transfers over a local TCP connection. They cover ordinary transfers, receiver lifetime and listening, handshakes, directory traversal, path safety, POSIX permissions, replacement rules, Fletcher32 checksums, Squinch compression, combined compression and checksums, and shared-secret encryption including rejection when the peers use different secrets. The transfer tests run the FileBarge and FileSkiff binary pairs listed above wherever the selected options are available.
Stage 4: chunked transfer
tests/stage4/test-chunked.sh reruns the stage 3 transfer tests with FileBarge and FileSkiff binaries compiled with FILEBARGE_FORCE_CHUNKED_TRANSFER=1. This protects the stream framing path independently of the normal known-size transfer path and repeats the supported binary-pair coverage.
Test support
tests/lib/lib-test.sh creates isolated temporary directories, starts and waits for local receivers, and supplies common assertions. tests/lib/lib-transfer.sh and tests/lib/lib-output.sh provide transfer and result-output helpers used by the staged scripts.
When adding a feature, extend the narrowest applicable existing test and add a new focused test when the feature has a distinct contract. In particular, protocol changes should cover valid framing, invalid framing, state-machine rejection, and a complete transfer when applicable.