fix other mandelbrot variants
[mu.git] / archive / 1.vm / test_layers
blob47cb01b0e83fd2970e462504af64ab47feb1c7de
1 #!/bin/bash
2 # Repeatedly stop building until successive layers, and run all tests built,
3 # while checking for undefined behavior using both UBSan and Valgrind.
5 # Requires Linux.
7 # Usage:
8 # Test all layers:
9 # test_layers
10 # Test non-app layers after x:
11 # test_layers x
12 # Test layers after x and until y (inclusive):
13 # test_layers x y
14 # Test all layers for a specific app:
15 # test_layers app
16 set -e
18 test "$BUILD" || export BUILD=build3
20 if [[ $1 == one-off ]]
21 then
22 ./$BUILD
23 ./mu_bin test || exit 1
24 exit 0
27 # Core layers atop Valgrind
28 for f in [0-9]*
30 if [[ $f < $1 ]]; then continue; fi
31 if [[ $2 && $f > $2 ]]; then exit 0; fi
32 echo "=== $f"
33 ./clean top-level # preserve subsidiary tools like tangle and cleave
34 ./$BUILD --until $f || exit 1
35 # valgrind requires Linux
36 valgrind --leak-check=yes --num-callers=40 -q --error-exitcode=1 ./mu_bin test || exit 1
37 # run on Mac OS without valgrind, and with a hacky fix for the coarser clock
38 #? ./mu_bin test || exit 1
39 #? sleep 1
40 done
42 # Layers for Mu apps without Valgrind
43 ./clean
44 ./$BUILD
46 if [[ ! $1 || $1 == chessboard ]]
47 then
48 echo "=== chessboard"
49 ./mu_bin test chessboard.mu || exit 1
52 # slices of edit/ for Travis CI
53 if [[ ! $1 || $1 == edit ]]
54 then
55 echo "=== edit: until 001"
56 ./mu_bin test edit/001* || exit 1
57 echo "=== edit: until 002"
58 ./mu_bin test edit/00[1-2]* || exit 1
59 echo "=== edit: until 003"
60 ./mu_bin test edit/00[1-3]* || exit 1
62 if [[ ! $1 || $1 == edit2 ]]
63 then
64 echo "=== edit: until 004"
65 ./mu_bin test edit/00[1-4]* || exit 1
66 echo "=== edit: until 005"
67 ./mu_bin test edit/00[1-5]* || exit 1
68 echo "=== edit: until 006"
69 ./mu_bin test edit/00[1-6]* || exit 1
71 if [[ ! $1 || $1 == edit3 ]]
72 then
73 echo "=== edit: until 007"
74 ./mu_bin test edit/00[1-7]* || exit 1
75 echo "=== edit: until 008"
76 ./mu_bin test edit/00[1-8]* || exit 1
77 echo "=== edit: until 009"
78 ./mu_bin test edit/00* || exit 1
80 if [[ ! $1 || $1 == edit4 ]]
81 then
82 echo "=== edit: until 010"
83 ./mu_bin test edit/00* edit/010* || exit 1
84 echo "=== edit: until 011"
85 ./mu_bin test edit/00* edit/01[01]* || exit 1
86 echo "=== edit: until 012"
87 ./mu_bin test edit/00* edit/01[0-2]* || exit 1