OILS / test / cpp-unit.sh View on Github | oilshell.org

48 lines, 21 significant
1#!/usr/bin/env bash
2#
3# Run C++ unit tests.
4#
5# Usage:
6# test/cpp-unit.sh <function name>
7
8set -o nounset
9set -o pipefail
10set -o errexit
11
12source soil/common.sh # find-dir-html
13
14all-tests() {
15 asdl/TEST.sh unit
16
17 core/TEST.sh unit
18
19 cpp/TEST.sh unit
20
21 data_lang/TEST.sh unit
22
23 frontend/TEST.sh unit
24
25 # uses Ninja to run (cxx, gcalways) variant. Could also run (clang, ubsan),
26 # which finds more bugs.
27 mycpp/TEST.sh test-runtime
28}
29
30soil-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 # Logs in _test/cxx-asan, etc.
43 find-dir-html _test cpp-unit
44
45 return $status
46}
47
48"$@"