Raymond Toy pushed to branch master at cmucl / cmucl

Commits:

3 changed files:

Changes:

  • bin/run-unit-tests.sh
    ... ... @@ -9,6 +9,8 @@ usage() {
    9 9
         echo "run-tests.sh [-?h] [-d test-dir] [-l lisp] [tests]"
    
    10 10
         echo "    -d test-dir  Directory containing the unit test files"
    
    11 11
         echo "    -l lisp      Lisp to use for the tests; defaults to lisp"
    
    12
    +    echo "    -p           Skip package-local-nicknames test"
    
    13
    +    echo "    -u           Skip lisp-unit tests"
    
    12 14
         echo "    -?           This help message"
    
    13 15
         echo "    -h           This help message"
    
    14 16
         echo ""
    
    ... ... @@ -25,11 +27,13 @@ usage() {
    25 27
     }
    
    26 28
     
    
    27 29
     LISP=lisp
    
    28
    -while getopts "h?l:d:" arg
    
    30
    +while getopts "puh?l:d:" arg
    
    29 31
     do
    
    30 32
         case $arg in
    
    31 33
           l) LISP=$OPTARG ;;
    
    32 34
           d) TESTDIR=$OPTARG ;;
    
    35
    +      p) SKIP_PLN=yes ;;
    
    36
    +      u) SKIP_UNIT=yes ;;
    
    33 37
           h|\?) usage ;;
    
    34 38
         esac
    
    35 39
     done
    
    ... ... @@ -43,12 +47,19 @@ mkdir test-tmp
    43 47
     ln -s /bin/ls test-tmp/ls-link
    
    44 48
     
    
    45 49
     # Set the timestamps on 64-bit-timestamp-2038.txt and
    
    46
    -# 64-bit-timestamp-2106.txt.  The time for the first file is a
    
    47
    -# negative value for a 32-bit time_t.  The second file won't fit in a
    
    48
    -# 32-bit time_t value.  It's ok if this doesn't work in general, as
    
    49
    -# long as it works on Linux for the stat test in tests/os.lisp.
    
    50
    -touch -d "1 April 2038" tests/resources/64-bit-timestamp-2038.txt
    
    51
    -touch -d "1 April 2106" tests/resources/64-bit-timestamp-2106.txt
    
    50
    +# 64-bit-timestamp-2106.txt, but only for OSes where we know this
    
    51
    +# works.  (This is so we don't an annoying error message from touch
    
    52
    +# that doesn't accept the -d option, like MacOS 10.13.)  The time for
    
    53
    +# the first file is a negative value for a 32-bit time_t.  The second
    
    54
    +# file won't fit in a 32-bit time_t value.  It's ok if this doesn't
    
    55
    +# work in general, as long as it works on Linux for the stat test in
    
    56
    +# tests/os.lisp.
    
    57
    +case `uname -s` in
    
    58
    +    Linux)
    
    59
    +	touch -d "1 April 2038" tests/resources/64-bit-timestamp-2038.txt
    
    60
    +	touch -d "1 April 2106" tests/resources/64-bit-timestamp-2106.txt
    
    61
    +	;;
    
    62
    +esac
    
    52 63
     
    
    53 64
     # Cleanup temp files and directories that we created during testing.
    
    54 65
     function cleanup {
    
    ... ... @@ -69,39 +80,47 @@ fi
    69 80
     # gcc since clang isn't always available.
    
    70 81
     (cd "$TESTDIR" || exit 1 ; gcc -m32 -O3 -c test-return.c)
    
    71 82
     
    
    72
    -if [ $# -eq 0 ]; then
    
    73
    -    # Test directory arg for run-all-tests if a non-default 
    
    74
    -    # No args so run all the tests
    
    75
    -    $LISP -nositeinit -noinit -load "$TESTDIR"/run-tests.lisp -eval "(cmucl-test-runner:run-all-tests ${TESTDIRARG})"
    
    76
    -else
    
    77
    -    # Run selected files.  Convert each file name to uppercase and append "-TESTS"
    
    78
    -    result=""
    
    79
    -    for f in "$@"
    
    80
    -    do
    
    81
    -	new=$(echo "$f" | tr '[:lower:]' '[:upper:]')
    
    82
    -        result="$result "\"$new-TESTS\"
    
    83
    -    done
    
    84
    -    $LISP -nositeinit -noinit -load "$TESTDIR"/run-tests.lisp -eval "(progn (cmucl-test-runner:load-test-files) (cmucl-test-runner:run-test $result))"
    
    83
    +if [ "$SKIP_UNIT" != "yes" ]; then
    
    84
    +    if [ $# -eq 0 ]; then
    
    85
    +	# Test directory arg for run-all-tests if a non-default 
    
    86
    +	# No args so run all the tests
    
    87
    +	$LISP -nositeinit -noinit -load "$TESTDIR"/run-tests.lisp -eval "(cmucl-test-runner:run-all-tests ${TESTDIRARG})" ||
    
    88
    +	    exit 1
    
    89
    +    else
    
    90
    +	# Run selected files.  Convert each file name to uppercase and append "-TESTS"
    
    91
    +	result=""
    
    92
    +	for f in "$@"
    
    93
    +	do
    
    94
    +	    new=$(echo "$f" | tr '[:lower:]' '[:upper:]')
    
    95
    +            result="$result "\"$new-TESTS\"
    
    96
    +	done
    
    97
    +	# Run unit tests.  Exits with a non-zero code if there's a failure.
    
    98
    +
    
    99
    +	$LISP -nositeinit -noinit -load "$TESTDIR"/run-tests.lisp -eval "(progn (cmucl-test-runner:load-test-files) (cmucl-test-runner:run-test $result))" ||
    
    100
    +	    exit 1
    
    101
    +    fi
    
    85 102
     fi
    
    86 103
     
    
    87 104
     ## Now run tests for trivial-package-local-nicknames
    
    88
    -REPO=trivial-package-local-nicknames
    
    89
    -BRANCH=cmucl-updates
    
    105
    +if [ "$SKIP_PLN" != "yes" ]; then
    
    106
    +    REPO=trivial-package-local-nicknames
    
    107
    +    BRANCH=cmucl-updates
    
    90 108
     
    
    91
    -set -x
    
    92
    -if [ -d ../$REPO ]; then
    
    93
    -    (cd ../$REPO || exit 1; git stash; git checkout $BRANCH; git pull --rebase)
    
    94
    -else
    
    95
    -    (cd ..; git clone https://gitlab.common-lisp.net/cmucl/$REPO.git)
    
    96
    -fi
    
    109
    +    set -x
    
    110
    +    if [ -d ../$REPO ]; then
    
    111
    +	(cd ../$REPO || exit 1; git stash; git checkout $BRANCH; git pull --rebase)
    
    112
    +    else
    
    113
    +	(cd ..; git clone https://gitlab.common-lisp.net/cmucl/$REPO.git)
    
    114
    +    fi
    
    97 115
     
    
    98
    -LISP=$PWD/$LISP
    
    99
    -cd ../$REPO || exit 1
    
    100
    -git checkout $BRANCH
    
    116
    +    LISP=$PWD/$LISP
    
    117
    +    cd ../$REPO || exit 1
    
    118
    +    git checkout $BRANCH
    
    101 119
     
    
    102
    -# Run the tests.  Exits with a non-zero code if there's a failure.
    
    103
    -$LISP -noinit -nositeinit -batch <<'EOF'
    
    120
    +    # Run the tests.  Exits with a non-zero code if there's a failure.
    
    121
    +    $LISP -noinit -nositeinit -batch <<'EOF'
    
    104 122
     (require :asdf)
    
    105 123
     (push (default-directory) asdf:*central-registry*)
    
    106 124
     (asdf:test-system :trivial-package-local-nicknames)
    
    107 125
     EOF
    
    126
    +fi

  • tests/float-x86.lisp
    ... ... @@ -5,6 +5,11 @@
    5 5
     
    
    6 6
     (in-package "FLOAT-X86-TESTS")
    
    7 7
     
    
    8
    +;; This tests the floating-point modes for x86.  This works only if we
    
    9
    +;; have the feature :sse2 but not :darwin since darwin has always used
    
    10
    +;; sse2 and not x87.  But see also how FLOATING-POINT-MODES is
    
    11
    +;; implemented in src/code/float-trap.lisp.
    
    12
    +#+(and sse2 (not darwin))
    
    8 13
     (define-test set-floating-point-modes
    
    9 14
       (let ((old-x87-modes (x86::x87-floating-point-modes))
    
    10 15
     	(old-sse2-modes (x86::sse2-floating-point-modes))
    

  • tests/os.lisp
    ... ... @@ -51,6 +51,7 @@
    51 51
           (assert-equal 2153718000 st-atime)
    
    52 52
           (assert-equal 2153718000 st-mtime))))
    
    53 53
     
    
    54
    +#+linux
    
    54 55
     (define-test stat.64-bit-timestamp-2106
    
    55 56
         (:tag :issues)
    
    56 57
       (let ((test-file #.(merge-pathnames "resources/64-bit-timestamp-2106.txt"