All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: xenomai-core <xenomai@xenomai.org>
Subject: [Xenomai-core] [PATCH] consolidate testsuite installation
Date: Sun, 10 Dec 2006 11:21:13 +0100	[thread overview]
Message-ID: <457BDF99.1020405@domain.hid> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 837 bytes --]

The only part of the Xenomai user-space package not yet following
standard installation rules is the testsuite. It gets installed to
$prefix/testsuite, by default /usr/testsuite. The attached patch is an
approach to overcome this unusual layout.

My suggestion, realised by this patch, is to push run scripts and
.runinfo files to $prefix/share/xenomai/testsuite/<test>/ while
installing the binaries now also to $prefix/bin. This allows both the
invocation and cleanup via run scripts (i.e. xeno-load) and the simple
direct call of the tests if all required modules are already loaded.
Additionally, the patch also enables run script invocation without prior
cd to the containing directory.

Unless no objections arise, I would like to have this in upcoming 2.3
already (can make life of package builders easier).

Jan

[-- Attachment #1.2: reorder-installation.patch --]
[-- Type: text/plain, Size: 8259 bytes --]

Index: src/testsuite/latency/runinfo
===================================================================
--- src/testsuite/latency/runinfo	(Revision 1941)
+++ src/testsuite/latency/runinfo	(Arbeitskopie)
@@ -1 +1 @@
-latency:native+rtdm+timerbench:!./latency;popall:control_c
+latency:native+rtdm+timerbench:!latency;popall:control_c
Index: src/testsuite/latency/Makefile.am
===================================================================
--- src/testsuite/latency/Makefile.am	(Revision 1941)
+++ src/testsuite/latency/Makefile.am	(Arbeitskopie)
@@ -1,6 +1,6 @@
-testdir = $(exec_prefix)/testsuite/latency
+testdir = $(pkgdatadir)/testsuite/latency
 
-test_PROGRAMS = latency
+bin_PROGRAMS = latency
 
 latency_SOURCES = latency.c
 
@@ -18,7 +18,7 @@ latency_LDADD = \
 install-data-local:
 	$(mkinstalldirs) $(DESTDIR)$(testdir)
 	$(INSTALL_DATA) $(srcdir)/runinfo $(DESTDIR)$(testdir)/.runinfo
-	@echo "\$${DESTDIR}$(exec_prefix)/bin/xeno-load \$$*" > $(DESTDIR)$(testdir)/run
+	@echo "\$${DESTDIR}$(exec_prefix)/bin/xeno-load \`dirname \$$0\` \$$*" > $(DESTDIR)$(testdir)/run
 	@chmod +x $(DESTDIR)$(testdir)/run
 
 uninstall-local:
Index: src/testsuite/switchbench/runinfo
===================================================================
--- src/testsuite/switchbench/runinfo	(Revision 1941)
+++ src/testsuite/switchbench/runinfo	(Arbeitskopie)
@@ -1 +1 @@
-switchbench:native:!./switchbench;popall:control_c
+switchbench:native:!switchbench;popall:control_c
Index: src/testsuite/switchbench/Makefile.am
===================================================================
--- src/testsuite/switchbench/Makefile.am	(Revision 1941)
+++ src/testsuite/switchbench/Makefile.am	(Arbeitskopie)
@@ -1,6 +1,6 @@
-testdir = $(exec_prefix)/testsuite/switchbench
+testdir = $(pkgdatadir)/testsuite/switchbench
 
-test_PROGRAMS = switchbench
+bin_PROGRAMS = switchbench
 
 switchbench_SOURCES = switchbench.c
 
@@ -17,7 +17,7 @@ switchbench_LDADD = \
 install-data-local:
 	$(mkinstalldirs) $(DESTDIR)$(testdir)
 	$(INSTALL_DATA) $(srcdir)/runinfo $(DESTDIR)$(testdir)/.runinfo
-	@echo "\$${DESTDIR}$(exec_prefix)/bin/xeno-load \$$*" > $(DESTDIR)$(testdir)/run
+	@echo "\$${DESTDIR}$(exec_prefix)/bin/xeno-load \`dirname \$$0\` \$$*" > $(DESTDIR)$(testdir)/run
 	@chmod +x $(DESTDIR)$(testdir)/run
 
 uninstall-local:
Index: src/testsuite/switchtest/runinfo
===================================================================
--- src/testsuite/switchtest/runinfo	(Revision 1941)
+++ src/testsuite/switchtest/runinfo	(Arbeitskopie)
@@ -1 +1 @@
-switchtest:posix+rtdm+switchtest:!./switchtest;popall:control_c
+switchtest:posix+rtdm+switchtest:!switchtest;popall:control_c
Index: src/testsuite/switchtest/Makefile.am
===================================================================
--- src/testsuite/switchtest/Makefile.am	(Revision 1941)
+++ src/testsuite/switchtest/Makefile.am	(Arbeitskopie)
@@ -1,6 +1,6 @@
-testdir = $(exec_prefix)/testsuite/switchtest
+testdir = $(pkgdatadir)/testsuite/switchtest
 
-test_PROGRAMS = switchtest
+bin_PROGRAMS = switchtest
 
 switchtest_SOURCES = switchtest.c
 
@@ -14,7 +14,7 @@ switchtest_LDADD = \
 install-data-local:
 	$(mkinstalldirs) $(DESTDIR)$(testdir)
 	$(INSTALL_DATA) $(srcdir)/runinfo $(DESTDIR)$(testdir)/.runinfo
-	@echo "\$${DESTDIR}$(exec_prefix)/bin/xeno-load \$$*" > $(DESTDIR)$(testdir)/run
+	@echo "\$${DESTDIR}$(exec_prefix)/bin/xeno-load \`dirname \$$0\` \$$*" > $(DESTDIR)$(testdir)/run
 	@chmod +x $(DESTDIR)$(testdir)/run
 
 uninstall-local:
Index: src/testsuite/cyclic/runinfo
===================================================================
--- src/testsuite/cyclic/runinfo	(Revision 1941)
+++ src/testsuite/cyclic/runinfo	(Arbeitskopie)
@@ -1 +1 @@
-cyclictest:posix:!./cyclictest -p 99 -n;popall:control_c
+cyclictest:posix:!cyclictest -p 99 -n;popall:control_c
Index: src/testsuite/cyclic/Makefile.am
===================================================================
--- src/testsuite/cyclic/Makefile.am	(Revision 1941)
+++ src/testsuite/cyclic/Makefile.am	(Arbeitskopie)
@@ -1,6 +1,6 @@
-testdir = $(exec_prefix)/testsuite/cyclic
+testdir = $(pkgdatadir)/testsuite/cyclic
 
-test_PROGRAMS = cyclictest
+bin_PROGRAMS = cyclictest
 
 cyclictest_SOURCES = cyclictest.c
 
@@ -14,7 +14,7 @@ cyclictest_LDADD = \
 install-data-local:
 	$(mkinstalldirs) $(DESTDIR)$(testdir)
 	$(INSTALL_DATA) $(srcdir)/runinfo $(DESTDIR)$(testdir)/.runinfo
-	@echo "\$${DESTDIR}$(exec_prefix)/bin/xeno-load \$$*" > $(DESTDIR)$(testdir)/run
+	@echo "\$${DESTDIR}$(exec_prefix)/bin/xeno-load \`dirname \$$0\` \$$*" > $(DESTDIR)$(testdir)/run
 	@chmod +x $(DESTDIR)$(testdir)/run
 
 uninstall-local:
Index: src/testsuite/irqbench/runinfo
===================================================================
--- src/testsuite/irqbench/runinfo	(Revision 1941)
+++ src/testsuite/irqbench/runinfo	(Arbeitskopie)
@@ -1 +1 @@
-irqloop:posix+rtdm+irqbench:!./irqloop;popall:control_c
+irqloop:posix+rtdm+irqbench:!irqloop;popall:control_c
Index: src/testsuite/irqbench/Makefile.am
===================================================================
--- src/testsuite/irqbench/Makefile.am	(Revision 1941)
+++ src/testsuite/irqbench/Makefile.am	(Arbeitskopie)
@@ -1,9 +1,9 @@
-testdir = $(exec_prefix)/testsuite/irqbench
+testdir = $(pkgdatadir)/testsuite/irqbench
 
-test_PROGRAMS = irqloop
+bin_PROGRAMS = irqloop
 
 if XENO_TARGET_ARCH_I386
-test_PROGRAMS += irqbench
+bin_PROGRAMS += irqbench
 endif
 
 
@@ -34,7 +34,7 @@ irqbench_LDFLAGS = $(XENO_USER_LDFLAGS)
 install-data-local:
 	$(mkinstalldirs) $(DESTDIR)$(testdir)
 	$(INSTALL_DATA) $(srcdir)/runinfo $(DESTDIR)$(testdir)/.runinfo
-	@echo "\$${DESTDIR}$(exec_prefix)/bin/xeno-load \$$*" > $(DESTDIR)$(testdir)/run
+	@echo "\$${DESTDIR}$(exec_prefix)/bin/xeno-load \`dirname \$$0\` \$$*" > $(DESTDIR)$(testdir)/run
 	@chmod +x $(DESTDIR)$(testdir)/run
 
 uninstall-local:
Index: scripts/xeno-load.in
===================================================================
--- scripts/xeno-load.in	(Revision 1941)
+++ scripts/xeno-load.in	(Arbeitskopie)
@@ -236,9 +236,9 @@ while test -n "$target_info" ; do
 	set -- $e
 	test $verbose = 1 && echo "+ spawning command ($* $cmdargs)"
 	if test $waitflag = 1; then
-           $suflag $* $cmdargs
+           PATH=$PATH:$exec_prefix/bin $suflag $* $cmdargs
         else
-           $suflag $* $cmdargs &
+           PATH=$PATH:$exec_prefix/bin $suflag $* $cmdargs &
 	   children_pids="$! $children_pids"
 	fi
 	;;
Index: scripts/xeno-test.in
===================================================================
--- scripts/xeno-test.in	(Revision 1941)
+++ scripts/xeno-test.in	(Arbeitskopie)
@@ -4,6 +4,9 @@
 # If you want to test it this way, do: sh xeno-test
 # BusyBox >= 1.1.3 with a make defconfig should provide all needed applets.
 
+prefix="@prefix@"
+pkgdatadir="@datadir@domain.hid"
+
 myusage() {
     cat >&1 <<EOF
 xeno-test [options]
@@ -195,24 +198,24 @@ run_w_load() {
     loudly generate_loads $workload
     boxstatus
     (
-        cd `dirname $0`/../testsuite/latency
+        cd $pkgdatadir/testsuite/latency
 	loudly ./run -- $XENOT_LATENCY $opts -t0 '# latency'
 	loudly ./run -- $XENOT_LATENCY $opts -t1 '# latency'
 	loudly ./run -- $XENOT_LATENCY $opts -t2 '# latency'
     )
-    (	cd `dirname $0`/../testsuite/switchtest
+    (	cd $pkgdatadir/testsuite/switchtest
 	loudly ./run -- -T 120 $XENOT_SWITCHTEST '# switchtest'
     )
-    (	cd `dirname $0`/../testsuite/switchbench
+    (	cd $pkgdatadir/testsuite/switchbench
 	loudly ./run -- -h $XENOT_SWITCHBENCH '# switchbench'
     )
-    (	cd `dirname $0`/../testsuite/cyclic
+    (	cd $pkgdatadir/testsuite/cyclic
 	loudly ./run -- -p 10 -n -l 1000 $XENOT_CYCLIC '# cyclictest'
     )
 
     if [ "$XENOT_IRQBENCH" != "" ] ; then
 	(
-	    cd `dirname $0`/../testsuite/irqbench
+	    cd $pkgdatadir/testsuite/irqbench
 	    loudly ./run -- -P 10 $XENOT_IRQBENCH -t0 '# irqbench user'
 	    loudly ./run -- -P 10 $XENOT_IRQBENCH -t1 '# irqbench kernel'
 	    loudly ./run -- -P 10 $XENOT_IRQBENCH -t2 '# irqbench irq-handler'

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]

             reply	other threads:[~2006-12-10 10:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-10 10:21 Jan Kiszka [this message]
2006-12-10 19:22 ` [Xenomai-core] [PATCH] consolidate testsuite installation Philippe Gerum
2006-12-11  0:16   ` Jan Kiszka
2006-12-11  9:07     ` Philippe Gerum
2006-12-11  9:24       ` Jan Kiszka
2006-12-11 10:14         ` Philippe Gerum
2006-12-12  8:36         ` Gilles Chanteperdrix
2006-12-12 12:32           ` Jan Kiszka
2006-12-12 13:12             ` Gilles Chanteperdrix
2006-12-12 13:24               ` Jan Kiszka
2006-12-12 14:46                 ` Gilles Chanteperdrix
2006-12-13 16:58                   ` Jan Kiszka
2006-12-18  9:42                     ` Gilles Chanteperdrix
2006-12-18 12:30                       ` Jan Kiszka
2006-12-18 13:32                         ` Gilles Chanteperdrix
2006-12-18 14:27                           ` Jan Kiszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=457BDF99.1020405@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.