about summary refs log blame commit diff stats
path: root/archive/1.vm/test_layers
blob: 47cb01b0e83fd2970e462504af64ab47feb1c7de (plain) (tree)























































































                                                                                          
#!/bin/bash
# Repeatedly stop building until successive layers, and run all tests built,
# while checking for undefined behavior using both UBSan and Valgrind.
#
# 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
set -e

test "$BUILD" || export BUILD=build3

if [[ $1 == one-off ]]
then
  ./$BUILD
  ./mu_bin test || exit 1
  exit 0
fi

# Core layers atop Valgrind
for f in [0-9]*
do
  if [[ $f < $1 ]]; then continue; fi
  if [[ $2 && $f > $2 ]]; then exit 0; fi
  echo "=== $f"
  ./clean top-level  # preserve subsidiary tools like tangle and cleave
  ./$BUILD --until $f || exit 1
  # valgrind requires Linux
  valgrind --leak-check=yes --num-callers=40 -q --error-exitcode=1 ./mu_bin test || exit 1
  # run on Mac OS without valgrind, and with a hacky fix for the coarser clock
#?   ./mu_bin test || exit 1
#?   sleep 1
done

# Layers for Mu apps without Valgrind
./clean
./$BUILD

if [[ ! $1 || $1 == chessboard ]]
then
  echo "=== chessboard"
  ./mu_bin test chessboard.mu || exit 1
fi

# slices of edit/ for Travis CI
if [[ ! $1 || $1 == edit ]]
then
  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
fi
if [[ ! $1 || $1 == edit2 ]]
then
  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
fi
if [[ ! $1 || $1 == edit3 ]]
then
  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
fi
if [[ ! $1 || $1 == edit4 ]]
then
  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
  echo "=== edit: until 012"
  ./mu_bin test edit/00* edit/01[0-2]* || exit 1
fi
ous revision' href='/akkartik/mu/blame/subx/020elf.cc?h=hlt&id=bbe7cd53cb37e5d318c87626a0169987c3841e88'>^
d2571b69 ^
96b2216b ^
d2571b69 ^
96b2216b ^



414d9413 ^
96b2216b ^



414d9413 ^
96b2216b ^

414d9413 ^
c1100182 ^

96b2216b ^
d2571b69 ^
96b2216b ^
665a4d70 ^
96b2216b ^



1f4d0aaf ^







1f4d0aaf ^

43b170ea ^
1f4d0aaf ^
43b170ea ^

708eae31 ^



96b2216b ^



414d9413 ^


1a33d221 ^
708eae31 ^
cd23c8b6 ^
414d9413 ^





1a33d221 ^
414d9413 ^

708eae31 ^

2097401c ^
708eae31 ^


708eae31 ^
087a998e ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142