projects
/
project
/
uci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tests: add test cases for showing nonexistent section and option.
[project/uci.git]
/
test
/
tests.sh
diff --git
a/test/tests.sh
b/test/tests.sh
index
ae064f1
..
ee72c31
100644
(file)
--- a/
test/tests.sh
+++ b/
test/tests.sh
@@
-6,12
+6,13
@@
CHANGES_DIR="/tmp/.uci"
TMP_DIR=${TESTS_DIR}"/tmp"
FULL_SUITE=${TESTS_DIR}"/full_suite.sh"
TMP_DIR=${TESTS_DIR}"/tmp"
FULL_SUITE=${TESTS_DIR}"/full_suite.sh"
-UCI_
STATIC="../uci-static
"
-[ -x $UCI_
STATIC
] || {
- echo "uci
-static is not present."
+UCI_
BIN="../uci
"
+[ -x $UCI_
BIN
] || {
+ echo "uci
is not present." >&2
return 1
}
return 1
}
-UCI="${UCI_STATIC} -c ${CONFIG_DIR} -p ${CHANGES_DIR}"
+UCI="${UCI_BIN} -c ${CONFIG_DIR} -p ${CHANGES_DIR}"
+UCI_Q="${UCI_BIN} -c ${CONFIG_DIR} -p ${CHANGES_DIR} -q"
REF_DIR="./references"
SCRIPTS_DIR="./tests.d"
REF_DIR="./references"
SCRIPTS_DIR="./tests.d"
@@
-40,10
+41,21
@@
assertSameFile() {
echo "----"
}
}
echo "----"
}
}
+assertNotSegFault()
+{
+ [ $1 -eq 139 ] && fail "Returned with 139: segmentation fault (SIGSEGV)!!!"
+}
+assertNotIllegal()
+{
+ [ $1 -eq 132 ] && fail "Returned with 132: Illegal instruction (SIGILL)!!!"
+}
assertFailWithNoReturn() {
local test="$1"
value=$( $test )
assertFailWithNoReturn() {
local test="$1"
value=$( $test )
- assertFalse "'$test' does not fail" $?
+ rv=$?
+ assertFalse "'$test' does not fail" $rv
+ assertNotSegFault $rv
+ assertNotIllegal $rv
assertNull "'$test' returns '$value'" "$value"
}
EOF
assertNull "'$test' returns '$value'" "$value"
}
EOF
@@
-60,6
+72,7
@@
CONFIG_DIR="${CONFIG_DIR}" \
CHANGES_DIR="${CHANGES_DIR}" \
TMP_DIR="${TMP_DIR}" \
UCI="${UCI}" \
CHANGES_DIR="${CHANGES_DIR}" \
TMP_DIR="${TMP_DIR}" \
UCI="${UCI}" \
+UCI_Q="${UCI_Q}" \
/bin/sh ${FULL_SUITE}
rm -rf ${TESTS_DIR}
/bin/sh ${FULL_SUITE}
rm -rf ${TESTS_DIR}