1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
#!/bin/sh
# Copyright (C) Dmitry Volyntsev
# Copyright (C) NGINX, Inc.
verbose() {
if [ -n "$NJS_TEST_VERBOSE" ]; then
printf "$1"
fi
}
passed() {
verbose " PASSED\n"
njs_passed=$((njs_passed+1))
}
skip() {
verbose " SKIPPED\n"
njs_passed=$((njs_passed+1))
}
failed() {
njs_failed_list="$njs_failed_list $1"
verbose " FAILED\n"
printf "$1:\n"
cat $2
printf "\n"
}
verbose "Test dir: $NJS_TEST_DIR\n"
verbose "Log file: $NJS_TEST_LOG\n"
verbose "\n"
njs_passed=0
njs_total=0
njs_failed_list=""
NJS_TESTS=""
for arg in $NJS_TEST_PATHS; do
if [ -d $arg ]; then
NJS_TESTS="$NJS_TESTS $(find $arg -name '*\.t\.js' -o -name '*\.t\.mjs')"
else
NJS_TESTS="$NJS_TESTS $arg"
fi
done
NJS_TESTS=`printf "%s\n" $NJS_TESTS | sort`
|