mu/test_layers

62 lines
1.4 KiB
Plaintext
Raw Normal View History

#!/bin/bash
2019-07-27 23:01:55 +00:00
# Repeatedly stop building until successive layers, and run all tests built.
#
2019-07-27 23:01:55 +00:00
# Assumes .subx files all come after .cc files.
2019-07-27 23:01:55 +00:00
set -e
2016-06-02 20:17:21 +00:00
2019-07-27 23:01:55 +00:00
cd `dirname $0`
# add C++ files one at a time
for f in [0-9]*cc
do
2020-08-03 00:32:01 +00:00
echo "=== bootstrap $f"
2019-07-27 23:01:55 +00:00
./build_and_test_until $f
done
2019-07-27 23:01:55 +00:00
# build everything one last time
./clean
./build # build optimized since we'll be running it repeatedly below
2020-08-03 00:32:01 +00:00
# test pure-SubX files (without syntax sugar) one at a time using bootstrap
2020-07-05 19:42:28 +00:00
for f in [012]*.subx
2019-07-27 23:01:55 +00:00
do
2020-08-03 00:32:01 +00:00
echo "=== bootstrap $f"
./bootstrap translate init.linux $(tools/enumerate --until $f |grep '\.subx$') -o a.elf
./bootstrap run a.elf test
2019-07-27 23:01:55 +00:00
echo
test `uname` = 'Linux' && {
chmod +x a.elf
./a.elf test
2019-07-27 23:01:55 +00:00
echo
} || true
done
2020-08-03 00:32:01 +00:00
# test all SubX files one at a time using the self-hosted translator
for f in [0-9]*.subx
do
echo "=== self-hosted $f"
./translate_subx init.linux $(tools/enumerate --until $f |grep '\.subx$')
./bootstrap run a.elf test
echo
test `uname` = 'Linux' && {
chmod +x a.elf
./a.elf test
echo
} || true
done
# test all Mu files one at a time using the self-hosted translator
for f in [0-9]*.mu
do
echo "=== self-hosted $f"
cat $(tools/enumerate --until $f |grep '\.mu$') |apps/mu > a.subx
./translate_subx init.linux [0-9]*.subx a.subx
./bootstrap run a.elf test
echo
test `uname` = 'Linux' && {
chmod +x a.elf
./a.elf test
echo
} || true
done