diff mbox

[2/2] linux-generic: test: add process mode scheduler test

Message ID 1458585245-31429-3-git-send-email-mike.holmes@linaro.org
State New
Headers show

Commit Message

Mike Holmes March 21, 2016, 6:34 p.m. UTC
Add new platform test infrastructure to run the scheduler performance
test in process mode.

Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
---
 platform/linux-generic/m4/configure.m4             |  1 +
 platform/linux-generic/test/Makefile.am            |  2 +-
 platform/linux-generic/test/performance/.gitignore |  1 +
 .../linux-generic/test/performance/Makefile.am     | 26 ++++++++++++++++++++
 .../test/performance/odp_scheduling_proc_run       | 28 ++++++++++++++++++++++
 5 files changed, 57 insertions(+), 1 deletion(-)
 create mode 100644 platform/linux-generic/test/performance/.gitignore
 create mode 100644 platform/linux-generic/test/performance/Makefile.am
 create mode 100755 platform/linux-generic/test/performance/odp_scheduling_proc_run
diff mbox

Patch

diff --git a/platform/linux-generic/m4/configure.m4 b/platform/linux-generic/m4/configure.m4
index 8b09a45..7c29093 100644
--- a/platform/linux-generic/m4/configure.m4
+++ b/platform/linux-generic/m4/configure.m4
@@ -24,5 +24,6 @@  m4_include([platform/linux-generic/m4/odp_pcap.m4])
 
 AC_CONFIG_FILES([platform/linux-generic/Makefile
 		 platform/linux-generic/test/Makefile
+		 platform/linux-generic/test/performance/Makefile
 		 platform/linux-generic/test/validation/Makefile
 		 platform/linux-generic/test/validation/pktio/Makefile])
diff --git a/platform/linux-generic/test/Makefile.am b/platform/linux-generic/test/Makefile.am
index 312d18e..1dd0170 100644
--- a/platform/linux-generic/test/Makefile.am
+++ b/platform/linux-generic/test/Makefile.am
@@ -1 +1 @@ 
-SUBDIRS = validation
+SUBDIRS = validation performance
diff --git a/platform/linux-generic/test/performance/.gitignore b/platform/linux-generic/test/performance/.gitignore
new file mode 100644
index 0000000..93778a9
--- /dev/null
+++ b/platform/linux-generic/test/performance/.gitignore
@@ -0,0 +1 @@ 
+tests-performance.env
diff --git a/platform/linux-generic/test/performance/Makefile.am b/platform/linux-generic/test/performance/Makefile.am
new file mode 100644
index 0000000..c20df55
--- /dev/null
+++ b/platform/linux-generic/test/performance/Makefile.am
@@ -0,0 +1,26 @@ 
+include $(top_srcdir)/test/Makefile.inc
+TESTS_ENVIRONMENT += TEST_DIR=${top_builddir}/test/performance
+
+if test_perf
+TESTS = odp_scheduling_proc_run
+endif
+
+dist_check_SCRIPTS = ../run-test tests-performance.env $(LOG_COMPILER) \
+		     odp_scheduling_proc_run
+
+test_SCRIPTS = $(dist_check_SCRIPTS)
+
+if test_installdir
+installcheck-local:
+		$(DESTDIR)/$(testdir)/run-test
+endif
+
+
+clean-local:
+	rm -rf $(builddir)/tests-performance.env
+
+.PHONY: tests-performance.env
+tests-performance.env:
+	@echo "TESTS=\"$(TESTS)\""    > $@
+	@echo "$(TESTS_ENVIRONMENT)" >> $@
+	@echo "LOG_COMPILER=\"$(LOG_COMPILER)\""      >> $@
diff --git a/platform/linux-generic/test/performance/odp_scheduling_proc_run b/platform/linux-generic/test/performance/odp_scheduling_proc_run
new file mode 100755
index 0000000..1210674
--- /dev/null
+++ b/platform/linux-generic/test/performance/odp_scheduling_proc_run
@@ -0,0 +1,28 @@ 
+#!/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)}"
+
+PATH=${TEST_DIR}:$PATH
+PATH=$(dirname $0)/../../../../test/performance:$PATH
+
+ret=0
+
+run()
+{
+	echo odp_scheduling_proc_run starts with $1 worker threads
+	echo ===============================================
+
+	odp_scheduling${EXEEXT} -c $1 --proc || ret=1
+}
+
+run 1
+run 8
+
+exit $ret