taskwarrior/integration-tests
Dustin J. Mitchell 33a3b980d0
Allow taking from pointer lists
This introduces `tc_task_list_take`, supporting taking ownership of an
item in a task list.

TCTaskList is the only pointer list, but this is a generic and could be
used for other types.
2022-03-13 16:25:59 +00:00
..
src Allow taking from pointer lists 2022-03-13 16:25:59 +00:00
tests add an integration test for syncing task expirations 2022-03-07 23:37:31 +00:00
.gitignore add server support 2022-02-13 20:18:07 +00:00
build.rs include BCrypt on Windows 2022-02-27 17:59:58 +00:00
Cargo.toml add an integration test for syncing task expirations 2022-03-07 23:37:31 +00:00
README.md fix typo 2022-02-05 00:25:02 +00: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.