1 | #!/usr/bin/env bash
|
2 | #
|
3 | # Run C++ unit tests.
|
4 | #
|
5 | # Usage:
|
6 | # test/cpp-unit.sh <function name>
|
7 |
|
8 | set -o nounset
|
9 | set -o pipefail
|
10 | set -o errexit
|
11 |
|
12 | all-tests() {
|
13 | asdl/TEST.sh unit
|
14 |
|
15 | core/TEST.sh unit
|
16 |
|
17 | cpp/TEST.sh unit
|
18 |
|
19 | data_lang/TEST.sh unit
|
20 |
|
21 | frontend/TEST.sh unit
|
22 |
|
23 | # uses Ninja to run (cxx, gcalways) variant. Could also run (clang, ubsan),
|
24 | # which finds more bugs.
|
25 | mycpp/TEST.sh test-runtime
|
26 |
|
27 | yaks/TEST.sh unit
|
28 | }
|
29 |
|
30 | soil-run() {
|
31 | ### Hook for soil/worker.sh
|
32 |
|
33 | # Soil only does build/dev.sh minimal, while most devs should do build/dev.sh
|
34 | # all, and can run all-tests by itself
|
35 | cpp/TEST.sh pre-build
|
36 |
|
37 | set +o errexit
|
38 | $0 all-tests
|
39 | local status=$?
|
40 | set -o errexit
|
41 |
|
42 | return $status
|
43 | }
|
44 |
|
45 | "$@"
|