2025-03-30 09:34:50 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
|
|
dune build
|
|
|
|
|
|
|
|
|
|
prefix="../stdlib/regression/"
|
|
|
|
|
suffix=".lama"
|
|
|
|
|
|
|
|
|
|
compiler=../_build/default/src/Driver.exe
|
|
|
|
|
|
|
|
|
|
echo "Used compiler path:"
|
|
|
|
|
echo $compiler
|
|
|
|
|
|
|
|
|
|
echo "Build modules:"
|
|
|
|
|
for mod in ../stdlib/*.lama; do
|
2025-04-07 01:11:26 +03:00
|
|
|
mod_path="${mod%.*}"
|
|
|
|
|
mod_file="${mod_path##*/}"
|
|
|
|
|
echo $mod_path: $mod_file
|
|
|
|
|
if [ ! -f $mod_file.bc ]; then
|
|
|
|
|
$compiler -b $mod -I ../stdlib/
|
|
|
|
|
fi
|
2025-03-30 09:34:50 +03:00
|
|
|
done
|
|
|
|
|
|
|
|
|
|
echo "Run tests:"
|
2025-04-07 00:46:02 +03:00
|
|
|
for test in ../stdlib/regression/*.lama; do
|
2025-03-30 09:34:50 +03:00
|
|
|
echo $test
|
|
|
|
|
$compiler -b $test -I ../stdlib/ > /dev/null
|
2025-04-07 01:11:26 +03:00
|
|
|
test_path="${test%.*}"
|
|
|
|
|
test_file="${test_path##*/}"
|
|
|
|
|
echo $test_path: $test_file
|
|
|
|
|
# cat $test_file.input | ./byterun.exe -p $test_file.bc > test.bc.code
|
|
|
|
|
# cat $test_file.input | ./byterun.exe -p $test_file.bc
|
|
|
|
|
echo "" | ./byterun.exe -vi $test_file.bc
|
|
|
|
|
# echo "" | ./byterun.exe -vi $test_file.bc > test.log
|
2025-03-30 09:34:50 +03:00
|
|
|
# sed '1d;s/^..//' $test_file.t > test_orig.log
|
|
|
|
|
# diff test.log test_orig.log
|
|
|
|
|
|
2025-04-07 01:11:26 +03:00
|
|
|
rm $test_file.bc
|
2025-03-30 09:34:50 +03:00
|
|
|
# rm test.log test_orig.log
|
|
|
|
|
echo "done"
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
rm *.o
|