Moved 3 Linux-specific tests into linux/ directories.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9144 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/configure.in b/configure.in
index 1e7d33d..47abcf2 100644
--- a/configure.in
+++ b/configure.in
@@ -1750,6 +1750,7 @@
    none/tests/ppc32/Makefile
    none/tests/ppc64/Makefile
    none/tests/x86/Makefile
+   none/tests/linux/Makefile
    none/docs/Makefile
    exp-omega/Makefile
    exp-omega/tests/Makefile
diff --git a/memcheck/tests/Makefile.am b/memcheck/tests/Makefile.am
index f8a6e82..9863327 100644
--- a/memcheck/tests/Makefile.am
+++ b/memcheck/tests/Makefile.am
@@ -143,7 +143,6 @@
 	sigprocmask.stderr.exp sigprocmask.stderr.exp2 sigprocmask.vgtest \
 	stack_changes.stderr.exp stack_changes.stdout.exp \
 	stack_changes.stdout.exp2 stack_changes.vgtest \
-	stack_switch.stderr.exp stack_switch.vgtest \
 	strchr.stderr.exp strchr.stderr.exp2 strchr.vgtest \
 	str_tester.stderr.exp str_tester.vgtest \
 	supp_unknown.stderr.exp supp_unknown.vgtest supp_unknown.supp \
@@ -215,7 +214,7 @@
 	realloc1 realloc2 realloc3 \
 	sh-mem sh-mem-random \
 	sigaltstack signal2 sigprocmask sigkill \
-	stack_changes stack_switch strchr str_tester \
+	stack_changes strchr str_tester \
 	supp_unknown supp1 supp2 suppfree \
 	trivialleak \
 	mismatches new_override metadata \
@@ -247,7 +246,6 @@
 
 # Don't allow GCC to inline memcpy(), because then we can't intercept it
 overlap_CFLAGS		= $(AM_CFLAGS) -fno-builtin-memcpy
-stack_switch_LDADD      = -lpthread
 str_tester_CFLAGS	= $(AM_CFLAGS) -Wno-shadow
 supp_unknown_SOURCES	= badjump.c
 supp1_SOURCES		= supp.c
diff --git a/memcheck/tests/linux/Makefile.am b/memcheck/tests/linux/Makefile.am
index 93fc4c7..8fde427 100644
--- a/memcheck/tests/linux/Makefile.am
+++ b/memcheck/tests/linux/Makefile.am
@@ -3,11 +3,13 @@
 EXTRA_DIST = $(noinst_SCRIPTS) \
 	brk.stderr.exp brk.vgtest \
 	capget capget.stderr.exp \
+	stack_switch.stderr.exp stack_switch.vgtest \
 	timerfd-syscall timerfd-syscall.stderr.exp
 
 check_PROGRAMS = \
 	brk \
 	capget \
+	stack_switch \
 	timerfd-syscall
 
 AM_CPPFLAGS  = -I$(top_srcdir)/include
@@ -15,4 +17,5 @@
 		$(FLAG_MMMX) $(FLAG_MSSE)
 AM_CXXFLAGS  = $(AM_CFLAGS)
 
+stack_switch_LDADD    = -lpthread
 timerfd_syscall_LDADD = -lrt
diff --git a/memcheck/tests/stack_switch.c b/memcheck/tests/linux/stack_switch.c
similarity index 88%
rename from memcheck/tests/stack_switch.c
rename to memcheck/tests/linux/stack_switch.c
index 45cde8e..a0cfbad 100644
--- a/memcheck/tests/stack_switch.c
+++ b/memcheck/tests/linux/stack_switch.c
@@ -3,15 +3,6 @@
 
 #include <stdio.h>
 
-#if defined(_AIX)
-int main(int argc, char **argv) 
-{
-  printf("this test is linux-specific\n");
-  return 0;
-}
-
-#else
-
 #include <sched.h>
 #include <stdlib.h>
 #include <string.h>
@@ -63,5 +54,3 @@
 
    exit( 0 );
 }
