-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtest.sh
More file actions
107 lines (92 loc) · 3.4 KB
/
test.sh
File metadata and controls
107 lines (92 loc) · 3.4 KB
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#!/bin/bash
code=$1
platform=$2
out=$3
if [ $platform == "windows" ]; then
echo "[language] Ada"
echo "[input ] `cat $code`"
outact=$(./build/brainfuck-ada.exe $code)
echo "[output ] $outact"
echo -n "[passed ] "
if [ "$outact" == "$out" ]; then echo -e 'Yes\n'; else echo -e 'No\n'; fi;
echo "[language] Bash"
echo "[input ] `cat $code`"
outact=$(./brainfuck.bash $code)
echo "[output ] $outact"
echo -n "[passed ] "
if [ "$outact" == "$out" ]; then echo -e 'Yes\n'; else echo -e 'No\n'; fi;
echo "[language] C"
echo "[input ] `cat $code`"
outact=$(./build/brainfuck-c $code)
echo "[output ] $outact"
echo -n "[passed ] "
if [ "$outact" == "$out" ]; then echo -e 'Yes\n'; else echo -e 'No\n'; fi;
echo "[language] Common Lisp"
echo "[input ] `cat $code`"
outact=$(sbcl --script ./brainfuck.lisp $code)
echo "[output ] $outact"
echo -n "[passed ] "
if [ "$outact" == "$out" ]; then echo -e 'Yes\n'; else echo -e 'No\n'; fi;
echo "[language] D"
echo "[input ] `cat $code`"
outact=$(./build/brainfuck-d $code)
echo "[output ] $outact"
echo -n "[passed ] "
if [ "$outact" == "$out" ]; then echo -e 'Yes\n'; else echo -e 'No\n'; fi;
echo "[language] F#"
echo "[input ] `cat $code`"
outact=$(./build/brainfuck-fs $code)
echo "[output ] $outact"
echo -n "[passed ] "
if [ "$outact" == "$out" ]; then echo -e 'Yes\n'; else echo -e 'No\n'; fi;
echo "[language] Java"
echo "[input ] `cat $code`"
cd build/
outact=$(java brainfuck brainfuck.class ../$code)
echo "[output ] $outact"
echo -n "[passed ] "
if [ "$outact" == "$out" ]; then echo -e 'Yes\n'; else echo -e 'No\n'; fi;
cd ..
echo "[language] Lua"
echo "[input ] `cat $code`"
outact=$(lua.exe brainfuck.lua $code)
echo "[output ] $outact"
echo -n "[passed ] "
if [ "$outact" == "$out" ]; then echo -e 'Yes\n'; else echo -e 'No\n'; fi;
echo "[language] Odin"
echo "[input ] `cat $code`"
outact=$(./build/brainfuck-odin.exe $code)
echo "[output ] $outact"
echo -n "[passed ] "
if [ "$outact" == "$out" ]; then echo -e 'Yes\n'; else echo -e 'No\n'; fi;
echo "[language] Perl 6"
echo "[input ] `cat $code`"
outact=$(cmd.exe /c "perl6.bat brainfuck.pl6 $code")
echo "[output ] $outact"
echo -n "[passed ] "
if [ "$outact" == "$out" ]; then echo -e 'Yes\n'; else echo -e 'No\n'; fi;
echo "[language] Python 3"
echo "[input ] `cat $code`"
outact=$(python brainfuck.py $code)
echo "[output ] $outact"
echo -n "[passed ] "
if [ "$outact" == "$out" ]; then echo -e 'Yes\n'; else echo -e 'No\n'; fi;
echo "[language] Ruby"
echo "[input ] `cat $code`"
outact=$(ruby brainfuck.rb $code)
echo "[output ] $outact"
echo -n "[passed ] "
if [ "$outact" == "$out" ]; then echo -e 'Yes\n'; else echo -e 'No\n'; fi;
echo "[language] Racket"
echo "[input ] `cat $code`"
outact=$(racket -t brainfuck.rkt $code)
echo "[output ] $outact"
echo -n "[passed ] "
if [ "$outact" == "$out" ]; then echo -e 'Yes\n'; else echo -e 'No\n'; fi;
echo "[language] Rust"
echo "[input ] `cat $code`"
outact=$(./build/brainfuck-rs $code)
echo "[output ] $outact"
echo -n "[passed ] "
if [ "$outact" == "$out" ]; then echo -e 'Yes\n'; else echo -e 'No\n'; fi;
fi