2
# Instance/test-library.make
4
# Instance Makefile rules for dejagnu/GNUstep based testing
6
# Copyright (C) 1997 Free Software Foundation, Inc.
8
# Author: Scott Christley <scottc@net-community.com>
9
# Author: Ovidiu Predescu <ovidiu@net-community.com>
11
# This file is part of the GNUstep Makefile Package.
13
# This library is free software; you can redistribute it and/or
14
# modify it under the terms of the GNU General Public License
15
# as published by the Free Software Foundation; either version 2
16
# of the License, or (at your option) any later version.
18
# You should have received a copy of the GNU General Public
19
# License along with this library; see the file COPYING.LIB.
20
# If not, write to the Free Software Foundation,
21
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23
ifeq ($(RULES_MAKE_LOADED),)
24
include $(GNUSTEP_MAKEFILES)/rules.make
28
# The three main components to perform a test in the framework
29
# a) code to be tested
30
# b) scripts which say what/how to test
33
# Component A can be any (or all) of the possible build targets
34
# supported by the GNUstep Makefile Package: library, tool,
35
# application, or bundle. The code is assumed to be compiled
36
# elsewhere and just needs to be accessed to run the tests.
38
# Component B are written by the user. The GNUstep Makefile Package
39
# does not interpret these scripts; it require that you specify
40
# a list of directories which contain the scripts for the code to be
41
# tested, so that this information can be passed to dejagnu.
43
# Component C is dependent upon the type of code to be tested; generally
44
# an interactive program is its own test driver as it can communicate
45
# directly with dejagnu. Libraries, however, require a test driver which
46
# interactively accepts commands from dejagnu; the Objective-C Testing
47
# Framework is the default test driver.
49
# Test drivers for the various build targets; the names should be unique
50
# across all of the test drivers:
54
# xxx_OBJC_FILES, xxx_C_FILES, and xxx_PSWRAP_FILES holds the files
55
# to be compiled for the xxx test driver.
57
# xxx_SCRIPT_DIRS is a list of directories containing the test scripts
58
# which will be performed by dejagnu for the xxx test driver.
60
# xxx_SCRIPTS_DIRECTORY is the directory where the xxx_SCRIPT_DIRS
61
# are located for the xxx test driver.
63
# xxx_INCLUDE_DIRS are additional headers directories to be searched
65
# xxx_LIB_DIRS and xxx_LIBS are additional libraries directories and
66
# libraries to link against, respectively to link the xxx test driver.
67
# The same paths are passed to the dynamic linker.
70
SCRIPTS_DIRECTORY = $($(GNUSTEP_INSTANCE)_SCRIPTS_DIRECTORY)
71
CHECK_SCRIPT_DIRS = $($(GNUSTEP_INSTANCE)_SCRIPT_DIRS)
73
ifeq ($(SCRIPTS_DIRECTORY),)
77
ALL_TEST_LIBRARY_LIBS = \
78
$(shell $(WHICH_LIB_SCRIPT) \
80
$(ADDITIONAL_LIBRARY_LIBS) $(AUXILIARY_LIBS) \
81
$(AUXILIARY_TOOL_LIBS) $(FND_LIBS) $(OBJC_LIBS) \
82
$(TARGET_SYSTEM_LIBS) \
83
debug=$(debug) profile=$(profile) shared=$(shared) \
84
libext=$(LIBEXT) shared_libext=$(SHARED_LIBEXT))
86
internal-test_lib-all_:: $(GNUSTEP_OBJ_DIR) \
87
$(GNUSTEP_OBJ_DIR)/$(GNUSTEP_INSTANCE)
89
$(GNUSTEP_OBJ_DIR)/$(GNUSTEP_INSTANCE): $(OBJ_FILES_TO_LINK)
90
$(LD) $(ALL_LDFLAGS) -o $(LDOUT)$@ \
91
$(OBJ_FILES_TO_LINK) \
92
$(ALL_TEST_LIBRARY_LIBS)
94
dejagnu_vars = "FOUNDATION_LIBRARY=$(FOUNDATION_LIB)" \
95
"OBJC_RUNTIME=$(OBJC_RUNTIME)"
97
internal-test_lib-check:: $(SCRIPTS_DIRECTORY)/config/unix.exp \
100
really-test_lib-check:
101
@(additional_library_paths="`echo $(ADDITIONAL_LIB_DIRS) | sed 's/-L//g'`"; \
102
additional_library_paths="`$(GNUSTEP_MAKEFILES)/transform_paths.sh $$additional_library_paths`"; \
103
. $(GNUSTEP_MAKEFILES)/ld_lib_path.sh; \
104
for f in $(CHECK_SCRIPT_DIRS); do \
105
if [ "$(SCRIPTS_DIRECTORY)" != "" ]; then \
106
echo "cd $(SCRIPTS_DIRECTORY); runtest --tool $$f --srcdir . PROG=../$(GNUSTEP_OBJ_DIR)/$(GNUSTEP_INSTANCE) $(dejagnu_vars) $(ADDITIONAL_DEJAGNU_VARS)"; \
107
(cd $(SCRIPTS_DIRECTORY); runtest --tool $$f --srcdir . PROG=../$(GNUSTEP_OBJ_DIR)/$(GNUSTEP_INSTANCE) $(dejagnu_vars) $(ADDITIONAL_DEJAGNU_VARS)); \
109
runtest --tool $$f --srcdir . PROG=./$(GNUSTEP_INSTANCE) \
110
$(dejagnu_vars) $(ADDITIONAL_DEJAGNU_VARS); \
116
$(SCRIPTS_DIRECTORY)/config/unix.exp: _FORCE
117
$(ECHO_CREATING)$(MKDIRS) $(SCRIPTS_DIRECTORY)/config$(END_ECHO)
118
@(echo "Creating the $@ file..."; \
119
echo "## Do Not Edit ##" > $@; \
120
(echo "# Contents generated automatically by Makefile"; \
123
echo "set OBJC_RUNTIME $(OBJC_RUNTIME)"; \
124
echo "set FOUNDATION_LIBRARY $(FOUNDATION_LIB)"; \
126
echo "if {[file isdirectory $(GNUSTEP_USER_ROOT)/Library/Libraries/ObjCTest]} {"; \
127
echo " set OBJCTEST_DIR $(GNUSTEP_USER_ROOT)/Library/Libraries/ObjCTest"; \
128
echo "} elseif {[file isdirectory $(GNUSTEP_LOCAL_ROOT)/Library/Libraries/ObjCTest]} {"; \
129
echo " set OBJCTEST_DIR $(GNUSTEP_LOCAL_ROOT)/Library/Libraries/ObjCTest"; \
130
echo "} elseif {[file isdirectory $(GNUSTEP_SYSTEM_ROOT)/Library/Libraries/ObjCTest]} {"; \
131
echo " set OBJCTEST_DIR $(GNUSTEP_SYSTEM_ROOT)/Library/Libraries/ObjCTest"; \
133
echo "set objdir `pwd`"; \
134
echo "source \"\$$OBJCTEST_DIR/common.exp\""; \
136
echo "# Maintain your own code in local.exp"; \
137
echo "source \"config/local.exp\"") >>$@)
139
internal-test_lib-install_::
141
internal-test_lib-uninstall_::
143
include $(GNUSTEP_MAKEFILES)/Instance/Shared/strings.make