summaryrefslogtreecommitdiff
path: root/test/rlparse.d/gentests
blob: c5b45dd2edc2c605efd3a2963bef4079ae9d3cb0 (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
#!/bin/bash

. ../subject.sh

[ -d working ] || mkdir working

for fn in case/*.rl; do

	FA="--reduce-frontend --colm-frontend"
	for frontend in $FA; do

		exp=${fn%.rl}$frontend.exp
		exp=${exp#case/}

		out=${fn%.rl}$frontend.out
		out=../working/${out#case/}

		diff=${fn%.rl}$frontend.diff
		diff=../working/${diff#case/}

		sh=${fn%.rl}$frontend.sh
		sh=working/${sh#case/}

#		lang=`echo $fn | awk -vFS=- '{ print $2 }'`
#	
#		case $lang in
#			A) lang=csharp;;
#			C) lang=c;;
#			J) lang=java;;
#			K) lang=crack;;
#			O) lang=ocaml;;
#			R) lang=ruby;;
#			U) lang=rust;;
#			Y) lang=julia;;
#			Z) lang=go;;
#		esac

		rm -f $sh

		echo echo testing $fn $frontend >> $sh
		echo cd case >> $sh
		echo ../rlparse $frontend ${fn#case/} '>' $out >> $sh
		echo diff -u $exp $out '>' $diff >> $sh

		echo $sh
	done
done