2016-05-09 02:11:51 +00:00
|
|
|
#!/bin/bash
|
2016-05-09 06:37:07 +00:00
|
|
|
# Repeatedly stop building until successive layers, and run all tests built,
|
|
|
|
# while checking for undefined behavior using both UBSan and Valgrind.
|
2016-05-09 05:36:30 +00:00
|
|
|
#
|
2016-05-09 06:37:07 +00:00
|
|
|
# Requires Linux.
|
|
|
|
#
|
|
|
|
# Usage:
|
|
|
|
# Test all layers:
|
|
|
|
# test_layers
|
|
|
|
# Test non-app layers after x:
|
|
|
|
# test_layers x
|
|
|
|
# Test layers after x and until y (inclusive):
|
|
|
|
# test_layers x y
|
|
|
|
# Test all layers for a specific app:
|
|
|
|
# test_layers app
|
2016-05-09 01:56:32 +00:00
|
|
|
|
2016-06-02 20:17:21 +00:00
|
|
|
if [[ $1 == one-off ]]
|
|
|
|
then
|
|
|
|
make
|
|
|
|
./mu_bin test || exit 1
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2016-05-09 20:59:36 +00:00
|
|
|
# Core layers atop Valgrind
|
2016-05-09 01:56:32 +00:00
|
|
|
for f in [0-9]*
|
|
|
|
do
|
2016-05-09 02:11:51 +00:00
|
|
|
if [[ $f < $1 ]]; then continue; fi
|
2016-05-09 05:36:30 +00:00
|
|
|
if [[ $2 && $f > $2 ]]; then exit 0; fi
|
2016-05-09 01:56:32 +00:00
|
|
|
echo "=== $f"
|
2016-05-09 20:59:36 +00:00
|
|
|
./build_until $f || exit 1
|
|
|
|
valgrind --leak-check=yes --num-callers=40 -q --error-exitcode=1 ./mu_bin test || exit 1
|
2016-05-09 01:56:32 +00:00
|
|
|
done
|
|
|
|
|
2016-05-09 20:59:36 +00:00
|
|
|
# Layers for Mu apps without Valgrind
|
|
|
|
CXX=clang++ CFLAGS="-O3 -fsanitize=undefined -Wno-tautological-constant-out-of-range-compare" make
|
2016-05-09 05:36:30 +00:00
|
|
|
|
2016-05-09 02:11:51 +00:00
|
|
|
if [[ ! $1 || $1 == chessboard ]]
|
2016-05-09 01:56:32 +00:00
|
|
|
then
|
|
|
|
echo "=== chessboard"
|
2016-05-09 20:59:36 +00:00
|
|
|
./mu_bin test chessboard.mu || exit 1
|
2016-05-09 01:56:32 +00:00
|
|
|
fi
|
|
|
|
|
2016-05-09 20:59:36 +00:00
|
|
|
# slices of edit/ for Travis CI
|
|
|
|
if [[ ! $1 || $1 == edit ]]
|
2016-05-09 01:56:32 +00:00
|
|
|
then
|
2016-05-09 20:59:36 +00:00
|
|
|
echo "=== edit: until 001"
|
|
|
|
./mu_bin test edit/001* || exit 1
|
|
|
|
echo "=== edit: until 002"
|
|
|
|
./mu_bin test edit/00[1-2]* || exit 1
|
|
|
|
echo "=== edit: until 003"
|
|
|
|
./mu_bin test edit/00[1-3]* || exit 1
|
2016-05-09 01:56:32 +00:00
|
|
|
fi
|
2016-05-09 20:59:36 +00:00
|
|
|
if [[ ! $1 || $1 == edit2 ]]
|
2016-05-09 06:25:04 +00:00
|
|
|
then
|
2016-05-09 20:59:36 +00:00
|
|
|
echo "=== edit: until 004"
|
|
|
|
./mu_bin test edit/00[1-4]* || exit 1
|
|
|
|
echo "=== edit: until 005"
|
|
|
|
./mu_bin test edit/00[1-5]* || exit 1
|
|
|
|
echo "=== edit: until 006"
|
|
|
|
./mu_bin test edit/00[1-6]* || exit 1
|
2016-05-09 06:25:04 +00:00
|
|
|
fi
|
2016-05-09 20:59:36 +00:00
|
|
|
if [[ ! $1 || $1 == edit3 ]]
|
2016-05-09 06:25:04 +00:00
|
|
|
then
|
2016-05-09 20:59:36 +00:00
|
|
|
echo "=== edit: until 007"
|
|
|
|
./mu_bin test edit/00[1-7]* || exit 1
|
|
|
|
echo "=== edit: until 008"
|
|
|
|
./mu_bin test edit/00[1-8]* || exit 1
|
|
|
|
echo "=== edit: until 009"
|
|
|
|
./mu_bin test edit/00* || exit 1
|
2016-05-09 06:25:04 +00:00
|
|
|
fi
|
2016-05-09 20:59:36 +00:00
|
|
|
if [[ ! $1 || $1 == edit4 ]]
|
2016-05-09 06:25:04 +00:00
|
|
|
then
|
2016-05-09 20:59:36 +00:00
|
|
|
echo "=== edit: until 010"
|
|
|
|
./mu_bin test edit/00* edit/010* || exit 1
|
|
|
|
echo "=== edit: until 011"
|
|
|
|
./mu_bin test edit/00* edit/01[01]* || exit 1
|
2016-05-09 06:25:04 +00:00
|
|
|
fi
|