about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--GNUmakefile2
-rw-r--r--buildtools/Makefile16
-rwxr-xr-xtest/Execute-Tests24
-rw-r--r--test/Makefile24
-rw-r--r--test/testrandom.c (renamed from buildtools/testrandom.c)0
5 files changed, 40 insertions, 26 deletions
diff --git a/GNUmakefile b/GNUmakefile
index c6077285..fec301d6 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -60,7 +60,7 @@ VPATH=.:$(SRCDIR)
 
 include $(BUILDDIR)/config.mk
 
-PROG_SUBDIRS = converter analyzer editor generator other
+PROG_SUBDIRS = converter analyzer editor generator other test
 PRODUCT_SUBDIRS = lib $(PROG_SUBDIRS)
 SUPPORT_SUBDIRS = urt buildtools
 
diff --git a/buildtools/Makefile b/buildtools/Makefile
index e90feeca..10ac1a58 100644
--- a/buildtools/Makefile
+++ b/buildtools/Makefile
@@ -8,24 +8,10 @@ include $(BUILDDIR)/config.mk
 
 MERGE_OBJECTS =
 
-# These are programs that are used by the make files:
-BUILDPROGS = libopt typegen endiangen
-
-# Ideally, this directory would not contain anything but build tools, which
-# means they would all be built to run in the build environment, not the
-# target environment.  But we have no other convenient place for test tools,
-# so we put them here and build them for the target environment.
-TESTPROGS = testrandom
-
-PROGS = $(BUILDPROGS) $(TESTPROGS)
+PROGS = libopt typegen endiangen
 
 all: $(PROGS)
 
-PORTBINARIES = $(TESTPROGS)
-BINARIES = $(PORTBINARIES)
-OBJECTS = $(BINARIES:%=%.o)
-SCRIPTS =
-
 OMIT_BUILDTOOL_RULE = 1
 include $(SRCDIR)/common.mk
 
diff --git a/test/Execute-Tests b/test/Execute-Tests
index c2fd9d52..7a1a3793 100755
--- a/test/Execute-Tests
+++ b/test/Execute-Tests
@@ -39,16 +39,10 @@ fi
 # export PBM_BINPREFIX=""
 export PBM_BINPREFIX=${PBM_TESTPREFIX}
 
-# Add PBM_BINPREFIX to PATH.
-# This is necessary for Netpbm programs that call other Netpbm programs.
-
-if [ ! -z $PBM_BINPREFIX ]
-  then
-  export PATH=${PBM_BINPREFIX}:$PATH
-fi
-
-# Set srcdir, which is the directory which contains Execute-Tests
-# (this script), Test-Order *.test and *.ok files.
+# Set srcdir, which is the directory which contains Execute-Tests (this
+# script), programs that run the test, including *.test and helpers that they
+# invoke, the list of tests to run ('Test-Order'), and *.ok files that
+# indicate the expected results of tests.
 
 srcdir=$(dirname $0)
 
@@ -100,6 +94,16 @@ if [ ! -f ./testimg.ppm ]
   then cp -v ${srcdir}/testimg.ppm  ./testimg.ppm 
 fi
 
+# Add PBM_BINPREFIX to PATH.
+# This is necessary for Netpbm programs that call other Netpbm programs.
+
+if [ ! -z $PBM_BINPREFIX ]
+  then
+  export PATH=${PBM_BINPREFIX}:$PATH
+fi
+
+export PATH=${srcdir}:$PATH
+
 # Execute the tests, as described in the "Test-Order" file.
 #
 # Each test outputs a ".out" file, which is compared against a
diff --git a/test/Makefile b/test/Makefile
new file mode 100644
index 00000000..4d44285f
--- /dev/null
+++ b/test/Makefile
@@ -0,0 +1,24 @@
+ifeq ($(SRCDIR)x,x)
+  SRCDIR = $(CURDIR)/..
+  BUILDDIR = $(SRCDIR)
+endif
+SUBDIR = test
+VPATH = .:$(SRCDIR)/$(SUBDIR)
+include $(BUILDDIR)/config.mk
+
+MERGE_OBJECTS =
+
+PROGS = testrandom
+
+all: $(PROGS)
+
+PORTBINARIES = testrandom
+OBJECTS = $(PORTBINARIES:%=%.o)
+
+OMIT_TEST_RULE = 1
+include $(SRCDIR)/common.mk
+
+distclean clean: cleanlocal
+.PHONY: cleanlocal
+cleanlocal:
+	rm -f $(PROGS)
diff --git a/buildtools/testrandom.c b/test/testrandom.c
index 3f65f0d2..3f65f0d2 100644
--- a/buildtools/testrandom.c
+++ b/test/testrandom.c