-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathtests.html
90 lines (78 loc) · 2.04 KB
/
tests.html
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<meta charset="utf-8">
<title>TPG tests</title>
<button onclick="runalltests()">run all tests</button>
<script>
alltests = {};
testnames = [];
function showtests(filename) {
document.write('<h3>'+filename+'</h3>');
for (var name in tests) {
if (Array.prototype[name]) continue;
testnames.push(name);
alltests[name] = tests[name];
document.write('<button onclick="run(\''+name+'\')">'+name+'</button><span id="r'+name+'"></span><br>');
}
}
var outspan = null;
function run(testname) {
console.log(testname);
outspan = document.getElementById('r'+testname);
alltests[testname]();
}
var curIndex = 0;
function runalltests() {
var name = testnames[curIndex];
console.log('-------------'+curIndex);
run(name);
if (curIndex < testnames.length-1) {
curIndex++;
setTimeout('runalltests()', 200);
}
}
function assertEqual(x,y) {
if (x==y) print('.');
else print(' <b>fail: '+x+' should be '+y+'<b> ');
}
function assert(x) {
if (x) print('.');
else print(' <b>fail</b> ');
}
function print(s) {
outspan.innerHTML += s;
}
function log(s) {
return;
//console.log(s);
}
</script>
<script src="array.debug.js"></script>
<script src="formula.debug.js"></script>
<script src="parser.debug.js"></script>
<script src="test_formula.debug.js"></script>
<script>
showtests('test_formula.js');
</script>
<script src="test_parser.debug.js"></script>
<script>
showtests('test_parser.js');
</script>
<script src="modelfinder.debug.js"></script>
<script src="test_modelfinder.debug.js"></script>
<script>
showtests('test_modelfinder.js');
</script>
<script src="prover.debug.js"></script>
<script src="test_prover.debug.js"></script>
<script>
showtests('test_prover.js');
</script>
<script src="equality.debug.js"></script>
<script src="test_equality.debug.js"></script>
<script>
showtests('test_equality.js');
</script>
<script src="sentree.debug.js"></script>
<script src="test_sentree.debug.js"></script>
<script>
showtests('test_sentree.js');
</script>