summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2014-11-11 15:15:02 +0100
committerJan Pokorný <jpokorny@redhat.com>2014-11-14 22:11:01 +0100
commit3660c68e3d2bda1112ea7e96497259e77874370c (patch)
treeeadfe6b61285af8a78720db0773244847686de6c
parentb0a101061272f80f8ad5b28f633a040bb47b84a8 (diff)
downloadclufter-3660c68e3d2bda1112ea7e96497259e77874370c.tar.gz
clufter-3660c68e3d2bda1112ea7e96497259e77874370c.tar.xz
clufter-3660c68e3d2bda1112ea7e96497259e77874370c.zip
run-tests: run (optionally allow skipping) run-check along again
Also make the final exit code distinguish failure of native tests vs. failure of accompanied run-check round. Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
-rwxr-xr-x__root__/run-check8
-rwxr-xr-x__root__/run-tests7
2 files changed, 12 insertions, 3 deletions
diff --git a/__root__/run-check b/__root__/run-check
index d3a9d9a..ac445fc 100755
--- a/__root__/run-check
+++ b/__root__/run-check
@@ -29,7 +29,7 @@ which ccs_flatten 2>/dev/null || (
ln -fs -- build/ccs_flatten .
) || { ret=$?; echo "ccs_flatten missing, cannot be built"; exit ${ret}; }
-if [ "${1}" != "__norun__" ]; then
+run_check() {
# self-check for sanity usage
testcib="$(mktemp)" testcoro="$(mktemp)"
{ ${PYTHONEXEC} run-dev ccs2pcs-needle "${@}" -- - "${testcib}" "${testcoro}" \
@@ -153,5 +153,7 @@ totem {
EOF
rm -f -- "${testcib}" "${testcoro}"
unset testcib testcoro
- f() { return $1; }; f ${ret}
-fi
+ return ${ret}
+}
+
+[ "${1}" == "__norun__" ] || run_check
diff --git a/__root__/run-tests b/__root__/run-tests
index 501f232..b228d62 100755
--- a/__root__/run-tests
+++ b/__root__/run-tests
@@ -33,6 +33,7 @@ fi
DEBUG="env LOGLEVEL=WARNING"
PGR=${PAGER:-less}
VERBOSE=1
+RUNCHECK=1
ACC=
while [ $# -gt 0 ]; do
case "$1" in
@@ -48,6 +49,9 @@ while [ $# -gt 0 ]; do
-d)
DEBUG=
;;
+ -n)
+ RUNCHECK=0
+ ;;
-q)
VERBOSE=0
;;
@@ -79,4 +83,7 @@ trap 'ret=1' USR1
cd "$(dirname "$0")"; cd __project__ 2>/dev/null || :
eval "{ ${DEBUG} ${CMD} ${ACC}; [ \$? -eq 0 ] || kill -USR1 \$\$; } ${TAIL}"
)
+
+[ "${RUNCHECK}" -eq 0 ] || run_check || let ret+=2
+
f() { return $1; }; f ${ret}