Set up the environment to allow calling the performance tests in process mode as part of make check when enabled.
To run the tests use --enable-test-perf-proc Initial patch using odp_scheduling as a proof Signed-off-by: Mike Holmes <[email protected]> --- configure.ac | 2 ++ test/linux-generic/Makefile.am | 2 +- test/linux-generic/m4/configure.m4 | 5 ++++- test/linux-generic/m4/performance.m4 | 9 ++++++++ test/linux-generic/performance/.gitignore | 2 ++ test/linux-generic/performance/Makefile.am | 13 +++++++++++ .../performance/odp_scheduling_run_proc.sh | 26 ++++++++++++++++++++++ 7 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 test/linux-generic/m4/performance.m4 create mode 100644 test/linux-generic/performance/.gitignore create mode 100644 test/linux-generic/performance/Makefile.am create mode 100755 test/linux-generic/performance/odp_scheduling_run_proc.sh diff --git a/configure.ac b/configure.ac index c0f0f21..6551287 100644 --- a/configure.ac +++ b/configure.ac @@ -169,6 +169,7 @@ AM_CONDITIONAL([test_installdir], [test "$testdir" != ""]) AM_CONDITIONAL([cunit_support], [test x$cunit_support = xyes ]) AM_CONDITIONAL([test_vald], [test x$test_vald = xyes ]) AM_CONDITIONAL([test_perf], [test x$test_perf = xyes ]) +AM_CONDITIONAL([test_perf_proc], [test x$test_perf_proc = xyes ]) AM_CONDITIONAL([test_cpp], [test x$test_cpp = xyes ]) AM_CONDITIONAL([test_helper], [test x$test_helper = xyes ]) AM_CONDITIONAL([test_example], [test x$test_example = xyes ]) @@ -302,6 +303,7 @@ AC_MSG_RESULT([ cunit: ${cunit_support} test_vald: ${test_vald} test_perf: ${test_perf} + test_perf_proc: ${test_perf_proc} test_cpp: ${test_cpp} test_helper: ${test_helper} test_example: ${test_example} diff --git a/test/linux-generic/Makefile.am b/test/linux-generic/Makefile.am index f5cc52d..4660cf0 100644 --- a/test/linux-generic/Makefile.am +++ b/test/linux-generic/Makefile.am @@ -3,7 +3,7 @@ TESTS_ENVIRONMENT += TEST_DIR=${top_builddir}/test/common_plat/validation ALL_API_VALIDATION_DIR = ${top_builddir}/test/common_plat/validation/api -SUBDIRS = +SUBDIRS = performance if test_vald TESTS = validation/api/pktio/pktio_run.sh \ diff --git a/test/linux-generic/m4/configure.m4 b/test/linux-generic/m4/configure.m4 index 9eec545..6b92201 100644 --- a/test/linux-generic/m4/configure.m4 +++ b/test/linux-generic/m4/configure.m4 @@ -1,5 +1,8 @@ +m4_include([test/linux-generic/m4/performance.m4]) + AC_CONFIG_FILES([test/linux-generic/Makefile test/linux-generic/validation/api/shmem/Makefile test/linux-generic/validation/api/pktio/Makefile test/linux-generic/pktio_ipc/Makefile - test/linux-generic/ring/Makefile]) + test/linux-generic/ring/Makefile + test/linux-generic/performance/Makefile]) diff --git a/test/linux-generic/m4/performance.m4 b/test/linux-generic/m4/performance.m4 new file mode 100644 index 0000000..7f54b96 --- /dev/null +++ b/test/linux-generic/m4/performance.m4 @@ -0,0 +1,9 @@ +########################################################################## +# Enable/disable test-perf-proc +########################################################################## +test_perf_proc=no +AC_ARG_ENABLE([test-perf-proc], + [ --enable-test-perf-proc run test in test/performance in process mode], + [if test "x$enableval" = "xyes"; then + test_perf_proc=yes + fi]) diff --git a/test/linux-generic/performance/.gitignore b/test/linux-generic/performance/.gitignore new file mode 100644 index 0000000..7e563b8 --- /dev/null +++ b/test/linux-generic/performance/.gitignore @@ -0,0 +1,2 @@ +*.log +*.trs diff --git a/test/linux-generic/performance/Makefile.am b/test/linux-generic/performance/Makefile.am new file mode 100644 index 0000000..cb72fce --- /dev/null +++ b/test/linux-generic/performance/Makefile.am @@ -0,0 +1,13 @@ +include $(top_srcdir)/test/Makefile.inc + +TESTS_ENVIRONMENT += TEST_DIR=${builddir} + +TESTSCRIPTS = odp_scheduling_run_proc.sh + +TEST_EXTENSIONS = .sh + +if test_perf_proc +TESTS = $(TESTSCRIPTS) +endif + +EXTRA_DIST = $(TESTSCRIPTS) diff --git a/test/linux-generic/performance/odp_scheduling_run_proc.sh b/test/linux-generic/performance/odp_scheduling_run_proc.sh new file mode 100755 index 0000000..b3ef26f --- /dev/null +++ b/test/linux-generic/performance/odp_scheduling_run_proc.sh @@ -0,0 +1,26 @@ +#!/bin/sh +# +# Copyright (c) 2016, Linaro Limited +# All rights reserved. +# +# SPDX-License-Identifier: BSD-3-Clause +# +# Script that passes command line arguments to odp_scheduling test when +# launched by 'make check' + +TEST_DIR="${TEST_DIR:-$(dirname $0)}" +PERFORMANCE="$TEST_DIR/../../common_plat/performance" +ret=0 + +run() +{ + echo odp_scheduling_run_proc starts with $1 worker threads + echo ===================================================== + + $PERFORMANCE/odp_scheduling${EXEEXT} --odph_proc -c $1 || ret=1 +} + +run 1 +run 8 + +exit $ret -- 2.7.4
