aat

git mirror of https://ccx.te2000.cz/bzr/aat
git clone https://ccx.te2000.cz/git/aat
Log | Files | Refs | README

aattest (760B)


      1 #!/bin/zsh
      2 : ${delim:=---}
      3 : ${AWK:=awk}
      4 : ${SED:=sed}
      5 
      6 dst=$1
      7 bin=$0:h:a/bin
      8 [[ -d $dst ]] && rm -r $dst
      9 mkdir -p $dst || exit $?
     10 
     11 while IFS= read line; do
     12 	[[ $line == $delim ]] && break
     13 	printf '%s\n' $line >>$dst/test.aat || exit $?
     14 done
     15 
     16 cat >$dst/test.data || exit $?
     17 cat >$dst/Makefile <<EOF  || exit $?
     18 test.out: test.data test.qawk
     19 	awk -f test.qawk DEBUG=\$(DEBUG) test.data >test.out
     20 
     21 test.qawk: test.awk
     22 	$bin:h/query.pl test.awk >test.qawk
     23 
     24 # test.qawk: test.awk
     25 # 	awk -f $bin/query.awk <test.awk >test.qawk
     26 
     27 test.awk: test.mac
     28 	sed -f $bin/aat_macros.sed <test.mac >test.awk
     29 
     30 test.mac: test.aat
     31 	AAT_DEP=test.dep awk -f $bin/aat.awk test.aat >test.mac
     32 
     33 clean:
     34 	rm -f test.out test.qawk test.awk test.mac
     35 EOF
     36 
     37 gmake -sC $dst && cat $dst/test.out