Skip to contentSkip to conversation

openposix: Fix installation file layout

PATCH In review Joerg Vehlow 4 participants 16 messages Jul 27, 2022 – Aug 30, 2022

lore
Share & tools
lore
#0 lore raw

v2 cover openposix: Fix installation file layout

Hi,

Update to v1:
- Replaced deprecated AC_PROG_CC_C99
- Fixed whitespace
- Fixed help message for configure script of ltp
- Added a more verbose commit message to the last commit

Joerg

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#1 lore raw

PATCH v2 1/3 openposix: Fix existence test for local flag-files

From: Joerg Vehlow <[email protected]>

---
 testcases/open_posix_testsuite/scripts/generate-makefiles.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/open_posix_testsuite/scripts/generate-makefiles.sh +1 -1
index 5cfb8e38c..3234aa454 100755
@@ -136,7 +136,7 @@ EOF
 EOF
 
 		for var in CFLAGS LDFLAGS LDLIBS; do
-			if [ -f "${TOP_SRCDIR}/$var" ]; then
+			if [ -f "${prereq_cache_dir}/$var" ]; then
 				cat >> "$makefile.1" <<EOF
 ${var}+=		`cat "${prereq_cache_dir}/${var}" 2>/dev/null`
 EOF
Signature · 5 lines
2.25.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Reviewed-by on v2 1/3
#2 lore raw

Re: [LTP] [PATCH v2 1/3] openposix: Fix existence test for local flag-files

Obviously correct.

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#3 lore raw

Re: [LTP] [PATCH v2 1/3] openposix: Fix existence test for local flag-files

In reply to Joerg Vehlow

Hi Joerg,

merged this one.

I did some testing, but I'd like to look once more before acking the rest. Also hope others will have look into it.

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#4 lore raw

PATCH v2 2/3 openposix: Setup autoconf and fix installation layout

In reply to Joerg Vehlow

From: Joerg Vehlow <[email protected]>

This allows installation of the tests to a different directory than directly under $prefix.

Before the layout was:
$prefix/bin/{run-*,t0,run-tests.h,Makefile}
$prefix/conformance
$prefix/functional
$prefix/stress

with prefix being /opt/openposix_testsuite on linux and /usr/local/openposix_testsuite on other systems OR the value of the env-var $prefix.

With this change, the prefix defaults to /opt/openposix_testsuite and can be changed the usual way using configure (./configure ---prefix=foo) Additionally the path of the tests below $prefix can be changed, using configure --with-open-posix-testdir=<foo>. This allows clean installation as part of ltp:

$prefix/bin/{run-all-posix-option-group-tests.sh,run-posix-option-group-test.sh} $prefix/$testdir/bin/{run-tests.sh,t0}
$prefix/$testdir/conformance
$prefix/$testdir/functional
$prefix/$testdir/stress

Only the two directly callable shell scripts are kept under $prefix/bin, the two other executables are moved to testdir, because they are only used by the implementation of the test execution scripts (run.sh) $prefix/bin/Makefile is not installed anymore, because it is not required.

---
 testcases/open_posix_testsuite/.gitignore     |  5 ++
 testcases/open_posix_testsuite/CFLAGS         |  1 -
 .../Documentation/HOWTO_Release               |  4 +-
 .../Documentation/HOWTO_RunTests              |  1 +
 testcases/open_posix_testsuite/INSTALL        |  9 ----
 testcases/open_posix_testsuite/LDFLAGS        |  0
 testcases/open_posix_testsuite/LDLIBS         |  0
 testcases/open_posix_testsuite/Makefile       | 51 +++++++++++++------
 testcases/open_posix_testsuite/QUICK-START    |  6 +--
 testcases/open_posix_testsuite/bin/Makefile   | 30 ++++++++---
 .../bin/run-posix-option-group-test.sh        |  4 +-
 testcases/open_posix_testsuite/configure.ac   | 18 +++++++
 .../open_posix_testsuite/conformance/Makefile |  1 +
 .../conformance/behavior/Makefile             |  2 +
 .../conformance/definitions/Makefile          |  2 +
 .../conformance/interfaces/Makefile           |  2 +
 .../open_posix_testsuite/functional/Makefile  |  2 +
 .../include/mk/config.mk.in                   | 17 +++++++
 .../open_posix_testsuite/include/mk/env.mk    | 11 ++++
 .../scripts/generate-makefiles.sh             | 39 +++-----------
 .../scripts/print-prefix.sh                   | 10 ----
 .../open_posix_testsuite/stress/Makefile      |  2 +
 testcases/open_posix_testsuite/tools/Makefile |  9 ++--
 23 files changed, 139 insertions(+), 87 deletions(-)
 delete mode 100644 testcases/open_posix_testsuite/CFLAGS
 delete mode 100644 testcases/open_posix_testsuite/INSTALL
 delete mode 100644 testcases/open_posix_testsuite/LDFLAGS
 delete mode 100644 testcases/open_posix_testsuite/LDLIBS
 create mode 100644 testcases/open_posix_testsuite/configure.ac
 create mode 100644 testcases/open_posix_testsuite/include/mk/config.mk.in
 create mode 100644 testcases/open_posix_testsuite/include/mk/env.mk
 delete mode 100755 testcases/open_posix_testsuite/scripts/print-prefix.sh
