#!/usr/bin/env bash function usage() { cat <all
' > coverage/index.html if [ "$UNIT" = yes ] ; then # Run the unit tests, with coverage. ./maint/with_coverage -o coverage/unit cargo test --all-features mv coverage_meta coverage_meta_unit echo 'unit
' >> coverage/index.html fi if [ "$INTEGRATION" = yes ] ; then # Run the integration tests, with coverage. # # (This is just a basic test that uses curl over Arti over a # chutney network. It's taken from the gitlab-ci tests.) # TODO: we might want, at some point, to have a the following stuff # go into a basic extensible integration-testing script that gets # run both from here and from the .gitlab-ci.yml file. trap ./tests/chutney/teardown 0 ./maint/with_coverage -o coverage/integration -s ./tests/chutney/setup proxy curl http://example.com -vs --socks5-hostname 127.0.0.1:9150 -o /dev/null trap - 0 ./tests/chutney/teardown # Report is generated after teardown because chutney/setup returns before any # test was done, so the report would be generated based on incomplete data. ./maint/with_coverage -o coverage/integration -c true mv coverage_meta coverage_meta_integration echo 'integration
' >> coverage/index.html fi # Generate merged coverage report. mkdir coverage_meta cat coverage_meta_*/commands > coverage_meta/commands mv coverage_meta_* coverage_meta ./maint/with_coverage -o coverage/all -c true