Simplify layout of lua test script locations.

This commit is contained in:
James Roseborough
2012-09-07 14:05:41 +00:00
parent 3bacea878e
commit f2d1106fe5
27 changed files with 151 additions and 166 deletions

View File

@@ -1,18 +1,39 @@
#!/bin/bash
#unzip -o luaj3.0-tests.zip
#
# unpack the luaj test archive, compile and run it locally, and repack the results
# unzip existing archive
unzip -n luaj3.0-tests.zip
rm *.lc *.out */*.lc */*.out
# compile tests for compiler and save binary files
for DIR in "lua5.2.1-tests" "regressions"; do
cd ${DIR}
FILES=`ls -1 *.lua | awk 'BEGIN { FS="." } ; { print $1 }'`
for FILE in $FILES ; do
echo 'compiling' `pwd` $FILE
luac ${FILE}.lua
mv luac.out ${FILE}.lc
done
cd ..
done
# run test lua scripts and save output
for DIR in "errors" "perf" "."; do
cd ${DIR}
FILES=`ls -1 *.lua | awk 'BEGIN { FS="." } ; { print $1 }'`
echo "FILES" $FILES
for FILE in $FILES ; do
echo "executing ${FILE}.lua"
luac ${FILE}.lua
mv luac.out ${FILE}.lc
echo 'executing' `pwd` $FILE
lua ${FILE}.lua > ${FILE}.out
done
rm abc.txt
cd ..
done
cd lua
rm -f luaj3.0-tests.zip
# create new zipfile
rm -f luaj3.0-tests.zip regressions
zip -9 luaj3.0-tests.zip *.lua *.lc *.out */*.lua */*.lc */*.out
# cleanup
rm *.out */*.lc */*.out
rm -r lua5.2.1-tests