-
-#endif /* !defined(_AIX) */
diff --git a/memcheck/tests/stack_switch.stderr.exp b/memcheck/tests/linux/stack_switch.stderr.exp
similarity index 100%
rename from memcheck/tests/stack_switch.stderr.exp
rename to memcheck/tests/linux/stack_switch.stderr.exp
diff --git a/memcheck/tests/stack_switch.vgtest b/memcheck/tests/linux/stack_switch.vgtest
similarity index 100%
rename from memcheck/tests/stack_switch.vgtest
rename to memcheck/tests/linux/stack_switch.vgtest
diff --git a/none/tests/Makefile.am b/none/tests/Makefile.am
index 43a51bc..600cc86 100644
--- a/none/tests/Makefile.am
+++ b/none/tests/Makefile.am
@@ -3,6 +3,8 @@
 include $(top_srcdir)/Makefile.flags.am
 
 SUBDIRS = .
+
+# Arch-specific tests.
 if VGCONF_ARCHS_INCLUDE_X86
 SUBDIRS += x86
 endif
@@ -16,7 +18,12 @@
 SUBDIRS += ppc64
 endif
 
-DIST_SUBDIRS = x86 amd64 ppc32 ppc64 .
+# OS-specific tests
+if VGCONF_OS_IS_LINUX
+SUBDIRS += linux
+endif
+
+DIST_SUBDIRS = x86 amd64 ppc32 ppc64 linux .
 
 noinst_SCRIPTS = \
 	filter_cmdline0 filter_linenos \
@@ -76,11 +83,6 @@
 	map_unaligned.stderr.exp map_unaligned.vgtest \
 	map_unmap.stderr.exp map_unmap.stdout.exp map_unmap.vgtest \
 	mq.stderr.exp mq.vgtest \
-	mremap.stderr.exp mremap.stdout.exp mremap.vgtest \
-	mremap2.stderr.exp \
-	mremap2.stdout.exp mremap2.stdout.exp2 \
-	mremap2.stdout.exp-glibc28-amd64 \
-	mremap2.vgtest \
 	munmap_exe.stderr.exp munmap_exe.vgtest \
 	nestedfns.stderr.exp nestedfns.stdout.exp nestedfns.vgtest \
 	pending.stdout.exp pending.stderr.exp pending.vgtest \
@@ -144,7 +146,7 @@
 	fdleak_fcntl fdleak_ipv4 fdleak_open fdleak_pipe \
 	fdleak_socketpair \
 	floored fork fucomip manythreads \
-	munmap_exe map_unaligned map_unmap mq mremap mremap2 \
+	munmap_exe map_unaligned map_unmap mq \
 	nestedfns \
 	pending \
 	pth_atfork1 pth_blockedsig pth_cancel1 pth_cancel2 pth_cvsimple \
diff --git a/none/tests/linux/Makefile.am b/none/tests/linux/Makefile.am
new file mode 100644
index 0000000..2760a8a
--- /dev/null
+++ b/none/tests/linux/Makefile.am
@@ -0,0 +1,14 @@
+noinst_SCRIPTS = filter_stderr
+
+EXTRA_DIST = $(noinst_SCRIPTS) \
+	mremap.stderr.exp mremap.stdout.exp mremap.vgtest \
+	mremap2.stderr.exp mremap2.stdout.exp mremap2.stdout.exp2 \
+	    mremap2.stdout.exp-glibc28-amd64 mremap2.vgtest
+
+check_PROGRAMS = \
+	mremap \
+	mremap2
+
+AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/include -I$(top_builddir)/include
+AM_CFLAGS   = $(WERROR) -Winline -Wall -Wshadow -g $(AM_FLAG_M3264_PRI)
+AM_CXXFLAGS = $(AM_CFLAGS)
diff --git a/none/tests/linux/filter_stderr b/none/tests/linux/filter_stderr
new file mode 100755
index 0000000..0ae9313
--- /dev/null
+++ b/none/tests/linux/filter_stderr
@@ -0,0 +1,3 @@
+#! /bin/sh
+
+../filter_stderr
diff --git a/none/tests/mremap.c b/none/tests/linux/mremap.c
similarity index 94%
rename from none/tests/mremap.c
rename to none/tests/linux/mremap.c
index 3a2d22a..a768836 100644
--- a/none/tests/mremap.c
+++ b/none/tests/linux/mremap.c
@@ -3,16 +3,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#if defined(_AIX)
-
-int main ( void )
-{
-  printf("This test is Linux-specific.\n");
-  return 0;
-}
-
-#else
-
 static char *mkmap(unsigned sz)
 {
 	static char *map;
@@ -106,5 +96,3 @@
 
 	return 0;
 }
