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 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
#!/bin/sh
# Copyright (C) Dmitry Volyntsev
# Copyright (C) NGINX, Inc.
NJS_TEST_DIR=`mktemp -d /tmp/njs_test.XXX`
NJS_TEST_LOG_DEFAULT="$NJS_TEST_DIR/log.log"
NJS_TEST_VERBOSE=${NJS_TEST_VERBOSE:-}
NJS_TEST_BINARY=${NJS_TEST_BINARY:-build/njs}
NJS_TEST_LOG=${NJS_TEST_LOG:-${NJS_TEST_LOG_DEFAULT}}
for njs_option
do
case "$njs_option" in
-*=*) value=`echo "$njs_option" | sed -e 's/[-_a-zA-Z0-9]*=//'` ;;
*) value="" ;;
esac
case "$njs_option" in
--binary=*)
NJS_TEST_BINARY="$value"
shift
;;
--log=*)
NJS_TEST_LOG="$value"
shift
;;
--test-dir=*)
NJS_TEST_DIR="$value"
shift
;;
--verbose=*)
NJS_TEST_VERBOSE="$value"
shift
;;
--help)
. test/help
exit 0
;;
--*)
echo
echo $0: error: invalid option \"$njs_option\".
echo Run \"$0 --help\" to see available options.
echo
exit 1
;;
*)
break
;;
esac
done
NJS_TEST_PATHS=${@:-test}
NJS_TEST_EXIT_CODE=1
if echo $NJS_TEST_BINARY | grep -q njs; then
NJS_TEST_EXIT_CODE=23
fi
|