summaryrefslogtreecommitdiff
path: root/test/scorsh_testsuite
blob: 57954f75598b8be8e06f063cc1f0e2efacbf3429 (plain)
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
#!/bin/sh

####
##
## testsuite for SCORSH
##

if [ $# -lt 1 ]; then
    echo "Usage: $0 <spec_file>"
    exit 1
fi

. ./scorsh_functions

[ -f "$1" ] || ( echo "Unable to open file $1" && exit 2 )

. "$1"


trap cleanup 0 HUP INT TRAP TERM QUIT

## func
cleanup(){
    ## do stuff here
    rm -rf ${SCORSH_REPO}
    rm -rf ${SCORSH_APP}
    rm -rf ${REMOTE_REPO}
    rm -rf ${LOCAL_REPO}
    
    echo "Exiting..."
}

## func
run_tests(){

    for t in $TESTS; do
        export PASSED_TESTS FAILED_TESTS TOT_TESTS
        echo "\033[4;7;36m-+-+- running tests in $t -+-+-\033[0m"
        $t
        eval $(cat ${STATUS_FILE})
        echo "\033[35m-------------------------------------------------------------\033[0m"
        
    done
    export PASSED_TESTS FAILED_TESTS TOT_TESTS
}


## main

export SCORSH_URL SCORSH_REPO SCORSH_APP REMOTE_REPO LOCAL_REPO
PASSED_TESTS=0
FAILED_TESTS=0
TOT_TESTS=0

run_tests

report_results