about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rwxr-xr-xbuild_and_test_until24
-rwxr-xr-xbuild_until15
-rw-r--r--makefile3
-rwxr-xr-xtest_layers26
4 files changed, 32 insertions, 36 deletions
diff --git a/build_and_test_until b/build_and_test_until
index 80a6357f..809cb73c 100755
--- a/build_and_test_until
+++ b/build_and_test_until
@@ -1,24 +1,4 @@
 #!/bin/bash
-# Load all files sorting before the given argument.
-# You can pass in a prefix, but files matching the prefix *won't* be included.
 
-set -e
-set -v
-make --no-print-directory tangle/tangle
-make --no-print-directory enumerate/enumerate
-./tangle/tangle $(./enumerate/enumerate --until $1 |grep -v '.mu$') |grep -v "^\s*//:" > mu.cc
-cat /dev/null $(./enumerate/enumerate --until $1 |grep '.mu$') > core.mu
-make --no-print-directory autogenerated_lists
-set +v
-if [[ `uname` == "Darwin" ]]
-then
-  # Darwin is shit and otherwise thinks mu_bin is newer than the files it just
-  # generated when called from test_all_layers.
-  # All sorts of strange bugs ensue.
-  sleep 1
-  set -v  # Darwin's clang and valgrind is shit.
-  CFLAGS=${CFLAGS:-"-g -O3"} make test
-else
-  set -v
-  CXX=${CXX:-clang++} CFLAGS=${CFLAGS:-"-g -O3 -fsanitize=undefined -Wno-tautological-constant-out-of-range-compare"} make ${2:-valgrind}
-fi
+./build_until $1
+./mu_bin test
diff --git a/build_until b/build_until
new file mode 100755
index 00000000..42d44bc7
--- /dev/null
+++ b/build_until
@@ -0,0 +1,15 @@
+#!/bin/bash
+# Load all files sorting before the given argument.
+# You can pass in a prefix, but files matching the prefix *won't* be included.
+
+set -e
+set -v
+make --no-print-directory tangle/tangle
+make --no-print-directory enumerate/enumerate
+
+./tangle/tangle $(./enumerate/enumerate --until $1 |grep -v '.mu$') |grep -v "^\s*//:" > mu.cc
+make --no-print-directory autogenerated_lists
+
+cat /dev/null $(./enumerate/enumerate --until $1 |grep '.mu$') > core.mu
+
+CFLAGS=${CFLAGS:-"-g -O3"} make
diff --git a/makefile b/makefile
index d4257826..cc0fd84c 100644
--- a/makefile
+++ b/makefile
@@ -49,9 +49,6 @@ test_list: mu.cc
 test: autogenerated_lists mu_bin core.mu
 	./mu_bin test
 
-valgrind: autogenerated_lists mu_bin core.mu
-	valgrind --leak-check=yes --num-callers=40 -q --error-exitcode=1 ./mu_bin test
-
 clena: clean
 clean:
 	cd enumerate && make clean
diff --git a/test_layers b/test_layers
index a8804c41..45cc6b3c 100755
--- a/test_layers
+++ b/test_layers
@@ -1,16 +1,20 @@
 #!/bin/bash
-# Repeatedly stop building until successive layers, and run all tests built.
+# Repeatedly stop building until successive layers, and run all tests built,
+# while checking for undefined behavior using both UBSan and Valgrind.
 #
-# 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
+# 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
 
-TEST_UNTIL="./build_and_test_until"
+BUILD_UNTIL="./build_until"
 MAKE="make"
 VALGRIND="valgrind --leak-check=yes --num-callers=40 -q --error-exitcode=1"
 
@@ -19,7 +23,7 @@ do
   if [[ $f < $1 ]]; then continue; fi
   if [[ $2 && $f > $2 ]]; then exit 0; fi
   echo "=== $f"
-  $TEST_UNTIL $f || exit 1
+  $BUILD_UNTIL $f || exit 1
 done
 
 CXX=clang++ CFLAGS="-O3 -fsanitize=undefined -Wno-tautological-constant-out-of-range-compare" $MAKE