Create memcheck/tests/linux/ and move some Linux-specific tests
into it.  Partial merge from DARWIN branch, r8943.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8975 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/configure.in b/configure.in
index af05dca..d10bd2c 100644
--- a/configure.in
+++ b/configure.in
@@ -1629,6 +1629,7 @@
    memcheck/tests/ppc32/Makefile
    memcheck/tests/ppc64/Makefile
    memcheck/tests/x86/Makefile
+   memcheck/tests/linux/Makefile
    memcheck/tests/x86-linux/Makefile
    memcheck/docs/Makefile
    cachegrind/Makefile
diff --git a/memcheck/tests/Makefile.am b/memcheck/tests/Makefile.am
index 020c128..8f54377 100644
--- a/memcheck/tests/Makefile.am
+++ b/memcheck/tests/Makefile.am
@@ -18,6 +18,11 @@
 SUBDIRS += ppc64
 endif
 
+# OS-specific tests
+if VGO_LINUX
+SUBDIRS += linux
+endif
+
 # Platform-specific tests
 if VGP_X86_LINUX
 SUBDIRS += x86-linux
@@ -73,10 +78,8 @@
 	leak-tree.stderr.exp2 leak-tree.stderr.exp64 \
 	leak-regroot.vgtest leak-regroot.stderr.exp \
 	leakotron.vgtest leakotron.stdout.exp leakotron.stderr.exp \
-	linux-capget linux-capget.stderr.exp \
 	linux-syslog-syscall linux-syslog-syscall.stderr.exp \
 	linux-syscalls-2007 linux-syscalls-2007.stderr.exp \
-	linux-timerfd-syscall linux-timerfd-syscall.stderr.exp \
 	long_namespace_xml.vgtest long_namespace_xml.stdout.exp \
 	long_namespace_xml.stderr.exp \
 	lsframe1.vgtest lsframe1.stdout.exp lsframe1.stderr.exp \
@@ -199,10 +202,8 @@
 	file_locking \
 	fprw fwrite hello inits inline \
 	leak-0 leak-cycle leak-pool leak-tree leak-regroot leakotron \
-	linux-capget \
 	linux-syslog-syscall \
 	linux-syscalls-2007 \
-	linux-timerfd-syscall \
 	long_namespace_xml \
 	lsframe1 lsframe2 \
 	mallinfo \
@@ -246,7 +247,6 @@
 oset_test_CFLAGS	= $(AM_FLAG_M3264_PRI) \
 				-DVGA_$(VG_ARCH_PRI)=1 -DVGO_$(VG_OS)=1 \
 				-DVGP_$(VG_ARCH_PRI)_$(VG_OS)=1
-linux_timerfd_syscall_LDADD = -lrt
 vcpu_bz2_CFLAGS		= $(AM_FLAG_M3264_PRI) $(AM_CFLAGS) -O2 -g
 vcpu_fbench_CFLAGS	= $(AM_FLAG_M3264_PRI) $(AM_CFLAGS) -O2 -g
 vcpu_fnfns_CFLAGS	= $(AM_FLAG_M3264_PRI) $(AM_CFLAGS) -O2 -g
