File: test262

package info (click to toggle)
libnginx-mod-js 0.8.9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,808 kB
  • sloc: ansic: 114,096; perl: 8,447; javascript: 2,520; exp: 487; sh: 322; xml: 312; python: 181; makefile: 18
file content (76 lines) | stat: -rwxr-xr-x 1,601 bytes parent folder | download
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
67
68
69
70
71
72
73
74
75
76
#!/bin/sh

# Copyright (C) Dmitry Volyntsev
# Copyright (C) NGINX, Inc.

set -e

. test/options
. test/setup

export NJS_TEST_DIR

for njs_test in $NJS_TESTS; do
    . test/prepare

    njs_log="$NJS_TEST_DIR/${njs_test%.*}.log"

    verbose "$njs_test $njs_log"
    cat << END >> $NJS_TEST_LOG
----------------------------------------
running $njs_test $njs_log
END

    if [ "$NJS_SKIP_LIST" != "${NJS_SKIP_LIST#*$njs_test*}" ]; then
        skip $njs_test
        continue
    fi

    status=0

    NJS_PATH=$njs_paths \
    NJS_EXIT_CODE=$NJS_TEST_EXIT_CODE \
    $NJS_TEST_BINARY $NJS_TEST_DIR/$njs_test > $njs_log 2>&1 || status=$?

    cat $njs_log >> $NJS_TEST_LOG
    njs_out=`cat $njs_log`

    if [ "$status" -eq 0 ]; then
        if [ -n "$njs_negative" ]; then
            failed $njs_test $njs_log

        elif [ $njs_async = yes ]; then
            if [ "$njs_out" != 'Test262:AsyncTestComplete' ]; then
                failed $njs_test $njs_log

            else
                passed $njs_test
            fi

        else
            if [ -n "$njs_out" ]; then
                failed $njs_test $njs_log

            else
                passed $njs_test
            fi
        fi

    else
        if [ -n "$njs_negative" ]; then
            if [ "$status" = "$NJS_TEST_EXIT_CODE" ]; then
                passed $njs_test
            else
                echo "negative test exited with unexpected exit code:$status"
                failed $njs_test $njs_log
            fi

        else
            failed $njs_test $njs_log
        fi
    fi

done

. test/finalize
. test/report