run-unit-tests.sh 638 B

123456789101112131415161718192021222324252627282930
  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. install_netdata() {
  10. echo "Installing Netdata"
  11. NETDATA_CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Debug -DENABLE_ADDRESS_SANITIZER=On" \
  12. fakeroot ./netdata-installer.sh \
  13. --install-prefix "$HOME" \
  14. --dont-wait \
  15. --dont-start-it \
  16. --disable-lto
  17. }
  18. c_unit_tests() {
  19. echo "Running C code unit tests"
  20. ASAN_OPTIONS=detect_leaks=0 \
  21. "$HOME"/netdata/usr/sbin/netdata -W unittest
  22. }
  23. install_netdata || exit 1
  24. c_unit_tests || exit 1