diff --git a/memcheck/tests/linux-capget.vgtest b/memcheck/tests/linux-capget.vgtest
deleted file mode 100644
index acce6ab..0000000
--- a/memcheck/tests/linux-capget.vgtest
+++ /dev/null
@@ -1,2 +0,0 @@
-prog: linux-capget
-stderr_filter: filter_allocs
diff --git a/memcheck/tests/linux/Makefile.am b/memcheck/tests/linux/Makefile.am
new file mode 100644
index 0000000..b0ad79f
--- /dev/null
+++ b/memcheck/tests/linux/Makefile.am
@@ -0,0 +1,17 @@
+noinst_SCRIPTS = filter_stderr
+
+EXTRA_DIST = $(noinst_SCRIPTS) \
+	capget capget.stderr.exp \
+	timerfd-syscall timerfd-syscall.stderr.exp
+
+check_PROGRAMS = \
+	capget \
+	timerfd-syscall
+
+AM_CPPFLAGS  = -I$(top_srcdir)/include
+AM_CFLAGS    = $(WERROR) @FLAG_M32@ -Winline -Wall -Wshadow -g \
+		$(FLAG_MMMX) $(FLAG_MSSE)
+AM_CXXFLAGS  = $(AM_CFLAGS)
+AM_CCASFLAGS = @FLAG_M32@
+
+timerfd_syscall_LDADD = -lrt
diff --git a/memcheck/tests/linux-capget.c b/memcheck/tests/linux/capget.c
similarity index 100%
rename from memcheck/tests/linux-capget.c
rename to memcheck/tests/linux/capget.c
diff --git a/memcheck/tests/linux-capget.stderr.exp b/memcheck/tests/linux/capget.stderr.exp
similarity index 100%
rename from memcheck/tests/linux-capget.stderr.exp
rename to memcheck/tests/linux/capget.stderr.exp
diff --git a/memcheck/tests/linux/capget.vgtest b/memcheck/tests/linux/capget.vgtest
new file mode 100644
index 0000000..8be6c3e
--- /dev/null
+++ b/memcheck/tests/linux/capget.vgtest
@@ -0,0 +1,2 @@
+prog: capget
+stderr_filter: ../filter_allocs
diff --git a/memcheck/tests/linux/filter_stderr b/memcheck/tests/linux/filter_stderr
new file mode 100755
index 0000000..0ae9313
--- /dev/null
+++ b/memcheck/tests/linux/filter_stderr
@@ -0,0 +1,3 @@
+#! /bin/sh
+
+../filter_stderr
diff --git a/memcheck/tests/linux-timerfd-syscall.c b/memcheck/tests/linux/timerfd-syscall.c
similarity index 99%
rename from memcheck/tests/linux-timerfd-syscall.c
rename to memcheck/tests/linux/timerfd-syscall.c
index e1a891b..fdec7ce 100644
--- a/memcheck/tests/linux-timerfd-syscall.c
+++ b/memcheck/tests/linux/timerfd-syscall.c
@@ -28,7 +28,7 @@
 
 #define _GNU_SOURCE
 
-#include "../../config.h"
+#include "../../../config.h"
 #include <errno.h>
 #include <fcntl.h>
 #include <poll.h>
diff --git a/memcheck/tests/linux-timerfd-syscall.stderr.exp b/memcheck/tests/linux/timerfd-syscall.stderr.exp
similarity index 100%
rename from memcheck/tests/linux-timerfd-syscall.stderr.exp
rename to memcheck/tests/linux/timerfd-syscall.stderr.exp
diff --git a/memcheck/tests/linux-timerfd-syscall.stdout.exp b/memcheck/tests/linux/timerfd-syscall.stdout.exp
similarity index 100%
rename from memcheck/tests/linux-timerfd-syscall.stdout.exp
rename to memcheck/tests/linux/timerfd-syscall.stdout.exp
diff --git a/memcheck/tests/linux-timerfd-syscall.vgtest b/memcheck/tests/linux/timerfd-syscall.vgtest
similarity index 77%
rename from memcheck/tests/linux-timerfd-syscall.vgtest
rename to memcheck/tests/linux/timerfd-syscall.vgtest
index 1f1fbb7..75a3f71 100644
--- a/memcheck/tests/linux-timerfd-syscall.vgtest
+++ b/memcheck/tests/linux/timerfd-syscall.vgtest
@@ -1,2 +1,2 @@
 prereq: [ "$(uname)" = "Linux" ] && awk 'END{exit("'$(uname -r)'" >= "2.6.25" ? 0 : 1)}' </dev/null
-prog: linux-timerfd-syscall
+prog: timerfd-syscall