2025-03-30 09:34:50 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
2025-05-24 17:24:19 +03:00
|
|
|
# TODO: FIXME: error on test 3, possible UB or standard change
|
|
|
|
|
xmake build
|
|
|
|
|
cp "build/linux/x86_64/release/byterun" byterun.exe
|
|
|
|
|
|
|
|
|
|
dune build > /dev/null
|
2025-03-30 09:34:50 +03:00
|
|
|
|
|
|
|
|
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-05-24 17:24:19 +03:00
|
|
|
for test in ../stdlib/regression/*03.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
|
2025-04-12 17:09:02 +03:00
|
|
|
echo "" | ./byterun.exe -p $test_file.bc > test.bc.code
|
|
|
|
|
# echo "" | ./byterun.exe -p $test_file.bc
|
|
|
|
|
# echo "" | ./byterun.exe -vi $test_file.bc
|
|
|
|
|
echo "" | ./byterun.exe -vi $test_file.bc > test.log
|
2025-04-12 21:00:20 +03:00
|
|
|
sed '1d;2d;3d;s/^..//' $test_path.t > test_orig.log
|
|
|
|
|
# echo "Result:"
|
|
|
|
|
# cat test.log
|
|
|
|
|
# echo "Original:"
|
|
|
|
|
# cat test_orig.log
|
|
|
|
|
echo "Diff:"
|
|
|
|
|
diff test.log test_orig.log
|
2025-03-30 09:34:50 +03:00
|
|
|
|
2025-04-07 01:11:26 +03:00
|
|
|
rm $test_file.bc
|
2025-04-12 21:00:20 +03:00
|
|
|
rm test.log test_orig.log
|
2025-03-30 09:34:50 +03:00
|
|
|
echo "done"
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
rm *.o
|