testcases/open_posix_testsuite/.gitignore +5 -0
index a134c02a4..c9164df3a 100644
@@ -15,3 +15,8 @@
 run.sh
 
 logfile
+
+/configure
+/config.log
+/config.status
+include/mk/config.mk
testcases/open_posix_testsuite/CFLAGS deleted +0 -1
deleted file mode 100644
index 297d2929a..000000000
@@ -1 +0,0 @@
--std=c99 -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -W -Wall
testcases/open_posix_testsuite/Documentation/HOWTO_Release +2 -2
index a6970c871..3332cae00 100644
@@ -20,8 +20,8 @@ released files.
 4.  Download the *.tar.gz file from the SF interface and untar it in
     a sandbox.
 
-5.  Run "make" to try to build and execute all files in the release, and
-    ensure that they all build and execute correctly.
+5.  Run "./configure && make" to try to build and execute all files
+    in the release, and ensure that they all build and execute correctly.
 
 6.  Craft a release message and send to:  posixtest-announce.
 
testcases/open_posix_testsuite/Documentation/HOWTO_RunTests +1 -0
index 0231838e2..c443f9e3e 100644
@@ -45,6 +45,7 @@ To build and run the tests, you should be in the main posix test suite
 directory.
 
 From there, execute:
+    # ./configure
     # make all
 
 This will build all of the conformance, functional, and stress tests.
testcases/open_posix_testsuite/INSTALL deleted +0 -9
deleted file mode 100644
index 9e3d3cd0a..000000000
@@ -1,9 +0,0 @@
-
-This package does not install yet ... it is intended to be run
-directly.
-
-See BUILD for information on how to configure your system to build
-all tests.
-
-See Documentation/HOWTO_RunTests for information on how to run all tests.
-
testcases/open_posix_testsuite/LDFLAGS deleted +0 -0
deleted file mode 100644
index e69de29bb..000000000
testcases/open_posix_testsuite/LDLIBS deleted +0 -0
deleted file mode 100644
index e69de29bb..000000000
testcases/open_posix_testsuite/Makefile +35 -16

113 lines not on this page · raw message

testcases/open_posix_testsuite/QUICK-START +2 -4
index 6f5d881b4..28b5ccc9a 100644
@@ -10,8 +10,6 @@ No worries! Here's a quick doc to help you around POSIX** Test Suite.
 Setting up your machine
 ========================
 
-* There is nothing to install, the suite is intended to be run directly.
-
 * See the "BUILD" file for info on how to set up the Makefile and your machine,
   depending on what specific area you are concentrating on.
 (Signals, Semaphores, Threads, Timers or Message Queues).
@@ -20,8 +18,8 @@ Setting up your machine
 Running the tests
 ===================
 
-* Easiest way to run all the tests is to do a "make all" in the top-level
-  directory.
+* Easiest way to run all the tests is to do a "./configure && make all"
+  in the top-level directory.
 
 * To run tests for a specific directory, do the following
   - make generate-makefiles # only required for the first shot.
testcases/open_posix_testsuite/bin/Makefile +22 -8
index d9fd13800..262a6567c 100644
@@ -4,18 +4,32 @@
 # Ngie Cooper, July 2010
 #
 
-top_srcdir?=		..
+top_srcdir ?= ..
 
-srcdir=			$(top_srcdir)/bin
+include $(top_srcdir)/include/mk/config.mk
 
-prefix?=		`$(top_srcdir)/scripts/print-prefix.sh`
-
-bindir?=		$(prefix)/bin
+INSTALL_BIN_TARGETS = run-all-posix-option-group-tests.sh run-posix-option-group-test.sh
+INSTALL_TESTCASE_BIN_TARGETS = run-tests.sh t0
 
+.PHONY: clean
 clean:
 	@rm -f t0.val
 
-install: clean
-	@set -e; for i in `ls *`; do \
-	    install -m 0755 $$i $(DESTDIR)/$(bindir)/. ;\
+.PHONY: install
+install: clean $(DESTDIR)/$(bindir) $(DESTDIR)/$(testdir_bin)
+	set -e; for file in $(INSTALL_BIN_TARGETS); do           \
+		install -m 00755 $$file $(DESTDIR)/$(bindir)/$$file; \
+	done
+
+	sed -i 's~TESTPATH=""~TESTPATH="$(testdir_rel)"~' $(DESTDIR)/$(bindir)/run-posix-option-group-test.sh
+
+	set -e; for file in $(INSTALL_TESTCASE_BIN_TARGETS); do	      \
+		install -m 00755 $$file $(DESTDIR)/$(testdir_bin)/$$file; \
 	done
