taskwarrior/taskchampion/integration-tests
ryneeverett 34c0e67469
show undo diff (#3213)
Exposes undo operations via the C API, and uses those to show a (new, differently formatted) diff before committing the undo.
2024-02-09 22:11:14 -05:00
..
src show undo diff (#3213) 2024-02-09 22:11:14 -05:00
tests Change "client key" to "client id" (#3130) 2023-07-11 22:13:53 -04:00
.gitignore rename rust/ to taskchampion/ 2022-07-29 21:41:41 -04:00
build.rs Use ffizz_header to generate taskchampion.h 2023-06-19 13:36:17 -04:00
Cargo.toml Update to 2021 edition (#3217) 2023-12-24 08:58:04 -05:00
README.md Better links from TW devel docs to TaskChampion (#3253) 2024-01-21 18:03:11 -05:00

Integration Tests for TaskChampion

"Regular" Tests

Some of the tests in tests/ are just regular integration tests. Nothing exciting to see.

Bindings Tests

The bindings tests are a bit more interesting, since they are written in C. They are composed of a collection of "suites", each in one C file in integration-tests/src/bindings_tests/. Each suite contains a number of tests (using Unity) and an exported function named after the suite that returns an exit status (1 = failure).

The build script (integration-tests/build.rs) builds these files into a library that is linked with the integration_tests library crate. This crate contains a bindings_tests module with a pub function for each suite.

Finally, the integration-tests/tests/bindings.rs test file calls each of those functions in a separate test case.

Adding Tests

To add a test, select a suite and add a new test-case function. Add a RUN_TEST invocation for your new function to the .._tests function at the bottom. Keep the RUN_TESTs in the same order as the functions they call.

Adding Suites

To add a suite,

  1. Add a new C file in integration-tests/src/bindings_tests/, based off of one of the others.
  2. Add a the suite name to suites in integration-tests/build.rs.