From 55009a2289249d5d784c528234b0fbcd532f5551 Mon Sep 17 00:00:00 2001 From: Christian Babeux Date: Tue, 2 Oct 2012 14:20:04 -0400 Subject: [PATCH] Tests: Add health check tests to configure Add health folder to top-level tests Makefile.am. Also add a runall script to run all health check tests. Signed-off-by: Christian Babeux Signed-off-by: David Goulet --- .gitignore | 1 + configure.ac | 1 + tests/tools/Makefile.am | 2 +- tests/tools/health/runall | 28 ++++++++++++++++++++++++++++ tests/tools/runall.sh | 2 +- 5 files changed, 32 insertions(+), 2 deletions(-) create mode 100755 tests/tools/health/runall diff --git a/.gitignore b/.gitignore index 5a04dc26e..8e5fc9c44 100644 --- a/.gitignore +++ b/.gitignore @@ -60,5 +60,6 @@ gen-events-time gen-events gen-ust-events unit_tests +health_check benchmark/ diff --git a/configure.ac b/configure.ac index f33f9e6bd..cb5dc3891 100644 --- a/configure.ac +++ b/configure.ac @@ -288,6 +288,7 @@ AC_CONFIG_FILES([ tests/kernel/Makefile tests/tools/Makefile tests/tools/streaming/Makefile + tests/tools/health/Makefile tests/ust/Makefile tests/ust/nprocesses/Makefile tests/ust/high-throughput/Makefile diff --git a/tests/tools/Makefile.am b/tests/tools/Makefile.am index 3d2590092..faa836ca6 100644 --- a/tests/tools/Makefile.am +++ b/tests/tools/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = streaming +SUBDIRS = streaming health AM_CFLAGS = -g -Wall -I../ AM_LDFLAGS = -lurcu -lurcu-cds diff --git a/tests/tools/health/runall b/tests/tools/health/runall new file mode 100755 index 000000000..c22e3539c --- /dev/null +++ b/tests/tools/health/runall @@ -0,0 +1,28 @@ +#!/bin/bash + +DIR=$(dirname $0) + +tests=( $DIR/health_thread_exit $DIR/health_thread_stall ) +exit_code=0 + +function start_tests () +{ + for bin in ${tests[@]}; + do + if [ ! -e $bin ]; then + echo -e "$bin not found, passing" + continue + fi + + ./$bin + # Test must return 0 to pass. + if [ $? -ne 0 ]; then + exit_code=1 + break + fi + done +} + +start_tests + +exit $exit_code diff --git a/tests/tools/runall.sh b/tests/tools/runall.sh index ca44fef0e..0ad7cf17a 100755 --- a/tests/tools/runall.sh +++ b/tests/tools/runall.sh @@ -3,7 +3,7 @@ DIR=$(dirname $0) tests=( $DIR/test_kernel_data_trace $DIR/test_sessions $DIR/test_ust_data_trace \ - $DIR/streaming/runall ) + $DIR/streaming/runall $DIR/health/runall ) exit_code=0 -- 2.34.1