+
+
+$(DESTDIR)/$(bindir):
+	mkdir -p $@
+
+$(DESTDIR)/$(testdir_bin):
+	mkdir -p $@
testcases/open_posix_testsuite/bin/run-posix-option-group-test.sh +3 -1
index 1bbdddfd5..e90c252a3 100755
@@ -8,7 +8,9 @@
 #
 # Use to build and run tests for a specific area
 
-BASEDIR="$(dirname "$0")/../conformance/interfaces"
+TESTPATH=""
+
+BASEDIR="$(dirname "$0")/../${TESTPATH}/conformance/interfaces"
 
 usage()
 {
testcases/open_posix_testsuite/configure.ac new file +18 -0
new file mode 100644
index 000000000..efa0393f1
@@ -0,0 +1,18 @@
+AC_PREREQ(2.61)
+AC_INIT([open_posix_testsuite], [LTP_VERSION], [[email protected]])
+AC_CONFIG_FILES([ \
+    include/mk/config.mk \
+])
+
+AC_PROG_CC
+
+AC_PREFIX_DEFAULT(/opt/openposix_testsuite)
+
+AC_ARG_WITH([open-posix-testdir],
+    [AS_HELP_STRING([--with-open-posix-testdir=DIR], [Relative path from $prefix to testdir])],
+    [testdir=$withval],
+    [testdir=]
+)
+AC_SUBST([testdir], [$testdir])
+
+AC_OUTPUT
testcases/open_posix_testsuite/conformance/Makefile +1 -0
index 11e8a840f..756d25252 100644
@@ -1,6 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0-or-later
 # Ngie Cooper, June 2010
 
+.PHONY: all clean distclean-makefiles install test
 all clean distclean-makefiles install test:
 	@for dir in `ls -d */Makefile 2>/dev/null | sed -e 's,/Makefile$$,,g'`; do \
 		$(MAKE) -C $$dir $@;						   \
testcases/open_posix_testsuite/conformance/behavior/Makefile +2 -0
index b09527fd3..f68140524 100644
@@ -4,10 +4,12 @@
 # Ngie Cooper, June 2010
 #
 
+.PHONY: all clean install test
 all clean install test:
 	@for dir in `ls -d */Makefile 2>/dev/null | sed -e 's,/Makefile$$,,g'`; do \
 		$(MAKE) -C $$dir $@;						  \
 	done
 
+.PHONY: distclean-makefiles
 distclean-makefiles:
 	@find */ -name 'Makefile*' | xargs rm -f
testcases/open_posix_testsuite/conformance/definitions/Makefile +2 -0
index b09527fd3..f68140524 100644
@@ -4,10 +4,12 @@
 # Ngie Cooper, June 2010
 #
 
+.PHONY: all clean install test
 all clean install test:
 	@for dir in `ls -d */Makefile 2>/dev/null | sed -e 's,/Makefile$$,,g'`; do \
 		$(MAKE) -C $$dir $@;						  \
 	done
 
+.PHONY: distclean-makefiles
 distclean-makefiles:
 	@find */ -name 'Makefile*' | xargs rm -f
testcases/open_posix_testsuite/conformance/interfaces/Makefile +2 -0
index 2eb2bd40b..3525da062 100644
@@ -1,10 +1,12 @@
 # SPDX-License-Identifier: GPL-2.0-or-later
 # Ngie Cooper, June 2010
 
+.PHONY: all clean install test
 all clean install test:
 	@for dir in `ls -d */Makefile 2>/dev/null | sed -e 's,/Makefile$$,,g'`; do \
 		$(MAKE) -C $$dir $@;						  \
 	done
 
+.PHONY: distclean-makefiles
 distclean-makefiles:
 	@find */ -name 'Makefile*' | xargs rm -f
testcases/open_posix_testsuite/functional/Makefile +2 -0
index 3b22c89af..4af1790fe 100644
@@ -4,10 +4,12 @@
 # Ngie Cooper, June 2010
 #
 
+.PHONY: all clean install test
 all clean install test:
 	@for dir in `ls -d */Makefile 2>/dev/null | sed -e 's,/Makefile$$,,g'`; do \
 		$(MAKE) -C $$dir $@;						   \
 	done
 
+.PHONY: distclean-makefiles
 distclean-makefiles:
 	@find */ -name 'Makefile*' | grep -v threads/Makefile | grep -v timers/Makefile | xargs rm -f
testcases/open_posix_testsuite/include/mk/config.mk.in new file +17 -0
new file mode 100644
index 000000000..c9a4b5c5a
@@ -0,0 +1,17 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2022 Joerg Vehlow <[email protected]>
+
+CC      =  @CC@
+CFLAGS  += @CFLAGS@
+LDLIBS  += @LIBS@
+LDFLAGS += @LDFLAGS@
+
+prefix      := @prefix@
+exec_prefix := @exec_prefix@
+bindir      := ${exec_prefix}/bin
+
+testdir_rel := @testdir@
+testdir     := ${prefix}/${testdir_rel}
+testdir_bin := ${testdir}/bin
+
+CFLAGS  += -std=c99 -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -W -Wall
testcases/open_posix_testsuite/include/mk/env.mk new file +11 -0
new file mode 100644
index 000000000..0cd485f69
@@ -0,0 +1,11 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2022 Joerg Vehlow <[email protected]>
+
+abs_top_builddir		:= $(abspath $(top_srcdir))
+
+# autotools, *clean, don't require config.mk
+ifeq ($(filter autotools %clean,$(MAKECMDGOALS)),)
+include $(abs_top_builddir)/include/mk/config.mk
+else
+-include $(abs_top_builddir)/include/mk/config.mk
+endif
testcases/open_posix_testsuite/scripts/generate-makefiles.sh +7 -32
index 3234aa454..0649c480f 100755
@@ -111,9 +111,9 @@ top_srcdir?=		`echo "$prereq_dir" | awk '{ gsub(/[^\/]+/, "..", $0); print }'`
 subdir=			$prereq_cache_dir
 srcdir=			\$(top_srcdir)/\$(subdir)
 
-prefix?=		$PREFIX
-exec_prefix?=		\$(prefix)
-INSTALL_DIR=		\$(DESTDIR)/\$(exec_prefix)/\$(subdir)
+include \$(top_srcdir)/include/mk/env.mk
+
+INSTALL_DIR=		\$(DESTDIR)/\$(testdir)/\$(subdir)
 LOGFILE?=		logfile
 
 # Build variables
@@ -124,13 +124,6 @@ CFLAGS+=		-I\$(srcdir)
 
 EOF
 
-		if [ -f "$GLOBAL_BOILERPLATE" ]; then
-			cat >> "$makefile.1" <<EOF
-# Top-level make definitions
-`cat $GLOBAL_BOILERPLATE`
-EOF
-		fi
-
 		cat >> "$makefile.1" <<EOF
 # Submake make definitions.
 EOF
@@ -169,13 +162,16 @@ EOF
 	if [ ! -f "$makefile.3" ]; then
 
 		cat > "$makefile.3" <<EOF
+.PHONY: all
 all: \$(MAKE_TARGETS)
 	@if [ -d speculative ]; then \$(MAKE) -C speculative all; fi
 
+.PHONY: clean
 clean:
 	rm -f \$(MAKE_TARGETS) logfile* run.sh *.core
 	@if [ -d speculative ]; then \$(MAKE) -C speculative clean; fi
 
+.PHONY: install
 install: \$(INSTALL_DIR) run.sh
 	set -e; for file in \$(INSTALL_TARGETS) run.sh; do	\\
 		if [ -f "\$\$file" ] ; then			\\
@@ -185,6 +181,7 @@ install: \$(INSTALL_DIR) run.sh
 	done
 	@if [ -d speculative ]; then \$(MAKE) -C speculative install; fi
 
+.PHONY: test
 test: run.sh
 	\$(v)./run.sh
 
@@ -308,35 +305,13 @@ generate_makefiles() {
 export PATH="$PATH:`dirname "$0"`"
 
 AUTHORDATE=`grep "Ngie Cooper" "$0" | head -n 1 | sed 's,# *,,'`
-PREFIX=`print-prefix.sh`
-EXEC_PREFIX="${PREFIX}/bin"
 TOP_SRCDIR=${TOP_SRCDIR:=`dirname "$0"`/..}
 
-GLOBAL_BOILERPLATE="${TOP_SRCDIR}/.global_boilerplate"
-
-CONFIG_MK="../../include/mk/config-openposix.mk"
-
-rm -f "$GLOBAL_BOILERPLATE"
-
-for var in CFLAGS LDFLAGS LDLIBS; do
-	if [ -f "$TOP_SRCDIR/$var" ]; then
-		cat >> "$GLOBAL_BOILERPLATE" <<EOF
-$var+=		`cat "$TOP_SRCDIR/$var"`
-EOF
-	fi
-done
-
-if [ -f "$CONFIG_MK" ]; then
-	cat "$CONFIG_MK" >> "$GLOBAL_BOILERPLATE"
-fi
-
 # For the generic cases.
 generate_locate_test_makefile buildonly '.test' "$buildonly_compiler_args"
 generate_locate_test_makefile runnable '.run-test'
 generate_locate_test_makefile test-tools ''
 
-rm -f "$GLOBAL_BOILERPLATE"
-
 find . -name Makefile.1 -exec dirname {} \; | while read dir; do
 	if [ -f "$dir/Makefile.2" ]; then
 		cat $dir/Makefile.1 $dir/Makefile.2 $dir/Makefile.3 > $dir/Makefile
testcases/open_posix_testsuite/scripts/print-prefix.sh deleted +0 -10
deleted file mode 100755
index 795097f60..000000000
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-if uname -a | grep -iq linux
-then
-	DEFAULT_PREFIX=/opt
-else
-	DEFAULT_PREFIX=/usr/local
-fi
-
-echo ${prefix:=$DEFAULT_PREFIX/openposix_testsuite}
testcases/open_posix_testsuite/stress/Makefile +2 -0
index b09527fd3..f68140524 100644
@@ -4,10 +4,12 @@
 # Ngie Cooper, June 2010
 #
 
+.PHONY: all clean install test
 all clean install test:
 	@for dir in `ls -d */Makefile 2>/dev/null | sed -e 's,/Makefile$$,,g'`; do \
 		$(MAKE) -C $$dir $@;						  \
 	done
 
+.PHONY: distclean-makefiles
 distclean-makefiles:
 	@find */ -name 'Makefile*' | xargs rm -f
testcases/open_posix_testsuite/tools/Makefile +5 -4
index a6f0917a9..6d2f08a00 100644
@@ -4,14 +4,15 @@
 # Ngie Cooper, June 2010
 #
 
--include ../../../include/mk/config-openposix.mk
+top_srcdir ?= ..
+srcdir     =  $(top_srcdir)/tools
 
-top_srcdir?=	..
-
-srcdir=		$(top_srcdir)/tools
+include ../include/mk/env.mk
 
+.PHONY: all
 all: ../bin/t0
 
+.PHONY: clean
 clean:
 	@rm -f ../bin/t0
 
Signature · 5 lines
2.25.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Reviewed-by on v2 2/3
#5 lore raw

Re: [LTP] [PATCH v2 2/3] openposix: Setup autoconf and fix installation layout

Hi Joerg,

[ Cc Li ]

Quoted 25 lines

This allows installation of the tests to a different directory than directly under $prefix.

Before the layout was:
$prefix/bin/{run-*,t0,run-tests.h,Makefile}
$prefix/conformance
$prefix/functional
$prefix/stress

with prefix being /opt/openposix_testsuite on linux and /usr/local/openposix_testsuite on other systems OR the value of the env-var $prefix.

With this change, the prefix defaults to /opt/openposix_testsuite and can be changed the usual way using configure (./configure ---prefix=foo) Additionally the path of the tests below $prefix can be changed, using configure --with-open-posix-testdir=<foo>. This allows clean installation as part of ltp:

$prefix/bin/{run-all-posix-option-group-tests.sh,run-posix-option-group-test.sh} $prefix/$testdir/bin/{run-tests.sh,t0}
$prefix/$testdir/conformance
$prefix/$testdir/functional
$prefix/$testdir/stress

Quoted 4 lines

Only the two directly callable shell scripts are kept under $prefix/bin, the two other executables are moved to testdir, because they are only used by the implementation of the test execution scripts (run.sh) $prefix/bin/Makefile is not installed anymore, because it is not required.

It took me a while to do a bit of testing.
Whole improvements LGTM.

...

Quoted 21 lines

+++ b/testcases/open_posix_testsuite/bin/Makefile

testcases/open_posix_testsuite/bin/Makefile +5 -5
@@ -4,18 +4,32 @@
 # Ngie Cooper, July 2010
 
 
-top_srcdir?=		..
+top_srcdir ?= ..
 
-srcdir=			$(top_srcdir)/bin
+include $(top_srcdir)/include/mk/config.mk
 
-prefix?=		`$(top_srcdir)/scripts/print-prefix.sh`
-
-bindir?=		$(prefix)/bin
+INSTALL_BIN_TARGETS = run-all-posix-option-group-tests.sh run-posix-option-group-test.sh
+INSTALL_TESTCASE_BIN_TARGETS = run-tests.sh t0
 
+.PHONY: clean
 clean:
 	@rm -f t0.val
 

testcases/open_posix_testsuite/bin/Makefile line 24

Quoted 10 lines
testcases/open_posix_testsuite/bin/Makefile +7 -3
-install: clean
-	@set -e; for i in `ls *`; do \
-	    install -m 0755 $$i $(DESTDIR)/$(bindir)/. ;\
+.PHONY: install
+install: clean $(DESTDIR)/$(bindir) $(DESTDIR)/$(testdir_bin)
+	set -e; for file in $(INSTALL_BIN_TARGETS); do           \
+		install -m 00755 $$file $(DESTDIR)/$(bindir)/$$file; \
+	done
+
+	sed -i 's~TESTPATH=""~TESTPATH="$(testdir_rel)"~' $(DESTDIR)/$(bindir)/run-posix-option-group-test.sh

nit: TESTPATH="" below could be just TESTPATH=. Obviously sed here would need to be adjusted.

Quoted 16 lines
testcases/open_posix_testsuite/bin/Makefile +10 -0
+
+	set -e; for file in $(INSTALL_TESTCASE_BIN_TARGETS); do	      \
+		install -m 00755 $$file $(DESTDIR)/$(testdir_bin)/$$file; \
 	done
+
+
+$(DESTDIR)/$(bindir):
+	mkdir -p $@
+
+$(DESTDIR)/$(testdir_bin):
+	mkdir -p $@
testcases/open_posix_testsuite/bin/run-posix-option-group-test.sh +0 -0
index 1bbdddfd5..e90c252a3 100755

testcases/open_posix_testsuite/bin/run-posix-option-group-test.sh line 13

Quoted 7 lines
testcases/open_posix_testsuite/bin/run-posix-option-group-test.sh +3 -1
@@ -8,7 +8,9 @@
 
 # Use to build and run tests for a specific area
 
-BASEDIR="$(dirname "$0")/../conformance/interfaces"
+TESTPATH=""
+
+BASEDIR="$(dirname "$0")/../${TESTPATH}/conformance/interfaces"

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#7 lore raw

PATCH v2 3/3 configure: Integrate open posix testsuite configure

In reply to Joerg Vehlow

From: Joerg Vehlow <[email protected]>

This changes the default installation location
of the open posix testsuite from
$prefix
to
$prefix/testcases/open_posix_testsuite

Scripts for execution of the testsuite (run-all-posix-option-group-tests.sh, run-posix-option-group-test.sh) will still be installed under $prefix/bin.

To revert back to the old installation behavior, just use ./configure -with-open-posix-testdir=.

---
 configure.ac           | 11 +++++++++++
 include/mk/automake.mk |  7 ++++++-
 2 files changed, 17 insertions(+), 1 deletion(-)
configure.ac +11 -0
index 69b145b5f..4256b3113 100644
@@ -334,8 +334,19 @@ AC_ARG_WITH([open-posix-testsuite],
   [with_open_posix_testsuite=$withval],
   [with_open_posix_testsuite=no]
 )
+
+# Allow setting the directoy, where the open posix testsuite is installed to.
+# If nothing is defined, we have to pass our default value to submake
+AC_ARG_WITH([open-posix-testdir],
+  [AS_HELP_STRING([--with-open-posix-testdir=<dir>],
+    [set the directory, where the open posix testsuite will be installed under prefix])],
+  [],
+  [ac_configure_args="$ac_configure_args --with-open-posix-testdir=testcases/open_posix_testsuite"]
+)
+
 if test "x$with_open_posix_testsuite" = xyes; then
     AC_SUBST([WITH_OPEN_POSIX_TESTSUITE],["yes"])
+    AC_CONFIG_SUBDIRS([testcases/open_posix_testsuite])
 else
     AC_SUBST([WITH_OPEN_POSIX_TESTSUITE],["no"])
 fi
include/mk/automake.mk +6 -1
index 219d015d0..ee3b7f1b8 100644
@@ -27,7 +27,8 @@ AUTOHEADER	?= autoheader
 AUTOMAKE	?= automake
 
 AUTOCONFED_SUBDIRS	= \
-			testcases/realtime
+			testcases/realtime \
+			testcases/open_posix_testsuite
 
 # We want to run this every single time to ensure that all of the prereq files
 # are there.
@@ -35,6 +36,10 @@ AUTOCONFED_SUBDIRS	= \
 testcases/realtime/configure:
 	$(MAKE) -C $(@D) autotools
 
+.PHONY: testcases/open_posix_testsuite/configure
+testcases/open_posix_testsuite/configure:
+	$(MAKE) -C $(@D) autotools
+
 .PHONY: autotools
 autotools: aclocal autoconf autoheader automake $(addsuffix /configure,$(AUTOCONFED_SUBDIRS))
 
Signature · 5 lines
2.25.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#8 lore raw

Re: [LTP] [PATCH v2 3/3] configure: Integrate open posix testsuite configure

Hi Joerg,

[ Cc [email protected] ]

Quoted 7 lines

From: Joerg Vehlow <[email protected]>

This changes the default installation location
of the open posix testsuite from
$prefix
to
$prefix/testcases/open_posix_testsuite

I need to have a deeper look on this patchset next week.
But it looks to me strange, that running LTP top level configure causes installation into /opt/ltp/testcases/open_posix_testsuite/, but after running ./configure in testcases/open_posix_testsuite make install goes by default to /opt/openposix_testsuite.

Also openposix does not use LTP API, when we're touching it, wouldn't it make more sense to put it into separate git repository? IMHO that would cause work for other people (clone separate git, need to fix CI and tools which are using it), but openposix embedded in LTP always looked strange to me.

Kind regards,
Petr

Quoted 60 lines

Scripts for execution of the testsuite (run-all-posix-option-group-tests.sh, run-posix-option-group-test.sh) will still be installed under $prefix/bin.

To revert back to the old installation behavior, just use ./configure -with-open-posix-testdir=.

---
 configure.ac           | 11 +++++++++++
 include/mk/automake.mk |  7 ++++++-
 2 files changed, 17 insertions(+), 1 deletion(-)
configure.ac +11 -0
index 69b145b5f..4256b3113 100644
@@ -334,8 +334,19 @@ AC_ARG_WITH([open-posix-testsuite],
   [with_open_posix_testsuite=$withval],
   [with_open_posix_testsuite=no]
 )
+
+# Allow setting the directoy, where the open posix testsuite is installed to.
+# If nothing is defined, we have to pass our default value to submake
+AC_ARG_WITH([open-posix-testdir],
+  [AS_HELP_STRING([--with-open-posix-testdir=<dir>],
+    [set the directory, where the open posix testsuite will be installed under prefix])],
+  [],
+  [ac_configure_args="$ac_configure_args --with-open-posix-testdir=testcases/open_posix_testsuite"]
+)
+
 if test "x$with_open_posix_testsuite" = xyes; then
     AC_SUBST([WITH_OPEN_POSIX_TESTSUITE],["yes"])
+    AC_CONFIG_SUBDIRS([testcases/open_posix_testsuite])
 else
     AC_SUBST([WITH_OPEN_POSIX_TESTSUITE],["no"])
 fi
include/mk/automake.mk +6 -1
index 219d015d0..ee3b7f1b8 100644
@@ -27,7 +27,8 @@ AUTOHEADER	?= autoheader
 AUTOMAKE	?= automake
 
 AUTOCONFED_SUBDIRS	= \
-			testcases/realtime
+			testcases/realtime \
+			testcases/open_posix_testsuite
 
 # We want to run this every single time to ensure that all of the prereq files
 # are there.
@@ -35,6 +36,10 @@ AUTOCONFED_SUBDIRS	= \
 testcases/realtime/configure:
 	$(MAKE) -C $(@D) autotools
 
+.PHONY: testcases/open_posix_testsuite/configure
+testcases/open_posix_testsuite/configure:
+	$(MAKE) -C $(@D) autotools
+
 .PHONY: autotools
 autotools: aclocal autoconf autoheader automake $(addsuffix /configure,$(AUTOCONFED_SUBDIRS))
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#9 lore raw

Re: [LTP] [PATCH v2 3/3] configure: Integrate open posix testsuite configure

Hello,

Quoted 17 lines · Petr Vorel

Hi Joerg,

[ Cc [email protected] ]

Quoted 7 lines

From: Joerg Vehlow <[email protected]>

This changes the default installation location
of the open posix testsuite from
$prefix
to
$prefix/testcases/open_posix_testsuite

I need to have a deeper look on this patchset next week.
But it looks to me strange, that running LTP top level configure causes installation into /opt/ltp/testcases/open_posix_testsuite/, but after running ./configure in testcases/open_posix_testsuite make install goes by default to /opt/openposix_testsuite.

Quoted 4 lines

Also openposix does not use LTP API, when we're touching it, wouldn't it make more sense to put it into separate git repository? IMHO that would cause work for other people (clone separate git, need to fix CI and tools which are using it), but openposix embedded in LTP always looked strange to me.

I wouldn't be against this based on my anecdotal experience.

I don't recall a specific time these tests found a kernel bug. They sometimes find issues with glibc, but there is usually a debate as to how to interpret the spec instead of a clear error on glibc's part. Most often the test is broken.

So I'd say these tests are almost useless for kernel testing. I also think they often misinterpret the POSIX spec or have some basic logic error.

Signature · 5 lines
Thank you,
Richard.

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Reviewed-by
#10 lore raw

Re: [LTP] [PATCH v2 3/3] configure: Integrate open posix testsuite configure

Hi All,

Quoted 33 lines · Richard Palethorpe

Hello,

Quoted 6 lines · Petr Vorel

Hi Joerg,

[ Cc [email protected] ]

Quoted 1 line

From: Joerg Vehlow <[email protected]>

Quoted 8 lines
Quoted 5 lines

This changes the default installation location
of the open posix testsuite from
$prefix
to
$prefix/testcases/open_posix_testsuite

I need to have a deeper look on this patchset next week.
But it looks to me strange, that running LTP top level configure causes installation into /opt/ltp/testcases/open_posix_testsuite/, but after

running

Quoted 1 line

./configure in testcases/open_posix_testsuite make install goes by

default to

Quoted 3 lines

/opt/openposix_testsuite.

Also openposix does not use LTP API, when we're touching it, wouldn't it

make

Quoted 1 line

more sense to put it into separate git repository? IMHO that would cause

work

Quoted 1 line

for other people (clone separate git, need to fix CI and tools which are

using

Quoted 1 line

it), but openposix embedded in LTP always looked strange to me.

I wouldn't be against this based on my anecdotal experience.

Quoted 9 lines

I don't recall a specific time these tests found a kernel bug. They sometimes find issues with glibc, but there is usually a debate as to how to interpret the spec instead of a clear error on glibc's part. Most often the test is broken.

So I'd say these tests are almost useless for kernel testing. I also think they often misinterpret the POSIX spec or have some basic logic error.

I think so! And I don't against this patchset as well.

@Petr Vorel <[email protected]> feel free to merge the patches, it might usefully to
someone who has a strong willingness on running them.

Signature · 2 lines
Regards,
Li Wang
Signature · 2 lines
-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#11 lore raw

Re: [LTP] [PATCH v2 3/3] configure: Integrate open posix testsuite configure

In reply to Petr Vorel

Hi Petr,

Am 7/29/2022 um 7:23 PM schrieb Petr Vorel:

Quoted 11 lines

Hi Joerg,

[ Cc [email protected] ]

Quoted 7 lines

From: Joerg Vehlow <[email protected]>

This changes the default installation location
of the open posix testsuite from
$prefix
to
$prefix/testcases/open_posix_testsuite

Quoted 5 lines

I need to have a deeper look on this patchset next week.
But it looks to me strange, that running LTP top level configure causes installation into /opt/ltp/testcases/open_posix_testsuite/, but after running ./configure in testcases/open_posix_testsuite make install goes by default to /opt/openposix_testsuite.

That is just keeping the old behavior and makes total sense imho. If it is installed standalone, it makes sense to not install it into ltp's prefix. If you install the realtime testsuite standalone, it will be installed under default prefix (/usr or /usr/local), so also different prefix depending on if it is installed as part of ltp or standalone.

Quoted 4 lines

Also openposix does not use LTP API, when we're touching it, wouldn't it make more sense to put it into separate git repository? IMHO that would cause work for other people (clone separate git, need to fix CI and tools which are using it), but openposix embedded in LTP always looked strange to me.

That is something else to discuss and I don't have a strong opinion about it.

Quoted 4 lines

Kind regards,
Petr

Joerg

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Reviewed-by on v2 3/3
#12 lore raw

Re: [LTP] [PATCH v2 3/3] configure: Integrate open posix testsuite configure

In reply to Joerg Vehlow

Hi Joerg, all,

[ Cc: [email protected] ] Please have look at open posix testsuite patchset:
https://patchwork.ozlabs.org/project/ltp/list/?series=311446&state=*
https://lore.kernel.org/ltp/[email protected]/

First commit has been merged and I plan to merge the other two sometimes this week.

Kind regards,
Petr

Quoted 68 lines

From: Joerg Vehlow <[email protected]>

This changes the default installation location
of the open posix testsuite from
$prefix
to
$prefix/testcases/open_posix_testsuite

Scripts for execution of the testsuite (run-all-posix-option-group-tests.sh, run-posix-option-group-test.sh) will still be installed under $prefix/bin.

To revert back to the old installation behavior, just use ./configure -with-open-posix-testdir=.

---
 configure.ac           | 11 +++++++++++
 include/mk/automake.mk |  7 ++++++-
 2 files changed, 17 insertions(+), 1 deletion(-)
configure.ac +11 -0
index 69b145b5f..4256b3113 100644
@@ -334,8 +334,19 @@ AC_ARG_WITH([open-posix-testsuite],
   [with_open_posix_testsuite=$withval],
   [with_open_posix_testsuite=no]
 )
+
+# Allow setting the directoy, where the open posix testsuite is installed to.
+# If nothing is defined, we have to pass our default value to submake
+AC_ARG_WITH([open-posix-testdir],
+  [AS_HELP_STRING([--with-open-posix-testdir=<dir>],
+    [set the directory, where the open posix testsuite will be installed under prefix])],
+  [],
+  [ac_configure_args="$ac_configure_args --with-open-posix-testdir=testcases/open_posix_testsuite"]
+)
+
 if test "x$with_open_posix_testsuite" = xyes; then
     AC_SUBST([WITH_OPEN_POSIX_TESTSUITE],["yes"])
+    AC_CONFIG_SUBDIRS([testcases/open_posix_testsuite])
 else
     AC_SUBST([WITH_OPEN_POSIX_TESTSUITE],["no"])
 fi
include/mk/automake.mk +6 -1
index 219d015d0..ee3b7f1b8 100644
@@ -27,7 +27,8 @@ AUTOHEADER	?= autoheader
 AUTOMAKE	?= automake
 
 AUTOCONFED_SUBDIRS	= \
-			testcases/realtime
+			testcases/realtime \
+			testcases/open_posix_testsuite
 
 # We want to run this every single time to ensure that all of the prereq files
 # are there.
@@ -35,6 +36,10 @@ AUTOCONFED_SUBDIRS	= \
 testcases/realtime/configure:
 	$(MAKE) -C $(@D) autotools
 
+.PHONY: testcases/open_posix_testsuite/configure
+testcases/open_posix_testsuite/configure:
+	$(MAKE) -C $(@D) autotools
+
 .PHONY: autotools
 autotools: aclocal autoconf autoheader automake $(addsuffix /configure,$(AUTOCONFED_SUBDIRS))
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#14 lore raw

Re: [LTP] [PATCH v2 3/3] configure: Integrate open posix testsuite configure

Hi all,

FYI the rest of the patchet merged.

Joerg, thanks for your work and patience with us.

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#15 lore raw
In reply to Joerg Vehlow

Hi all,

Quoted 5 lines

Update to v1:
- Replaced deprecated AC_PROG_CC_C99
- Fixed whitespace
- Fixed help message for configure script of ltp
- Added a more verbose commit message to the last commit

I didn't remember the reason for these fixes. It was in v1 [1]:

as described in my RFC, here is a first implementation of a fixed installation layout for open posix tests.

I implemented this using autoconf, to be able to specify the installation location of the tests.

If build standalone, the open posix tests are still installed to /opt/open_posix_testsuite/{conformance,functional,stress}, but when installed as part of ltp, they are installed to /opt/ltp/testcases/open_posix_testsuite/*

Kind regards,
Petr

[1] https://lore.kernel.org/ltp/[email protected]/

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp