diff options
author | Malfurious <m@lfurio.us> | 2021-08-23 07:35:24 -0400 |
---|---|---|
committer | Malfurious <m@lfurio.us> | 2021-08-23 07:35:24 -0400 |
commit | 0175c1c40f9567a401a986d85ab6d6f5365eec7a (patch) | |
tree | 6e631a29735ab0c5ca0f1650934da3a24eecff62 /test/shunit/shunit2_test_failures.sh | |
parent | 6c08d333a74aacd1fa9d14de9abab38ede4a8e88 (diff) | |
download | git-sonar-0175c1c40f9567a401a986d85ab6d6f5365eec7a.tar.gz git-sonar-0175c1c40f9567a401a986d85ab6d6f5365eec7a.zip |
Remove unit tests
I don't particularly wish to maintain these tests for a few reasons:
* Many of them make assertions strictly about rendered text / UI
* Many of them test external systems and touch the disk
* There are platform-dependent details that complicate several
tests.
So, the tests are removed. Ideally, the main script is reworked into
something simple enough it doesn't necessarily warrant heavy testing.
Signed-off-by: Malfurious <m@lfurio.us>
Diffstat (limited to 'test/shunit/shunit2_test_failures.sh')
-rwxr-xr-x | test/shunit/shunit2_test_failures.sh | 89 |
1 files changed, 0 insertions, 89 deletions
diff --git a/test/shunit/shunit2_test_failures.sh b/test/shunit/shunit2_test_failures.sh deleted file mode 100755 index 4aec943..0000000 --- a/test/shunit/shunit2_test_failures.sh +++ /dev/null @@ -1,89 +0,0 @@ -#! /bin/sh -# $Id: shunit2_test_failures.sh 286 2008-11-24 21:42:34Z kate.ward@forestent.com $ -# vim:et:ft=sh:sts=2:sw=2 -# -# Copyright 2008 Kate Ward. All Rights Reserved. -# Released under the LGPL (GNU Lesser General Public License) -# -# Author: kate.ward@forestent.com (Kate Ward) -# -# shUnit2 unit test for failure functions - -# load common unit-test functions -. ./shunit2_test_helpers - -#----------------------------------------------------------------------------- -# suite tests -# - -testFail() -{ - ( fail >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithOutput 'fail' $? "${stdoutF}" "${stderrF}" - - ( fail "${MSG}" >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithOutput 'fail with msg' $? "${stdoutF}" "${stderrF}" - - ( fail arg1 >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithOutput 'too many arguments' $? "${stdoutF}" "${stderrF}" -} - -testFailNotEquals() -{ - ( failNotEquals 'x' 'x' >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithOutput 'same' $? "${stdoutF}" "${stderrF}" - - ( failNotEquals "${MSG}" 'x' 'x' >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithOutput 'same with msg' $? "${stdoutF}" "${stderrF}" - - ( failNotEquals 'x' 'y' >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithOutput 'not same' $? "${stdoutF}" "${stderrF}" - - ( failNotEquals '' '' >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithOutput 'null values' $? "${stdoutF}" "${stderrF}" - - ( failNotEquals >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithError 'too few arguments' $? "${stdoutF}" "${stderrF}" - - ( failNotEquals arg1 arg2 arg3 arg4 >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithError 'too many arguments' $? "${stdoutF}" "${stderrF}" -} - -testFailSame() -{ - ( failSame 'x' 'x' >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithOutput 'same' $? "${stdoutF}" "${stderrF}" - - ( failSame "${MSG}" 'x' 'x' >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithOutput 'same with msg' $? "${stdoutF}" "${stderrF}" - - ( failSame 'x' 'y' >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithOutput 'not same' $? "${stdoutF}" "${stderrF}" - - ( failSame '' '' >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithOutput 'null values' $? "${stdoutF}" "${stderrF}" - - ( failSame >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithError 'too few arguments' $? "${stdoutF}" "${stderrF}" - - ( failSame arg1 arg2 arg3 arg4 >"${stdoutF}" 2>"${stderrF}" ) - th_assertFalseWithError 'too many arguments' $? "${stdoutF}" "${stderrF}" -} - -#----------------------------------------------------------------------------- -# suite functions -# - -oneTimeSetUp() -{ - tmpDir="${__shunit_tmpDir}/output" - mkdir "${tmpDir}" - stdoutF="${tmpDir}/stdout" - stderrF="${tmpDir}/stderr" - - MSG='This is a test message' -} - -# load and run shUnit2 -[ -n "${ZSH_VERSION:-}" ] && SHUNIT_PARENT=$0 -. ${TH_SHUNIT} |