All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: rpm@xenomai.org
Cc: xenomai-core <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] [PATCH] consolidate testsuite installation
Date: Mon, 11 Dec 2006 01:16:44 +0100	[thread overview]
Message-ID: <457CA36C.5060805@domain.hid> (raw)
In-Reply-To: <1165778549.8255.17.camel@domain.hid>


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

Philippe Gerum wrote:
> On Sun, 2006-12-10 at 11:21 +0100, Jan Kiszka wrote:
>> 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.
> 
> Ack. Implementation-wise, we have to fix the following though:
> 
> xeno-load.in needs to be fixed, so that passing a single dot as argument
> correctly picks the default runinfo target in the current directory.
> This currently does not work as expected.

[obviously now fixed in svn]

> 
> The second patch works around a problem with sudo relying on the
> contents of the user's PATH variable. This won't work for people using a
> version of sudo compiled with the secure path option by their favourite
> distro. In that case, /usr/xenomai/bin (or whatever the user picked to
> install xenomai) won't appear in that secure path, so the binary program
> given in the runinfo file won't be found. A possible option is to
> provide a relative path to locate the binary program,
> e.g. ../../../../bin/latency for the latency test, as the example patch
> shows. Not pretty, but the other way would need to autoconfiscate the
> runinfo files, or at least run them through sed before installing, so
> that we could substitute some placeholder with $exec_prefix.

Relative paths are not fully safe, so here comes a full-blown approach
based on sed-on-install.

Jan

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

 scripts/xeno-test.in                  |   13 ++++++++-----
 src/testsuite/cyclic/Makefile.am      |    8 ++++----
 src/testsuite/cyclic/runinfo          |    1 -
 src/testsuite/cyclic/runinfo.in       |    2 +-
 src/testsuite/irqbench/Makefile.am    |   10 +++++-----
 src/testsuite/irqbench/runinfo        |    1 -
 src/testsuite/irqbench/runinfo.in     |    2 +-
 src/testsuite/latency/Makefile.am     |    8 ++++----
 src/testsuite/latency/runinfo         |    1 -
 src/testsuite/latency/runinfo.in      |    2 +-
 src/testsuite/switchbench/Makefile.am |    8 ++++----
 src/testsuite/switchbench/runinfo     |    1 -
 src/testsuite/switchbench/runinfo.in  |    2 +-
 src/testsuite/switchtest/Makefile.am  |    8 ++++----
 src/testsuite/switchtest/runinfo      |    1 -
 src/testsuite/switchtest/runinfo.in   |    2 +-
 16 files changed, 34 insertions(+), 36 deletions(-)
Index: src/testsuite/latency/runinfo
===================================================================
--- src/testsuite/latency/runinfo	(Revision 1947)
+++ src/testsuite/latency/runinfo	(Arbeitskopie)
@@ -1 +0,0 @@
-latency:native+rtdm+timerbench:!./latency;popall:control_c
Index: src/testsuite/latency/runinfo.in
===================================================================
--- src/testsuite/latency/runinfo.in	(Revision 1941)
+++ src/testsuite/latency/runinfo.in	(Arbeitskopie)
@@ -1 +1 @@
-latency:native+rtdm+timerbench:!./latency;popall:control_c
+latency:native+rtdm+timerbench:!@exec_prefix@domain.hid_c
Index: src/testsuite/latency/Makefile.am
===================================================================
--- src/testsuite/latency/Makefile.am	(Revision 1947)
+++ 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
 
@@ -17,8 +17,8 @@ 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
+	@sed -e's,@exec_prefix\@,$(exec_prefix),g' $(srcdir)/runinfo.in > $(DESTDIR)$(testdir)/.runinfo
+	@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 1947)
+++ src/testsuite/switchbench/runinfo	(Arbeitskopie)
@@ -1 +0,0 @@
-switchbench:native:!./switchbench;popall:control_c
Index: src/testsuite/switchbench/runinfo.in
===================================================================
--- src/testsuite/switchbench/runinfo.in	(Revision 1941)
+++ src/testsuite/switchbench/runinfo.in	(Arbeitskopie)
@@ -1 +1 @@
-switchbench:native:!./switchbench;popall:control_c
+switchbench:native:!@exec_prefix@domain.hid
Index: src/testsuite/switchbench/Makefile.am
===================================================================
--- src/testsuite/switchbench/Makefile.am	(Revision 1947)
+++ 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
 
