Add first set of SI95 unit tests and health check
[ric-plt/lib/rmr.git] / ci / build_all.sh
1 #!/usr/bin/env bash
2 # :vim ts=4 sw=4 noet:
3 #==================================================================================
4 #    Copyright (c) 2020 Nokia
5 #    Copyright (c) 2020 AT&T Intellectual Property.
6 #
7 #   Licensed under the Apache License, Version 2.0 (the "License");
8 #   you may not use this file except in compliance with the License.
9 #   You may obtain a copy of the License at
10 #
11 #       http://www.apache.org/licenses/LICENSE-2.0
12 #
13 #   Unless required by applicable law or agreed to in writing, software
14 #   distributed under the License is distributed on an "AS IS" BASIS,
15 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 #   See the License for the specific language governing permissions and
17 #   limitations under the License.
18 #==================================================================================
19 #
20
21 #       Mnemonic:       build_all.sh
22 #       Abstract:       To setup CMake and build multiple packages with varying content
23 #                               (dev and runtime) it may be easier to run a single script.
24 #                               This is that script which will:
25 #                                       1) make the .build directory
26 #                                       2) run cmake to configure the dev package
27 #                                       3) build the dev package
28 #                                       4) run cmake to conigure the runtime package
29 #                                       5) build the runtime package
30 #                                       6) run unit tests
31 #
32 #                               Assumptions:
33 #                                       We assume that this scirpt is executed at the 'root' of the
34 #                                       RMr repo (i.e. the directory which has a subdirectory ci).
35 #                                       e.g.  bash ci/build_all.sh
36 #
37 #                               Coverage Files
38 #                               As a part of unit testing, coverage files are left in /tmp/rmr_gcov
39 #                               which can be overridden by setting the environment variable
40 #                               UT_COVERAGE_DIR.
41 #
42 #       Returns:        The exit code will be non-zero on failure, and 0 if all builds and
43 #                               the tests pass.
44 #
45 #       Date:           28 February 2010
46 # --------------------------------------------------------------------------------
47
48 set -e  # lazy error checking
49 mkdir -p .build
50 cd .build
51 cmake .. -DDEV_PKG=1 -DBUILD_DOC=1
52 make package install
53 cmake .. -DDEV_PKG=0
54 make package install
55 make test ARGS="-V"
56
57 exit $?
58