-
Notifications
You must be signed in to change notification settings - Fork 20
/
comparison-test.sh
executable file
·52 lines (38 loc) · 1.17 KB
/
comparison-test.sh
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
#!/bin/bash
# test tokenizer
make
mkdir -p /tmp/minigo2 /tmp/minigo
# Compare toknizer output
for f in *.go
do
echo -n " tokenizing $f ... "
./minigo --tokenize-only -d -t $f 2> /tmp/${f}.1.token
./minigo2 --tokenize-only -d -t $f 2> /tmp/${f}.2.token
# disabble for now
#diff -u /tmp/${f}.1.token /tmp/${f}.2.token || exit 1
echo "ok"
done
echo "tokinzer ok"
# Compare AST output
for f in *.go
do
echo -n " parsing $f ... "
./minigo --parse-only -d -a $f 2> /tmp/${f}.1.ast
./minigo2 --parse-only -d -a $f 2> /tmp/${f}.2.ast
diff -u /tmp/${f}.1.ast /tmp/${f}.2.ast || exit 1
echo "ok"
done
echo -n "parsing *.go ... "
./minigo --parse-only -d -a *.go 2> /tmp/all.1.ast
./minigo2 --parse-only -d -a *.go 2> /tmp/all.2.ast
diff -u /tmp/all.1.ast /tmp/all.2.ast || exit 1
echo "ok"
echo "parser ok"
./minigo2 --resolve-only -d *.go 2> /tmp/all.2.resolved
echo "resolve-only ok"
echo -n "resolving *.go ... "
./minigo --resolve-only -d -a *.go 2> /tmp/all.1.resolved
./minigo2 --resolve-only -d -a *.go 2> /tmp/all.2.resolved
diff -u /tmp/all.1.resolved /tmp/all.2.resolved || exit 1
echo "resolver ok"
echo "All comparison ok"