auto-fuzz-test icon indicating copy to clipboard operation
auto-fuzz-test copied to clipboard

Better unit testing with workspaces

Open totikom opened this issue 4 years ago • 0 comments

Our unit tests works as follows:

  1. Copy 'tests/test-lib' to target
  2. Build 'target/test-lib' (this invokes our macro and creates 'target/test-lib/fuzz' directory with different fuzz-targets)
  3. Build each fuzz-target in 'target/test-lib/fuzz/fuzz_targets'

The disadvantage of this approach is that if macro produces code, which fails to compile, all the tests will fail. Alternative is to create not just a crate 'test-lib', but a set of workspaces, which (1) can be compiled independently (2) shares a common dependencies cache.

totikom avatar Jul 22 '21 13:07 totikom