]> granicus.if.org Git - strace/commitdiff
tests: run tests for each supported personality
authorDmitry V. Levin <ldv@altlinux.org>
Fri, 23 Jan 2015 22:45:02 +0000 (22:45 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sat, 24 Jan 2015 03:39:34 +0000 (03:39 +0000)
When strace supports more than one personality, run test suite
for each personality supported by the host system.

* bootstrap: Create tests-m32 and tests-mx32 subtrees from tests.
* configure.ac: Check for -m32 and -mx32 runtime support.
(AC_CONFIG_FILES): Add tests-m32/Makefile and tests-mx32/Makefile.
* Makefile.am [HAVE_M32_RUNTIME] (TESTS_M32): Define.
[HAVE_MX32_RUNTIME] (TESTS_MX32): Define.
(SUBDIRS): Add $(TESTS_M32) $(TESTS_MX32).
* .gitignore: Add /tests-m32 and /tests-mx32.

.gitignore
Makefile.am
bootstrap
configure.ac

index 8fac8fa041ac533624673ffc439a4f878dba49d3..770bba780d414640aa284475dfd5efd3bac5c3db 100644 (file)
@@ -29,13 +29,14 @@ Makefile.in
 /stamp-h1
 
 /*.gdb
-/ioctls.h
-/ioctldefs.h
-/ioctlsort
 /strace
 /test-driver
 
 /ioctlent[012].h
 /ioctls_all[012].h
+/ioctlsort[012]
 
 /strace-*.tar.xz
+
+/tests-m32
+/tests-mx32
index 83eef2e3e7c7d58a4f87e6b556f0f0def44b6347..a00aad2ab7c66fa0d17cf7754492be660cccf10e 100644 (file)
@@ -1,6 +1,12 @@
 # Automake input for strace.
 
-SUBDIRS = tests
+if HAVE_M32_RUNTIME
+TESTS_M32 = tests-m32
+endif
+if HAVE_MX32_RUNTIME
+TESTS_MX32 = tests-mx32
+endif
+SUBDIRS = tests $(TESTS_M32) $(TESTS_MX32)
 
 bin_PROGRAMS = strace
 man_MANS = strace.1
index 91d1a8fb735ec76b193480bc8a1943e73ed83c0e..9624fecf95236309d4c80151d39d67433c091d91 100755 (executable)
--- a/bootstrap
+++ b/bootstrap
@@ -1,3 +1,17 @@
-#!/bin/sh
+#!/bin/sh -eu
+
+for m in -m32 -mx32; do
+       mkdir tests$m ||
+               continue
+       sed "s/^AM_CFLAGS[[:space:]]*=.*/& $m/" \
+               tests/Makefile.am > tests$m/Makefile.am
+       for f in tests/*; do
+               [ "${f##*/}" != Makefile.am ] ||
+                       continue
+               ln -s ../"$f" tests$m/
+       done
+done
+
 ./xlat/gen.sh
+
 exec autoreconf -f -i "$@"
index 315d078352ecfdd9065a8669dd7426f130d62a5a..ea55c6e65e7c951199524643ee48cdec35a73883 100644 (file)
@@ -816,5 +816,33 @@ if test "$arch" = mips && test "$no_create" != yes; then
        fi
 fi
 
-AC_CONFIG_FILES([Makefile tests/Makefile])
+have_m32=no
+case "$arch" in
+       aarch64|powerpc64|sparc64|tile|x32|x86_64)
+       AC_MSG_CHECKING([for -m32 runtime support])
+       saved_CFLAGS="$CFLAGS"
+       CFLAGS="$CFLAGS -m32"
+       AC_RUN_IFELSE([AC_LANG_SOURCE([[int main(){return 0;}]])],
+               [have_m32=yes],[have_m32=no],[have_m32=no])
+       CFLAGS="$saved_CFLAGS"
+       AC_MSG_RESULT($have_m32)
+       ;;
+esac
+AM_CONDITIONAL([HAVE_M32_RUNTIME], [test "$have_m32" = yes])
+
+have_mx32=no
+case "$arch" in
+       x86_64)
+       AC_MSG_CHECKING([for -mx32 runtime support])
+       saved_CFLAGS="$CFLAGS"
+       CFLAGS="$CFLAGS -mx32"
+       AC_RUN_IFELSE([AC_LANG_SOURCE([[int main(){return 0;}]])],
+               [have_mx32=yes],[have_mx32=no],[have_mx32=no])
+       CFLAGS="$saved_CFLAGS"
+       AC_MSG_RESULT($have_mx32)
+       ;;
+esac
+AM_CONDITIONAL([HAVE_MX32_RUNTIME], [test "$have_mx32" = yes])
+
+AC_CONFIG_FILES([Makefile tests/Makefile tests-m32/Makefile tests-mx32/Makefile])
 AC_OUTPUT