| 1 | #!/usr/bin/env bash |
| 2 | # |
| 3 | # Copyright: 2020-2024 (c) Netdata Inc. |
| 4 | # SPDX-License-Identifier: GPL-3.0-or-later |
| 5 | # |
| 6 | # Author: Austin S. Hemmelgarn <austin@netdata.cloud> |
| 7 | # |
| 8 | # shellcheck disable=SC2230 |
| 9 | |
| 10 | install_netdata() { |
| 11 | echo "Installing Netdata" |
| 12 | |
| 13 | NETDATA_CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Debug -DENABLE_ADDRESS_SANITIZER=On" \ |
| 14 | fakeroot ./netdata-installer.sh \ |
| 15 | --install-prefix "$HOME" \ |
| 16 | --dont-wait \ |
| 17 | --dont-start-it \ |
| 18 | --disable-lto |
| 19 | } |
| 20 | |
| 21 | c_unit_tests() { |
| 22 | echo "Running C code unit tests" |
| 23 | |
| 24 | ASAN_OPTIONS=detect_leaks=0 \ |
| 25 | "$HOME"/netdata/usr/sbin/netdata -W unittest |
| 26 | } |
| 27 | |
| 28 | install_netdata || exit 1 |
| 29 | |
| 30 | c_unit_tests || exit 1 |