taskwarrior/rust/integration-tests
dependabot[bot] b1f13b29c3 Bump env_logger from 0.8.4 to 0.9.0
Bumps [env_logger](https://github.com/env-logger-rs/env_logger) from 0.8.4 to 0.9.0.
- [Release notes](https://github.com/env-logger-rs/env_logger/releases)
- [Changelog](https://github.com/env-logger-rs/env_logger/blob/main/CHANGELOG.md)
- [Commits](https://github.com/env-logger-rs/env_logger/compare/v0.8.4...v0.9.0)

---
updated-dependencies:
- dependency-name: env_logger
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-29 21:00:27 -04:00
..
src move contents of taskchampion repo to tc/ 2022-05-08 19:39:02 +00:00
tests move contents of taskchampion repo to tc/ 2022-05-08 19:39:02 +00:00
.gitignore move contents of taskchampion repo to tc/ 2022-05-08 19:39:02 +00:00
build.rs move contents of taskchampion repo to tc/ 2022-05-08 19:39:02 +00:00
Cargo.toml Bump env_logger from 0.8.4 to 0.9.0 2022-05-29 21:00:27 -04:00
README.md move contents of taskchampion repo to tc/ 2022-05-08 19:39: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.