Current behavior:
- Filter files, only runs on modified .cpp and .h files.
Files from secp256k1, univalue and leveldb are excluded.
- Autodetect the build directory location and the `test_bitcoin` bin.
The rule is as follow: if `$PWD/src/test/test_bitcoin exists`, use it;
otherwise search for the most recent `/src/test/test_bitcoin` binary in
any subfolder of the project root.
- Check that the modified files have been built.
This is achieved by comparing the last modification date of each file
against the last modification date of the `test_bitcoin` binary.
- Find if there is an associated unit test.
If the file itself is a test (ends with `_test.cpp` and is located in a
test folder), then run it. Otherwise check if a test filename can be
built by appending `_tests.cpp` to the file name.
This is a naive method which deserves improvements.
- Run each unit test using a call to `test_bitcoin --run_test=<test>`.
If the call is `arc unit --everything`, just call `test_bitcoin` without
any argument to run all the tests.
- Parse the output.
The output renders the result by grouping failures within each test file
(if `--everything is called`, only failed test will be display or a
single `Pass All unit tests`).
This diff is a WIP and open to discussion on the behaviour and
expectations of the `arc unit` tool. Any feedback is apreciated.