@@ -16,8 +16,8 @@ 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
+	@sed -e's,@exec_prefix\@,$(exec_prefix),g' $(srcdir)/runinfo.in > $(DESTDIR)$(testdir)/.runinfo
+	@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 1947)
+++ src/testsuite/switchtest/runinfo	(Arbeitskopie)
@@ -1 +0,0 @@
-switchtest:posix+rtdm+switchtest:!./switchtest;popall:control_c
Index: src/testsuite/switchtest/runinfo.in
===================================================================
--- src/testsuite/switchtest/runinfo.in	(Revision 1941)
+++ src/testsuite/switchtest/runinfo.in	(Arbeitskopie)
@@ -1 +1 @@
-switchtest:posix+rtdm+switchtest:!./switchtest;popall:control_c
+switchtest:posix+rtdm+switchtest:!@exec_prefix@domain.hidntrol_c
Index: src/testsuite/switchtest/Makefile.am
===================================================================
--- src/testsuite/switchtest/Makefile.am	(Revision 1947)
+++ 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
 
@@ -13,8 +13,8 @@ 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
+	@sed -e's,@exec_prefix\@,$(exec_prefix),g' $(srcdir)/runinfo.in > $(DESTDIR)$(testdir)/.runinfo
+	@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 1947)
+++ src/testsuite/cyclic/runinfo	(Arbeitskopie)
@@ -1 +0,0 @@
-cyclictest:posix:!./cyclictest -p 99 -n;popall:control_c
Index: src/testsuite/cyclic/runinfo.in
===================================================================
--- src/testsuite/cyclic/runinfo.in	(Revision 1941)
+++ src/testsuite/cyclic/runinfo.in	(Arbeitskopie)
@@ -1 +1 @@
-cyclictest:posix:!./cyclictest -p 99 -n;popall:control_c
+cyclictest:posix:!@exec_prefix@domain.hid -p 99 -n;popall:control_c
Index: src/testsuite/cyclic/Makefile.am
===================================================================
--- src/testsuite/cyclic/Makefile.am	(Revision 1947)
+++ 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
 
@@ -13,8 +13,8 @@ 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
+	@sed -e's,@exec_prefix\@,$(exec_prefix),g' $(srcdir)/runinfo.in > $(DESTDIR)$(testdir)/.runinfo
+	@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 1947)
+++ src/testsuite/irqbench/runinfo	(Arbeitskopie)
@@ -1 +0,0 @@
-irqloop:posix+rtdm+irqbench:!./irqloop;popall:control_c
Index: src/testsuite/irqbench/runinfo.in
===================================================================
--- src/testsuite/irqbench/runinfo.in	(Revision 1941)
+++ src/testsuite/irqbench/runinfo.in	(Arbeitskopie)
@@ -1 +1 @@
-irqloop:posix+rtdm+irqbench:!./irqloop;popall:control_c
+irqloop:posix+rtdm+irqbench:!@exec_prefix@domain.hid
Index: src/testsuite/irqbench/Makefile.am
===================================================================
--- src/testsuite/irqbench/Makefile.am	(Revision 1947)
+++ 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
 
 
@@ -33,8 +33,8 @@ 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
+	@sed -e's,@exec_prefix\@,$(exec_prefix),g' $(srcdir)/runinfo.in > $(DESTDIR)$(testdir)/.runinfo
+	@echo "\$${DESTDIR}$(exec_prefix)/bin/xeno-load \`dirname \$$0\` \$$*" > $(DESTDIR)$(testdir)/run
 	@chmod +x $(DESTDIR)$(testdir)/run
 
 uninstall-local:
Index: scripts/xeno-test.in
===================================================================
--- scripts/xeno-test.in	(Revision 1947)
+++ 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-11  0:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-10 10:21 [Xenomai-core] [PATCH] consolidate testsuite installation Jan Kiszka
2006-12-10 19:22 ` Philippe Gerum
2006-12-11  0:16   ` Jan Kiszka [this message]
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=457CA36C.5060805@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=rpm@xenomai.org \
    --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.