diff options
author | Heikki Kallasjoki <fis@zem.fi> | 2018-12-07 00:17:09 +0000 |
---|---|---|
committer | Heikki Kallasjoki <fis+github@zem.fi> | 2018-12-12 19:10:51 +0000 |
commit | 8569c2c85bec19daa36e013448399c42cf75a257 (patch) | |
tree | 7444488e4e5ae5c98f575a2eafd522c6427ffbdf /test/run_tests.sh | |
parent | d03dea4d7dbfb62ed0c3c21cdd9ad350f0526432 (diff) | |
download | nano-exporter-8569c2c85bec19daa36e013448399c42cf75a257.tar.gz nano-exporter-8569c2c85bec19daa36e013448399c42cf75a257.tar.xz nano-exporter-8569c2c85bec19daa36e013448399c42cf75a257.zip |
Add a simple test harness and tests for the cpu collector.
Diffstat (limited to 'test/run_tests.sh')
-rwxr-xr-x | test/run_tests.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/run_tests.sh b/test/run_tests.sh new file mode 100755 index 0000000..12a0e1a --- /dev/null +++ b/test/run_tests.sh @@ -0,0 +1,21 @@ +#! /bin/bash + +failed=0 + +for suite in "$@"; do + echo "$suite:" + if ./$suite; then + echo "...pass" + else + echo "...FAIL" + failed=1 + fi +done + +if (($failed)); then + printf "\x1b[31;1mTESTS FAILED\x1b[0m\n" + exit 1 +fi + +printf "\x1b[32;1mall tests passed\x1b[0m\n" +exit 0 |