# dcr test Runs the project's test suite. ## Usage ```sh dcr test dcr test --release dcr test --target linux dcr test --init ``` ## What `test` does 1. Builds the project with the specified profile/target. 2. Compiles test files in `tests/` (e.g., `tests/test.c`) into a test binary. 3. Runs the test binary and parses output for PASS/SKIP/FAIL results. 4. Reports summary with colored output. ## Test Structure DCR uses a simple test framework: - Header: `tests/dcr_test.h` (generated by `dcr test --init`) - Test file: `tests/test.c` (template generated by `dcr test --init`) - Macros: `TEST(name)`, `TEST_CASE(name)`, `EXPECT(condition)`, `SKIP(reason)` - Output: `[PASS] test_name`, `[FAIL] test_name`, or `[SKIP] test_name` ## Config values used - `package.name` - `build.compiler`, `build.language`, `build.standard` - `build.cflags`, `build.ldflags` - `build.debug` / `build.release` - `build.targets` (if specified) ## Notes - Test binary is linked with the main project (for lib projects) or standalone. - `--init` creates `tests/dcr_test.h` and `tests/test.c` if missing. - Tests run in release mode by default for performance. - Custom test logic can be added by editing `tests/test.c`. - Fails if no `tests/test.c` exists (run `dcr test --init` first).