@@ -113,6 +113,23 @@ AC_SUBST(SDK_INSTALL_PATH)
AM_CONDITIONAL([SDK_INSTALL_PATH_], [test "x${SDK_INSTALL_PATH_}" = "x1"])
##########################################################################
+# Set the install directory for test binaries/scripts
+##########################################################################
+AC_ARG_WITH([testdir],
+ AC_HELP_STRING([--with-testdir=DIR installation directory for tests]),
+ [if test "$withval" = "yes"; then
+ if test "$prefix" = "NONE"; then
+ testdir=$ac_default_prefix/lib/odp/tests
+ else
+ testdir=$prefix/lib/odp/tests
+ fi
+ else
+ testdir=$withval
+ fi], [])
+AC_SUBST([testdir])
+AM_CONDITIONAL([test_installdir], [test "$testdir" != ""])
+
+##########################################################################
# Enable/disable Unit tests
##########################################################################
cunit_support=no
@@ -383,6 +400,7 @@ AC_MSG_RESULT([
sysconfdir: ${sysconfdir}
libdir: ${libdir}
includedir: ${includedir}
+ testdir: ${testdir}
cc: ${CC}
cppflags: ${CPPFLAGS}
@@ -1,6 +1,8 @@
-dist_bin_SCRIPTS = pktio_env \
- pktio_run
+dist_check_SCRIPTS = pktio_env \
+ pktio_run
if HAVE_PCAP
-dist_bin_SCRIPTS += pktio_run_pcap
+dist_check_SCRIPTS += pktio_run_pcap
endif
+
+test_SCRIPTS = $(dist_check_SCRIPTS)
@@ -3,7 +3,7 @@ include ../Makefile.inc
noinst_LTLIBRARIES = libtestbuffer.la
libtestbuffer_la_SOURCES = buffer.c
-bin_PROGRAMS = buffer_main$(EXEEXT)
+test_PROGRAMS = buffer_main$(EXEEXT)
dist_buffer_main_SOURCES = buffer_main.c
buffer_main_LDADD = libtestbuffer.la $(LIBCUNIT_COMMON) $(LIBODP)
@@ -7,7 +7,7 @@ libtestclassification_la_SOURCES = odp_classification_basic.c \
odp_classification_common.c \
classification.c
-bin_PROGRAMS = classification_main$(EXEEXT)
+test_PROGRAMS = classification_main$(EXEEXT)
dist_classification_main_SOURCES = classification_main.c
classification_main_LDADD = libtestclassification.la $(LIBCUNIT_COMMON) $(LIBODP)
@@ -4,7 +4,7 @@ noinst_LTLIBRARIES = libtestcpumask.la
libtestcpumask_la_SOURCES = cpumask.c
libtestcpumask_la_LIBADD = $(LIBCPUMASK_COMMON)
-bin_PROGRAMS = cpumask_main$(EXEEXT)
+test_PROGRAMS = cpumask_main$(EXEEXT)
dist_cpumask_main_SOURCES = cpumask_main.c
cpumask_main_LDADD = libtestcpumask.la $(LIBCUNIT_COMMON) $(LIBODP)
@@ -4,7 +4,7 @@ noinst_LTLIBRARIES = libtestcrypto.la
libtestcrypto_la_SOURCES = crypto.c \
odp_crypto_test_inp.c
-bin_PROGRAMS = crypto_main$(EXEEXT)
+test_PROGRAMS = crypto_main$(EXEEXT)
dist_crypto_main_SOURCES = crypto_main.c
crypto_main_LDADD = libtestcrypto.la $(LIBCUNIT_COMMON) $(LIBODP)
@@ -3,7 +3,7 @@ include ../Makefile.inc
noinst_LTLIBRARIES = libtesterrno.la
libtesterrno_la_SOURCES = errno.c
-bin_PROGRAMS = errno_main$(EXEEXT)
+test_PROGRAMS = errno_main$(EXEEXT)
dist_errno_main_SOURCES = errno_main.c
errno_main_LDADD = libtesterrno.la $(LIBCUNIT_COMMON) $(LIBODP)
@@ -5,7 +5,7 @@ libtestinit_la_SOURCES = init.c
# most platforms are expected not to support multiple ODP inits
# following each other: therefore 3 separate binaries are
# created, each containing its ODP init test.
-bin_PROGRAMS = init_main_abort$(EXEEXT) init_main_log$(EXEEXT) init_main_ok$(EXEEXT)
+test_PROGRAMS = init_main_abort$(EXEEXT) init_main_log$(EXEEXT) init_main_ok$(EXEEXT)
dist_init_main_abort_SOURCES = init_main_abort.c
dist_init_main_log_SOURCES = init_main_log.c
dist_init_main_ok_SOURCES = init_main_ok.c
@@ -3,7 +3,7 @@ include ../Makefile.inc
noinst_LTLIBRARIES = libtestpacket.la
libtestpacket_la_SOURCES = packet.c
-bin_PROGRAMS = packet_main$(EXEEXT)
+test_PROGRAMS = packet_main$(EXEEXT)
dist_packet_main_SOURCES = packet_main.c
packet_main_LDADD = libtestpacket.la $(LIBCUNIT_COMMON) $(LIBODP)
@@ -3,7 +3,7 @@ include ../Makefile.inc
noinst_LTLIBRARIES = libtestpktio.la
libtestpktio_la_SOURCES = pktio.c
-bin_PROGRAMS = pktio_main$(EXEEXT)
+test_PROGRAMS = pktio_main$(EXEEXT)
dist_pktio_main_SOURCES = pktio_main.c
pktio_main_LDADD = libtestpktio.la $(LIBCUNIT_COMMON) $(LIBODP)
@@ -3,7 +3,7 @@ include ../Makefile.inc
noinst_LTLIBRARIES = libtestpool.la
libtestpool_la_SOURCES = pool.c
-bin_PROGRAMS = pool_main$(EXEEXT)
+test_PROGRAMS = pool_main$(EXEEXT)
dist_pool_main_SOURCES = pool_main.c
pool_main_LDADD = libtestpool.la $(LIBCUNIT_COMMON) $(LIBODP)
@@ -3,7 +3,7 @@ include ../Makefile.inc
noinst_LTLIBRARIES = libtestqueue.la
libtestqueue_la_SOURCES = queue.c
-bin_PROGRAMS = queue_main$(EXEEXT)
+test_PROGRAMS = queue_main$(EXEEXT)
dist_queue_main_SOURCES = queue_main.c
queue_main_LDADD = libtestqueue.la $(LIBCUNIT_COMMON) $(LIBODP)
@@ -3,7 +3,7 @@ include ../Makefile.inc
noinst_LTLIBRARIES = libtestrandom.la
libtestrandom_la_SOURCES = random.c
-bin_PROGRAMS = random_main$(EXEEXT)
+test_PROGRAMS = random_main$(EXEEXT)
dist_random_main_SOURCES = random_main.c
random_main_LDADD = libtestrandom.la $(LIBCUNIT_COMMON) $(LIBODP)
@@ -3,7 +3,7 @@ include ../Makefile.inc
noinst_LTLIBRARIES = libtestscheduler.la
libtestscheduler_la_SOURCES = scheduler.c
-bin_PROGRAMS = scheduler_main$(EXEEXT)
+test_PROGRAMS = scheduler_main$(EXEEXT)
dist_scheduler_main_SOURCES = scheduler_main.c
scheduler_main_LDADD = libtestscheduler.la $(LIBCUNIT_COMMON) $(LIBODP)
@@ -3,7 +3,7 @@ include ../Makefile.inc
noinst_LTLIBRARIES = libtestshmem.la
libtestshmem_la_SOURCES = shmem.c
-bin_PROGRAMS = shmem_main$(EXEEXT)
+test_PROGRAMS = shmem_main$(EXEEXT)
dist_shmem_main_SOURCES = shmem_main.c
shmem_main_LDADD = libtestshmem.la $(LIBCUNIT_COMMON) $(LIBODP)
@@ -3,7 +3,7 @@ include ../Makefile.inc
noinst_LTLIBRARIES = libtestsynchronizers.la
libtestsynchronizers_la_SOURCES = synchronizers.c
-bin_PROGRAMS = synchronizers_main$(EXEEXT)
+test_PROGRAMS = synchronizers_main$(EXEEXT)
dist_synchronizers_main_SOURCES = synchronizers_main.c
synchronizers_main_LDADD = libtestsynchronizers.la $(LIBCUNIT_COMMON) $(LIBODP)
@@ -3,7 +3,7 @@ include ../Makefile.inc
noinst_LTLIBRARIES = libtestsystem.la
libtestsystem_la_SOURCES = system.c
-bin_PROGRAMS = system_main$(EXEEXT)
+test_PROGRAMS = system_main$(EXEEXT)
dist_system_main_SOURCES = system_main.c
system_main_LDADD = libtestsystem.la $(LIBCUNIT_COMMON) $(LIBODP)
@@ -5,7 +5,7 @@ libtestthread_la_SOURCES = thread.c
libtestthread_la_CFLAGS = $(AM_CFLAGS) -DTEST_THRMASK
libtestthread_la_LIBADD = $(LIBTHRMASK_COMMON)
-bin_PROGRAMS = thread_main$(EXEEXT)
+test_PROGRAMS = thread_main$(EXEEXT)
dist_thread_main_SOURCES = thread_main.c
thread_main_LDADD = libtestthread.la $(LIBCUNIT_COMMON) $(LIBODP)
@@ -3,7 +3,7 @@ include ../Makefile.inc
noinst_LTLIBRARIES = libtesttime.la
libtesttime_la_SOURCES = time.c
-bin_PROGRAMS = time_main$(EXEEXT)
+test_PROGRAMS = time_main$(EXEEXT)
dist_time_main_SOURCES = time_main.c
time_main_LDADD = libtesttime.la $(LIBCUNIT_COMMON) $(LIBODP)
@@ -3,7 +3,7 @@ include ../Makefile.inc
noinst_LTLIBRARIES = libtesttimer.la
libtesttimer_la_SOURCES = timer.c
-bin_PROGRAMS = timer_main$(EXEEXT)
+test_PROGRAMS = timer_main$(EXEEXT)
dist_timer_main_SOURCES = timer_main.c
timer_main_LDADD = libtesttimer.la $(LIBCUNIT_COMMON) $(LIBODP)
Previously if a build had been configured with validation tests enabled (--enable-test-vald) a subsequent "make install" would install the test binaries and scripts into /usr/local/bin without any way of separating them from the rest of the installed artefacts. This patch changes the default behaviour to not install test binaries or scripts and adds a configure parameter (--with-testdir) to explicitly enable installation. These changes are required in order to be able to package the tests separately (e.g. in OpenEmbedded) and also to enable post-install testing. Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org> --- configure.ac | 18 ++++++++++++++++++ platform/linux-generic/test/pktio/Makefile.am | 8 +++++--- test/validation/buffer/Makefile.am | 2 +- test/validation/classification/Makefile.am | 2 +- test/validation/cpumask/Makefile.am | 2 +- test/validation/crypto/Makefile.am | 2 +- test/validation/errno/Makefile.am | 2 +- test/validation/init/Makefile.am | 2 +- test/validation/packet/Makefile.am | 2 +- test/validation/pktio/Makefile.am | 2 +- test/validation/pool/Makefile.am | 2 +- test/validation/queue/Makefile.am | 2 +- test/validation/random/Makefile.am | 2 +- test/validation/scheduler/Makefile.am | 2 +- test/validation/shmem/Makefile.am | 2 +- test/validation/synchronizers/Makefile.am | 2 +- test/validation/system/Makefile.am | 2 +- test/validation/thread/Makefile.am | 2 +- test/validation/time/Makefile.am | 2 +- test/validation/timer/Makefile.am | 2 +- 20 files changed, 41 insertions(+), 21 deletions(-)