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

Petr Vorel pvorel@suse.cz
Mon Aug 29 07:49:31 CEST 2022


Hi Joerg,

[ Cc Li ]

> 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.

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

Reviewed-by: Petr Vorel <pvorel@suse.cz>

...
> +++ b/testcases/open_posix_testsuite/bin/Makefile
> @@ -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
nit: TESTPATH="" below could be just TESTPATH=. Obviously sed here would need to
be adjusted.
> +
> +	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 $@
> diff --git a/testcases/open_posix_testsuite/bin/run-posix-option-group-test.sh b/testcases/open_posix_testsuite/bin/run-posix-option-group-test.sh
> index 1bbdddfd5..e90c252a3 100755
> --- a/testcases/open_posix_testsuite/bin/run-posix-option-group-test.sh
> +++ b/testcases/open_posix_testsuite/bin/run-posix-option-group-test.sh
> @@ -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


More information about the ltp mailing list