This replaces the hack that was test.sh with a more extensible and less hackish
test script.
To run the tests just run "./test" . By default it shows all RPCs called via
the "--tracerpc" flag. If you want to set custom test flags you can do
TEST_FLAGS="--elite-test-flag --foo" ./test
Currently we are only running lockzins.py and shieldcoinbase_donation.py tests
which are hardcoded. The plan is to allow custom sets of tests to be run with
this script.
Long ago our code actually used gmp directly but that is no longer the case.
Our dependency secp256k1 has an optional dependency on gmp but the way we
configure and compile secp256k1 does not use it. So there is no reason
to download and compile gmp in our build system. This means we no longer
need to maintain three different forks of GMP (one for Darwin, one for Win and
one for Linux that supports gcc15). This also makes downloading and compiling
Hush faster. Joy to the world.
The build system supports using CC to control the C compiler
and CXX to control the c++ compiler used but src/cc was hardcoded
to use the binary "gcc". Now it respects the custom value of
$CC environment variable if it exists.
These tests sometimes fail because sometimes a different amount is shielded (3 vs 3+fee)
which makes the expected amounts of sendAmount and donationAmount incorrect. The code
to calculate donations seems to work correctly but the tests need a bit more improvement.
When the tests pass:
DEBUG:RPC:<-43- {"remainingUTXOs": 1, "remainingValue": "3.00010000", "shieldingUTXOs": 1, "shieldingValue": "3.00000000", "donation": 5, "opid": "opid-868c81ad-885b-42b4-af85-dafa54e695a2"}
When they fail:
DEBUG:RPC:<-43- {"remainingUTXOs": 1, "remainingValue": "3.00000000", "shieldingUTXOs": 1, "shieldingValue": "3.00010000", "donation": 5, "opid": "opid-143309b6-e25a-45d6-9c0c-311f1f61de78"}