Add test building and check rules.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@2474 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
scottc 1997-10-02 22:14:12 +00:00
parent ce0ff5efd0
commit 8c77e2058a
4 changed files with 284 additions and 1 deletions

View file

@ -1,3 +1,9 @@
Thu Oct 2 14:56:08 1997 Scott Christley <scottc@stetson.net-community.com>
* test.make: New file.
* rules.make: Add test building and check rules.
* Makefile.in: Install test.make.
Wed Oct 1 18:04:25 1997 Ovidiu Predescu <ovidiu@net-community.com>
* configure.in: Added the --with-library-combo to support specifying a

View file

@ -64,7 +64,7 @@ install:
done
for f in aggregate.make application.make bundle.make clean.make \
common.make core.make library.make rules.make target.make \
tool.make MediaBook.func; do \
tool.make test.make MediaBook.func; do \
$(INSTALL_DATA) $$f $(makedir); \
done
$(INSTALL_DATA) config.site $(prefix)/share

View file

@ -98,6 +98,94 @@ endif
RESOURCE_DIRS="$($*_RESOURCE_DIRS)" \
BUNDLE_LIBS="$($*_BUNDLE_LIBS)"
#
# Testing rules
#
# These are for compiling
ALL_TEST_LIBRARY_LIBS = $(ADDITIONAL_LIBRARY_LIBS) -lobjc-test \
$(FND_LIBS) $(OBJC_LIBS) $(TARGET_SYSTEM_LIBS)
ALL_TEST_BUNDLE_LIBS = $(ADDITIONAL_BUNDLE_LIBS) $(FND_LIBS) $(OBJC_LIBS) \
$(TARGET_SYSTEM_LIBS)
ALL_TEST_TOOL_LIBS = $(ADDITIONAL_TOOL_LIBS) $(FND_LIBS) $(OBJC_LIBS) \
$(TARGET_SYSTEM_LIBS)
ALL_TEST_GUI_LIBS = $(ADDITIONAL_GUI_LIBS) $(BACKEND_LIBS) $(GUI_LIBS) \
$(FND_LIBS) $(OBJC_LIBS) $(SYSTEM_LIBS) $(TARGET_SYSTEM_LIBS)
%.testlib : FORCE
@echo Making $*...
$(MAKE) --no-print-directory internal-testlib-all \
TEST_LIBRARY_NAME=$* \
OBJC_FILES="$($*_OBJC_FILES)" \
C_FILES="$($*_C_FILES)" \
PSWRAP_FILES="$($*_PSWRAP_FILES)" \
ADDITIONAL_INCLUDE_DIRS="$($*_INCLUDE_DIRS)" \
ADDITIONAL_LIBRARY_LIBS="$($*_LIBS)" \
ADDITIONAL_LIB_DIRS="$($*_LIB_DIRS)"
%.testbundle : FORCE
@echo Making $*...
@$(MAKE) --no-print-directory internal-testbundle-all \
TEST_BUNDLE_NAME=$* \
OBJC_FILES="$($*_OBJC_FILES)" \
C_FILES="$($*_C_FILES)" \
PSWRAP_FILES="$($*_PSWRAP_FILES)" \
RESOURCE_FILES="$($*_RESOURCES)" \
RESOURCE_DIRS="$($*_RESOURCE_DIRS)" \
ADDITIONAL_INCLUDE_DIRS="$($*_INCLUDE_DIRS)" \
ADDITIONAL_BUNDLE_LIBS="$($*_LIBS)" \
ADDITIONAL_LIB_DIRS="$($*_LIB_DIRS)"
%.testtool : FORCE
@echo Making $*...
@$(MAKE) --no-print-directory internal-testtool-all \
TEST_TOOL_NAME=$* \
OBJC_FILES="$($*_OBJC_FILES)" \
C_FILES="$($*_C_FILES)" \
PSWRAP_FILES="$($*_PSWRAP_FILES)" \
ADDITIONAL_INCLUDE_DIRS="$($*_INCLUDE_DIRS)" \
ADDITIONAL_TOOL_LIBS="$($*_LIBS)" \
ADDITIONAL_LIB_DIRS="$($*_LIB_DIRS)"
%.testapp : FORCE
@echo Making $*...
@$(MAKE) --no-print-directory internal-testapp-all \
TEST_APP_NAME=$* \
OBJC_FILES="$($*_OBJC_FILES)" \
C_FILES="$($*_C_FILES)" \
PSWRAP_FILES="$($*_PSWRAP_FILES)" \
ADDITIONAL_INCLUDE_DIRS="$($*_INCLUDE_DIRS)" \
ADDITIONAL_GUI_LIBS="$($*_LIBS)" \
ADDITIONAL_LIB_DIRS="$($*_LIB_DIRS)"
# These are for running the tests
%.checklib : FORCE
@echo Checking $*...
$(MAKE) --no-print-directory internal-check-lib \
TEST_LIBRARY_NAME=$* \
CHECK_SCRIPT_DIRS="$($*_SCRIPT_DIRS)"
%.checkbundle : FORCE
@echo Checking $*...
$(MAKE) --no-print-directory internal-check-bundle \
TEST_BUNDLE_NAME=$* \
CHECK_SCRIPT_DIRS="$($*_SCRIPT_DIRS)"
%.checktool : FORCE
@echo Checking $*...
$(MAKE) --no-print-directory internal-check-tool \
TEST_TOOL_NAME=$* \
CHECK_SCRIPT_DIRS="$($*_SCRIPT_DIRS)"
%.checkapp : FORCE
@echo Checking $*...
$(MAKE) --no-print-directory internal-check-app \
TEST_APP_NAME=$* \
CHECK_SCRIPT_DIRS="$($*_SCRIPT_DIRS)"
#
# The list of Objective-C source files to be compiled
# are in the OBJC_FILES variable.

