[Git][cmucl/cmucl][issue-425-correctly-rounded-math-functions] 3 commits: If the unit tests fail, exit with a non-zero code
Raymond Toy pushed to branch issue-425-correctly-rounded-math-functions at cmucl / cmucl Commits: b68a8d74 by Raymond Toy at 2025-12-16T18:40:57-08:00 If the unit tests fail, exit with a non-zero code In `run-tests`, if the results are not empty, exit with a non-zero exit code to tell the caller something didn't pass. - - - - - b939b118 by Raymond Toy at 2025-12-16T18:44:35-08:00 Oops. Use :exitp in print-test-results to exit Revert last change and use the :exitp parameter to print-test-results to exit if there are failures. - - - - - e174f34d by Raymond Toy at 2025-12-16T18:48:08-08:00 Add -u and -p options and exit if lisp-unit tests fail Add -u and -p commandline options to skip the lisp-unit tests or the package-local-nickname tests, respectively. If the lisp-unit tests fail, we want to exit immediately instead of running the package-local-nicknames tests. Without this, it looks like everything is ok if the package-local-nickname tests pass. - - - - - 2 changed files: - bin/run-unit-tests.sh - tests/run-tests.lisp Changes: ===================================== bin/run-unit-tests.sh ===================================== @@ -9,6 +9,8 @@ usage() { echo "run-tests.sh [-?h] [-d test-dir] [-l lisp] [tests]" echo " -d test-dir Directory containing the unit test files" echo " -l lisp Lisp to use for the tests; defaults to lisp" + echo " -u Skip lisp-unit tests" + echo " -p Skip package-local-nicknames test" echo " -? This help message" echo " -h This help message" echo "" @@ -25,11 +27,13 @@ usage() { } LISP=lisp -while getopts "h?l:d:" arg +while getopts "uph?l:d:" arg do case $arg in l) LISP=$OPTARG ;; d) TESTDIR=$OPTARG ;; + u) SKIP_UNIT=yes ;; + p) SKIP_PLN=yes ;; h|\?) usage ;; esac done @@ -69,39 +73,49 @@ fi # gcc since clang isn't always available. (cd "$TESTDIR" || exit 1 ; gcc -m32 -O3 -c test-return.c) -if [ $# -eq 0 ]; then - # Test directory arg for run-all-tests if a non-default - # No args so run all the tests - $LISP -nositeinit -noinit -load "$TESTDIR"/run-tests.lisp -eval "(cmucl-test-runner:run-all-tests ${TESTDIRARG})" -else - # Run selected files. Convert each file name to uppercase and append "-TESTS" - result="" - for f in "$@" - do - new=$(echo "$f" | tr '[:lower:]' '[:upper:]') - result="$result "\"$new-TESTS\" - done - $LISP -nositeinit -noinit -load "$TESTDIR"/run-tests.lisp -eval "(progn (cmucl-test-runner:load-test-files) (cmucl-test-runner:run-test $result))" +if [ "$SKIP_UNIT" != "yes" ]; then + if [ $# -eq 0 ]; then + # Test directory arg for run-all-tests if a non-default + # No args so run all the tests + $LISP -nositeinit -noinit -load "$TESTDIR"/run-tests.lisp -eval "(cmucl-test-runner:run-all-tests ${TESTDIRARG})" || + exit 1 + else + # Run selected files. Convert each file name to uppercase and append "-TESTS" + result="" + for f in "$@" + do + new=$(echo "$f" | tr '[:lower:]' '[:upper:]') + result="$result "\"$new-TESTS\" + done + # Run unit tests. Exits with a non-zero code if there's a failure. + + $LISP -nositeinit -noinit -load "$TESTDIR"/run-tests.lisp -eval "(progn (cmucl-test-runner:load-test-files) (cmucl-test-runner:run-test $result))" || + exit 1 + fi fi ## Now run tests for trivial-package-local-nicknames -REPO=trivial-package-local-nicknames -BRANCH=cmucl-updates +echo SKIP_PLN = $SKIP_PLN -set -x -if [ -d ../$REPO ]; then - (cd ../$REPO || exit 1; git stash; git checkout $BRANCH; git pull --rebase) -else - (cd ..; git clone https://gitlab.common-lisp.net/cmucl/$REPO.git) -fi +if [ "$SKIP_PLN" != "yes" ]; then + REPO=trivial-package-local-nicknames + BRANCH=cmucl-updates + + set -x + if [ -d ../$REPO ]; then + (cd ../$REPO || exit 1; git stash; git checkout $BRANCH; git pull --rebase) + else + (cd ..; git clone https://gitlab.common-lisp.net/cmucl/$REPO.git) + fi -LISP=$PWD/$LISP -cd ../$REPO || exit 1 -git checkout $BRANCH + LISP=$PWD/$LISP + cd ../$REPO || exit 1 + git checkout $BRANCH -# Run the tests. Exits with a non-zero code if there's a failure. -$LISP -noinit -nositeinit -batch <<'EOF' + # Run the tests. Exits with a non-zero code if there's a failure. + $LISP -noinit -nositeinit -batch <<'EOF' (require :asdf) (push (default-directory) asdf:*central-registry*) (asdf:test-system :trivial-package-local-nicknames) EOF +fi ===================================== tests/run-tests.lisp ===================================== @@ -82,7 +82,7 @@ (dolist (test tests) (push (lisp-unit:run-tests :all test) test-results)) - (print-test-results (nreverse test-results) :verbose t))) + (print-test-results (nreverse test-results) :verbose t :exitp t))) ;; Print out a summary of test results produced from RUN-LOADED-TESTS. (defun print-test-results (results &key verbose exitp) View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/6b9262814ba76a22ec1e551... -- View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/6b9262814ba76a22ec1e551... You're receiving this email because of your account on gitlab.common-lisp.net.
participants (1)
-
Raymond Toy (@rtoy)