Raymond Toy pushed to branch issue-363-add-version-number at cmucl / cmucl Commits: f9383d9c by Raymond Toy at 2025-01-08T15:15:56-08:00 Install unit tests and run-unit-tests.sh Install all of the unit-test files to share/cmucl/version/tests. Install run-unit-tests.sh to bin/run-unit-tests.sh To make this work, modify run-unit-tests to add a `-d` commandline arg that specifies the directory where the test files are located. If no `-d` flag is given, it defaults to how run-unit-tests.sh used to work, which expected the tests to in "./tests/". - - - - - 2 changed files: - bin/make-src-dist.sh - bin/run-unit-tests.sh Changes: ===================================== bin/make-src-dist.sh ===================================== @@ -58,6 +58,7 @@ echo Creating source distribution set -x GTAR_OPTIONS="--exclude=.git --exclude='*.pot.~*~'" install -d ${GROUP} ${OWNER} -m 0755 $DESTDIR/share/cmucl/$VERSION/ +install ${GROUP} ${OWNER} -m 0755 bin/run-unit-tests.sh $DESTDIR/bin ${GTAR} ${GTAR_OPTIONS} -cf - src tests | (cd $DESTDIR/share/cmucl/$VERSION; ${GTAR} xf -) if [ -z "$INSTALL_DIR" ]; then # echo " Compressing with $ZIP" ===================================== bin/run-unit-tests.sh ===================================== @@ -6,7 +6,8 @@ # then just those tests are run. usage() { - echo "run-tests.sh [?] [-l lisp] [tests]" + echo "run-tests.sh [?] [-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 " -? This help message" echo "" @@ -23,10 +24,11 @@ usage() { } LISP=lisp -while getopts "h?l:" arg +while getopts "h?l:d:" arg do case $arg in l) LISP=$OPTARG ;; + d) TESTDIR=$OPTARG ;; \?) usage ;; esac done @@ -50,11 +52,18 @@ trap cleanup EXIT # Compile up the C file that is used for testing alien funcalls to # functions that return integer types of different lengths. We use # gcc since clang isn't always available. -(cd tests; gcc -m32 -O3 -c test-return.c) +(cd $TESTDIR; gcc -m32 -O3 -c test-return.c) if [ $# -eq 0 ]; then + # Test directory arg for run-all-tests if a non-default + if [ -n ${TESTDIR} ]; then + TESTDIRARG=" :test-directory \"${TESTDIR}/\"" + else + TESTDIR="tests/" + TESTDIRARG="" + fi # No args so run all the tests - $LISP -nositeinit -noinit -load tests/run-tests.lisp -eval '(cmucl-test-runner:run-all-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="" @@ -63,6 +72,6 @@ else new=`echo $f | tr '[a-z]' '[A-Z]'` result="$result "\"$new-TESTS\" done - $LISP -nositeinit -noinit -load tests/run-tests.lisp -eval "(progn (cmucl-test-runner:load-test-files) (cmucl-test-runner:run-test $result))" + $LISP -nositeinit -noinit -load $TESTDIR/run-tests.lisp -eval "(progn (cmucl-test-runner:load-test-files) (cmucl-test-runner:run-test $result))" fi View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/f9383d9c016cc88b51fd6052... -- View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/f9383d9c016cc88b51fd6052... You're receiving this email because of your account on gitlab.common-lisp.net.
participants (1)
-
Raymond Toy (@rtoy)