-
-#endif /* defined(_AIX) */
diff --git a/none/tests/mremap.stderr.exp b/none/tests/linux/mremap.stderr.exp
similarity index 100%
rename from none/tests/mremap.stderr.exp
rename to none/tests/linux/mremap.stderr.exp
diff --git a/none/tests/mremap.stderr.exp-glibc27 b/none/tests/linux/mremap.stderr.exp-glibc27
similarity index 100%
rename from none/tests/mremap.stderr.exp-glibc27
rename to none/tests/linux/mremap.stderr.exp-glibc27
diff --git a/none/tests/mremap.stdout.exp b/none/tests/linux/mremap.stdout.exp
similarity index 100%
rename from none/tests/mremap.stdout.exp
rename to none/tests/linux/mremap.stdout.exp
diff --git a/none/tests/mremap.vgtest b/none/tests/linux/mremap.vgtest
similarity index 100%
rename from none/tests/mremap.vgtest
rename to none/tests/linux/mremap.vgtest
diff --git a/none/tests/mremap2.c b/none/tests/linux/mremap2.c
similarity index 96%
rename from none/tests/mremap2.c
rename to none/tests/linux/mremap2.c
index 8bef831..0d932dd 100644
--- a/none/tests/mremap2.c
+++ b/none/tests/linux/mremap2.c
@@ -2,16 +2,6 @@
 
 #include <stdio.h>
 
-#if defined(_AIX)
-
-int main ( void )
-{
-  printf("This test is Linux-specific.\n");
-  return 0;
-}
-
-#else
-
 #include <sys/mman.h>
 #include <assert.h>
 #include <stdlib.h>
@@ -172,5 +162,3 @@
   }
   return 0;
 }
-
-#endif /* defined(_AIX5) */
diff --git a/none/tests/mremap2.stderr.exp b/none/tests/linux/mremap2.stderr.exp
similarity index 100%
rename from none/tests/mremap2.stderr.exp
rename to none/tests/linux/mremap2.stderr.exp
diff --git a/none/tests/mremap2.stdout.exp b/none/tests/linux/mremap2.stdout.exp
similarity index 100%
rename from none/tests/mremap2.stdout.exp
rename to none/tests/linux/mremap2.stdout.exp
diff --git a/none/tests/mremap2.stdout.exp-glibc28-amd64 b/none/tests/linux/mremap2.stdout.exp-glibc28-amd64
similarity index 100%
rename from none/tests/mremap2.stdout.exp-glibc28-amd64
rename to none/tests/linux/mremap2.stdout.exp-glibc28-amd64
diff --git a/none/tests/mremap2.stdout.exp2 b/none/tests/linux/mremap2.stdout.exp2
similarity index 100%
rename from none/tests/mremap2.stdout.exp2
rename to none/tests/linux/mremap2.stdout.exp2
diff --git a/none/tests/linux/mremap2.vgtest b/none/tests/linux/mremap2.vgtest
new file mode 100644
index 0000000..0e88835
--- /dev/null
+++ b/none/tests/linux/mremap2.vgtest
@@ -0,0 +1,2 @@
+prog: mremap2
+stdout_filter: ../../../tests/filter_addresses
diff --git a/none/tests/mremap2.vgtest b/none/tests/mremap2.vgtest
deleted file mode 100644
index 9120adc..0000000
--- a/none/tests/mremap2.vgtest
+++ /dev/null
@@ -1,2 +0,0 @@
-prog: mremap2
-stdout_filter: ../../tests/filter_addresses