@@ -15,3 +15,8 @@
run.sh
logfile
+
+/configure
+/config.log
+/config.status
+include/mk/config.mk
deleted file mode 100644
@@ -1 +0,0 @@
--std=c99 -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -W -Wall
@@ -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.
@@ -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.
deleted file mode 100644
@@ -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.
-
deleted file mode 100644
deleted file mode 100644
@@ -5,6 +5,10 @@
# all of the Makefiles will be rebuilt by default.
CRITICAL_MAKEFILE= conformance/interfaces/timer_settime/Makefile
+top_srcdir?= .
+
+include include/mk/env.mk
+
# The default logfile for the tests.
LOGFILE?= logfile
# Subdirectories to traverse down.
@@ -21,43 +25,58 @@ BUILD_MAKE= env $(BUILD_MAKE_ENV) $(MAKE)
TEST_MAKE= env $(TEST_MAKE_ENV) $(MAKE) -k
-top_srcdir?= .
-
-prefix?= `$(top_srcdir)/scripts/print_prefix.sh`
-
-datadir?= $(prefix)/share
-
-exec_prefix?= $(prefix)
-
all: conformance-all functional-all stress-all tools-all
ifeq ($(shell uname -s), Linux)
include Makefile.linux
endif
-clean: $(CRITICAL_MAKEFILE)
- @rm -f $(LOGFILE)*
+AUTOGENERATED_FILES = include/mk/config.mk
+
+.PHONY: ac-clean
+ac-clean: clean
+
+.PHONY: clean
+clean:
+ $(RM) -f $(LOGFILE)*
+ $(RM) -f config.log config.status
@for dir in $(SUBDIRS) tools; do \
$(MAKE) -C $$dir clean >/dev/null; \
done
-distclean: distclean-makefiles
+.PHONY: distclean
+distclean: clean distclean-makefiles
+ @rm -f $(AUTOGENERATED_FILES)
# Clean out all of the generated Makefiles.
+.PHONY: distclean-makefiles
distclean-makefiles:
@for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir $@; \
done
+$(AUTOGENERATED_FILES): $(top_builddir)/config.status
+ $(SHELL) $^
+
+.PHONY: autotools
+autotools: configure
+
+configure: configure.ac
+ autoconf
+
+.PHONY: generate-makefiles
generate-makefiles: distclean-makefiles
@env top_srcdir=$(top_srcdir) \
$(top_srcdir)/scripts/generate-makefiles.sh
+.PHONY: install
install: bin-install conformance-install functional-install stress-install
+.PHONY: test
test: conformance-test functional-test stress-test
# Test build and execution targets.
+.PHONY: conformance-all conformance-install conformance-test
conformance-all: $(CRITICAL_MAKEFILE)
@rm -f `if echo "$(LOGFILE)" | grep -q '^/'; then echo "$(LOGFILE)"; else echo "\`pwd\`/$(LOGFILE)"; fi`.$@
@$(BUILD_MAKE) -C conformance -j1 all
@@ -69,6 +88,7 @@ conformance-test:
@rm -f `if echo "$(LOGFILE)" | grep -q '^/'; then echo "$(LOGFILE)"; else echo "\`pwd\`/$(LOGFILE)"; fi`.$@
@$(TEST_MAKE) -C conformance test
+.PHONY: functional-all functional-install functional-test
functional-all: $(CRITICAL_MAKEFILE)
@rm -f `if echo "$(LOGFILE)" | grep -q '^/'; then echo "$(LOGFILE)"; else echo "\`pwd\`/$(LOGFILE)"; fi`.$@
@$(BUILD_MAKE) -C functional -j1 all
@@ -80,6 +100,7 @@ functional-test:
@rm -f `if echo "$(LOGFILE)" | grep -q '^/'; then echo "$(LOGFILE)"; else echo "\`pwd\`/$(LOGFILE)"; fi`.$@
@$(TEST_MAKE) -C functional test
+.PHONY: stress-all stress-install stress-test
stress-all: $(CRITICAL_MAKEFILE)
@rm -f `if echo "$(LOGFILE)" | grep -q '^/'; then echo "$(LOGFILE)"; else echo "\`pwd\`/$(LOGFILE)"; fi`.$@
@$(BUILD_MAKE) -C stress -j1 all
@@ -92,17 +113,15 @@ stress-test:
@$(TEST_MAKE) -C stress test
# Tools build and install targets.
+.PHONY: bin-install
bin-install:
@$(MAKE) -C bin install
+.PHONY: tools-all
tools-all:
@$(MAKE) -C tools all
-$(CRITICAL_MAKEFILE): \
- $(top_srcdir)/scripts/generate-makefiles.sh \
- $(top_srcdir)/CFLAGS \
- $(top_srcdir)/LDFLAGS \
- $(top_srcdir)/LDLIBS
+$(CRITICAL_MAKEFILE): $(top_srcdir)/scripts/generate-makefiles.sh
@$(MAKE) generate-makefiles
.PHONY: check
@@ -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.
@@ -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 $@
@@ -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()
{
new file mode 100644
@@ -0,0 +1,18 @@
+AC_PREREQ(2.61)
+AC_INIT([open_posix_testsuite], [LTP_VERSION], [ltp@lists.linux.it])
+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
@@ -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 $@; \
@@ -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
@@ -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
@@ -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
@@ -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
new file mode 100644
@@ -0,0 +1,17 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2022 Joerg Vehlow <joerg.vehlow@aox.de>
+
+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
new file mode 100644
@@ -0,0 +1,11 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2022 Joerg Vehlow <joerg.vehlow@aox.de>
+
+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
@@ -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
deleted file mode 100755
@@ -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}
@@ -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
@@ -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