From 92bf7da15a1616e03092e478d4ae1ecc6e8d3f9e Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 18 May 2018 14:35:31 +1000 Subject: [PATCH] tests: Add main test file --- .travis.yml | 2 +- tests/test.sh | 7 +++++++ tests/test_misc.sh | 8 -------- tests/test_util.sh | 0 4 files changed, 8 insertions(+), 9 deletions(-) create mode 100755 tests/test.sh mode change 100644 => 100755 tests/test_util.sh diff --git a/.travis.yml b/.travis.yml index 6d9587e8..03e24fb0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,4 +20,4 @@ script: # Check for lines longer than 100 chars. # There are 3 lines that must be longer than 100 chars. - if (("$(grep '.\{101\}' neofetch | wc -l)" > 3)); then (exit 1); else (exit 0); fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cd tests; ./test_misc.sh; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cd tests && ./test.sh; fi diff --git a/tests/test.sh b/tests/test.sh new file mode 100755 index 00000000..07b71e99 --- /dev/null +++ b/tests/test.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +# +# Run all tests. + +./test_misc.sh + +[[ -f /tmp/err ]] || exit 0 && { rm /tmp/err; exit 1; } diff --git a/tests/test_misc.sh b/tests/test_misc.sh index 6f1dd405..65f626a2 100755 --- a/tests/test_misc.sh +++ b/tests/test_misc.sh @@ -25,16 +25,8 @@ test_get_ppid() { assert_equals "$result" "0" } -test_get_process_name() { - result="$(get_process_name "1")" - assert_equals "$result" "systemd" -} - printf "%s\\n" "Test MISC functions." test_convert_time test_get_ppid -test_get_process_name - -[[ -f /tmp/err ]] || exit 0 && { rm /tmp/err; exit 1; } diff --git a/tests/test_util.sh b/tests/test_util.sh old mode 100644 new mode 100755