DEADSOFTWARE

813e6e59970c97932769cd4d01c9cdeb3c4b46d4
[dsw-obn.git] / obn-run-tests.sh
1 #!/bin/sh
3 set -e
5 TEST_DIR=tests
7 # Тест: компиляция и исполнение
8 maketest()
9 {
10 local OK=1
11 local LOG=""
12 if ! LOG="$(./obn-compile.sh -I $TEST_DIR $1)"; then
13 OK=0;
14 echo "=============================="
15 echo "Test fail: $1 compile-time $?:"
16 echo "$LOG"
17 echo "=============================="
18 echo
19 fi
20 if [ $OK = 1 ]; then
21 if ! ./obn-run.sh $1; then
22 OK=0
23 fi
24 fi
25 if [ $OK = 1 ]; then
26 echo "Test ok: $1"
27 fi
28 }
30 # Тест: только компиляция
31 makecomp()
32 {
33 local LOG=""
34 if ! LOG="$(./obn-compile.sh -I $TEST_DIR $1)"; then
35 echo "=============================="
36 echo "Test fail: $1 compile-time $?:"
37 echo "$LOG"
38 echo "=============================="
39 echo
40 else
41 echo "Test ok: $1"
42 fi
44 }
46 # Тест: Компиляция не должна проходить
47 makefail()
48 {
49 local LOG=""
50 if ! LOG="$(./obn-compile.sh -I $TEST_DIR $1)"; then
51 echo "Test ok: $1"
52 else
53 echo "=============================="
54 echo "Test fail: $1 compile-time $?:"
55 echo "$LOG"
56 echo "=============================="
57 echo
58 fi
59 }
61 ./make.sh jvm
63 maketest Test1
64 maketest Test2
65 maketest Test3
66 maketest Test4
67 maketest Test5
68 maketest Test6
69 maketest Test7
70 maketest Test8
71 maketest Test9
72 maketest Test10
73 maketest Test11
74 maketest Test12
75 maketest Test13
76 maketest Test14
77 maketest Test15
78 maketest Test16
80 makefail Test17A
81 makefail Test17B
82 makecomp Test17C
83 makecomp Test17D
84 makefail Test17E
85 makefail Test17F
87 makecomp Test18A
88 makefail Test18B
89 makefail Test18C
91 maketest Test19
92 maketest Test20
93 maketest Test21
94 maketest Test22
96 makecomp Test23A
97 makefail Test23B
99 maketest Test24