189
test.make Normal file
View file

@ -0,0 +1,189 @@
#
# test.make
#
# Makefile rules for dejagnu/GNUstep based testing
#
# Copyright (C) 1997 Free Software Foundation, Inc.
#
# Author: Scott Christley <scottc@net-community.com>
#
# This file is part of the GNUstep Makefile Package.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# You should have received a copy of the GNU General Public
# License along with this library; see the file COPYING.LIB.
# If not, write to the Free Software Foundation,
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# Include in the common makefile rules
#
include $(GNUSTEP_SYSTEM_ROOT)/Makefiles/rules.make
#
# The three main components to perform a test in the framework
# a) code to be tested
# b) scripts which say what/how to test
# c) test driver
#
# Component A can be any (or all) of the possible build targets
# supported by the GNUstep Makefile Package: library, tool,
# application, or bundle. The code is assumed to be compiled
# elsewhere and just needs to be accessed to run the tests.
#
# Component B are written by the user. The GNUstep Makefile Package
# does not interpret these scripts; it require that you specify
# a list of directories which contain the scripts for the code to be
# tested, so that this information can be passed to dejagnu.
#
# Component C is dependent upon the type of code to be tested; generally
# an interactive program is its own test driver as it can communicate
# directly with dejagnu. Libraries, however, require a test driver which
# interactively accepts commands from dejagnu; the Objective-C Testing
# Framework is the default test driver.
#
# Test drivers for the various build targets; the names should be unique
# across all of the test drivers:
#
# TEST_LIBRARY_NAME
# TEST_TOOL_NAME
# TEST_APP_NAME
# TEST_BUNDLE_NAME
#
# xxx_OBJC_FILES, xxx_C_FILES, and xxx_PSWRAP_FILES holds the files
# to be compiled for the xxx test driver.
#
# xxx_SCRIPT_DIRS is a list of directories containing the test scripts
# which will be performed by dejagnu for the xxx test driver.
#
# xxx_INCLUDE_DIRS are additional headers directories to be searched
#
# xxx_LIB_DIRS and xxx_LIBS are additional libraries directories and
# libraries to link against, respectively to link the xxx test driver.
#
TEST_LIBRARY_LIST := $(foreach lib,$(TEST_LIBRARY_NAME),$(lib).testlib)
CHECK_LIBRARY_LIST := $(foreach lib,$(TEST_LIBRARY_NAME),$(lib).checklib)
TEST_LIBRARY_STAMPS := $(foreach lib,$(TEST_LIBRARY_NAME),stamp-testlib-$(lib))
TEST_LIBRARY_STAMPS := $(addprefix $(GNUSTEP_OBJ_DIR)/,$(TEST_LIBRARY_STAMPS))
TEST_BUNDLE_LIST := $(foreach b,$(TEST_BUNDLE_NAME),$(b).testbundle)
CHECK_BUNDLE_LIST := $(foreach b,$(TEST_BUNDLE_NAME),$(b).checkbundle)
TEST_BUNDLE_STAMPS := $(foreach b,$(TEST_BUNDLE_NAME),stamp-testbundle-$(b))
TEST_BUNDLE_STAMPS := $(addprefix $(GNUSTEP_OBJ_DIR)/,$(TEST_BUNDLE_STAMPS))
TEST_TOOL_LIST := $(foreach tool,$(TEST_TOOL_NAME),$(tool).testtool)
CHECK_TOOL_LIST := $(foreach tool,$(TEST_TOOL_NAME),$(tool).checktool)
TEST_TOOL_STAMPS := $(foreach tool,$(TEST_TOOL_NAME),stamp-testtool-$(tool))
TEST_TOOL_STAMPS := $(addprefix $(GNUSTEP_OBJ_DIR)/,$(TEST_TOOL_STAMPS))
TEST_APP_LIST := $(foreach app,$(TEST_APP_NAME),$(app).testapp)
CHECK_APP_LIST := $(foreach app,$(TEST_APP_NAME),$(app).checkapp)
TEST_APP_STAMPS := $(foreach app,$(TEST_APP_NAME),stamp-testapp-$(app))
TEST_APP_STAMPS := $(addprefix $(GNUSTEP_OBJ_DIR)/,$(TEST_APP_STAMPS))
#
# Internal targets
#
$(GNUSTEP_OBJ_DIR)/stamp-testlib-% : $(C_OBJ_FILES) $(OBJC_OBJ_FILES)
$(LD) $(ALL_LDFLAGS) $(LDOUT)$(TEST_LIBRARY_NAME) \
$(C_OBJ_FILES) $(OBJC_OBJ_FILES) \
$(ALL_LIB_DIRS) $(ALL_TEST_LIBRARY_LIBS)
touch $@
$(GNUSTEP_OBJ_DIR)/stamp-testbundle-% : $(C_OBJ_FILES) $(OBJC_OBJ_FILES)
$(LD) $(ALL_LDFLAGS) $(LDOUT)$(TEST_BUNDLE_NAME) \
$(C_OBJ_FILES) $(OBJC_OBJ_FILES) \
$(ALL_LIB_DIRS) $(ALL_TEST_BUNDLE_LIBS)
touch $@
$(GNUSTEP_OBJ_DIR)/stamp-testtool-% : $(C_OBJ_FILES) $(OBJC_OBJ_FILES)
$(LD) $(ALL_LDFLAGS) $(LDOUT)$(TEST_TOOL_NAME) \
$(C_OBJ_FILES) $(OBJC_OBJ_FILES) \
$(ALL_LIB_DIRS) $(ALL_TEST_TOOL_LIBS)
touch $@
$(GNUSTEP_OBJ_DIR)/stamp-testapp-% : $(C_OBJ_FILES) $(OBJC_OBJ_FILES)
$(LD) $(ALL_LDFLAGS) $(LDOUT)$(TEST_APP_NAME) \
$(C_OBJ_FILES) $(OBJC_OBJ_FILES) \
$(ALL_LIB_DIRS) $(ALL_TEST_APP_LIBS)
touch $@
#
# Compilation targets
#
internal-all:: config/unix.exp $(GNUSTEP_OBJ_DIR) internal-test-build
config/unix.exp::
@$(GNUSTEP_MAKEFILES)/mkinstalldirs config
@echo "Creating the config/unix.exp file..."
@echo "## Do Not Edit ##" > config/unix.exp
@echo "# Contents generated automatically by Makefile" >> config/unix.exp
@echo "#" >> config/unix.exp
@echo "" >> config/unix.exp
@echo "set OBJC_RUNTIME $(OBJC_RUNTIME)" >> config/unix.exp
@echo "set FOUNDATION_LIB $(FOUNDATION_LIB)" >> config/unix.exp
@echo "" >> config/unix.exp
@echo "set OBJCTEST_DIR $(GNUSTEP_LIBRARIES_ROOT)/ObjCTest" >> config/unix.exp
@echo "set objdir `pwd`" >> config/unix.exp
@echo "source \"\$$OBJCTEST_DIR/common.exp\"" >> config/unix.exp
@echo "" >> config/unix.exp
@echo "# Maintain your own code in local.exp" >> config/unix.exp
@echo "source \"config/local.exp\"" >> config/unix.exp
internal-test-build:: test-libs test-bundles test-tools test-apps
test-libs:: $(TEST_LIBRARY_LIST)
test-bundles::
test-tools:: $(TEST_TOOL_LIST)
test-apps::
internal-testlib-all:: $(GNUSTEP_OBJ_DIR)/stamp-testlib-$(TEST_LIBRARY_NAME)
internal-testbundle-all::
internal-testtool-all:: $(GNUSTEP_OBJ_DIR)/stamp-testtool-$(TEST_TOOL_NAME)
internal-testapp-all::
#
# Check targets (actually running the tests)
#
internal-check:: config/unix.exp check-libs check-bundles check-tools check-apps
check-libs:: $(CHECK_LIBRARY_LIST)
check-bundles::
check-tools::
check-apps::
internal-check-lib::
for f in $(CHECK_SCRIPT_DIRS); do \
runtest --tool $$f --srcdir . PROG=./$(TEST_LIBRARY_NAME) ; \
done
internal-check-bundle::
for f in $(CHECK_SCRIPT_DIRS); do \
runtest --tool $$f --srcdir . PROG=./$(TEST_BUNDLE_NAME) ; \
done
internal-check-tool::
for f in $(CHECK_SCRIPT_DIRS); do \
runtest --tool $$f --srcdir . PROG=./$(TEST_TOOL_NAME) ; \
done
internal-check-app::
for f in $(CHECK_SCRIPT_DIRS); do \
runtest --tool $$f --srcdir . PROG=./$(TEST_APP_NAME) ; \
done