File: runsuite.sh

package info (click to toggle)
kjs 5.103.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,020 kB
  • sloc: cpp: 36,704; javascript: 5,079; yacc: 790; perl: 191; sh: 52; makefile: 7
file content (39 lines) | stat: -rwxr-xr-x 760 bytes parent folder | download | duplicates (2)
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
#! /bin/bash

TOOL=~/obj/kdelibs/kjs/testkjs
DIR=.

if [ $# == 1 ]; then
    TOOL=$1
fi

echo "Starting to run tests"

# test tool available ?
if [ ! -x $TOOL ]; then
    echo "Can't execute test tool $TOOL"
    exit 1
fi

# can the shell test functions be parsed ?
$TOOL $DIR/shell.js >/dev/null 2>&1
if [ $? != 0 ]; then
    echo "Can't evaluate shell test functions in $DIR/shell.js"
    exit 2
fi

tests=`ls $DIR/*.js`
for t in $tests; do
    if [ `echo $t | grep -- '-n.js$'` ]; then
        $TOOL $t >/dev/null 2>&1
        if [ $? != 0 ]; then
            echo "PASS Expected failure in $t"
        else
            echo "FAIL Unexpected pass in $t"
        fi
    else
        echo "Executing $t"
        $TOOL $DIR/shell.js $t
    fi
done
echo "Done"