~ubuntu-branches/ubuntu/edgy/sope/edgy

« back to all changes in this revision

Viewing changes to gnustep-make/Instance/test-library.make

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Ley
  • Date: 2005-08-19 16:53:31 UTC
  • Revision ID: james.westby@ubuntu.com-20050819165331-hs683wz1osm708pw
Tags: upstream-4.4rc.2
ImportĀ upstreamĀ versionĀ 4.4rc.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
#   Instance/test-library.make
 
3
#
 
4
#   Instance Makefile rules for dejagnu/GNUstep based testing
 
5
#
 
6
#   Copyright (C) 1997 Free Software Foundation, Inc.
 
7
#
 
8
#   Author:  Scott Christley <scottc@net-community.com>
 
9
#   Author:  Ovidiu Predescu <ovidiu@net-community.com>
 
10
#
 
11
#   This file is part of the GNUstep Makefile Package.
 
12
#
 
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.
 
17
#   
 
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.
 
22
 
 
23
ifeq ($(RULES_MAKE_LOADED),)
 
24
include $(GNUSTEP_MAKEFILES)/rules.make
 
25
endif
 
26
 
 
27
#
 
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
 
31
# c) test driver
 
32
#
 
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.
 
37
#
 
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.
 
42
#
 
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.
 
48
#
 
49
# Test drivers for the various build targets; the names should be unique
 
50
# across all of the test drivers:
 
51
#
 
52
# TEST_LIBRARY_NAME
 
53
#
 
54
# xxx_OBJC_FILES, xxx_C_FILES, and xxx_PSWRAP_FILES holds the files
 
55
# to be compiled for the xxx test driver.
 
56
#
 
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.
 
59
#
 
60
# xxx_SCRIPTS_DIRECTORY is the directory where the xxx_SCRIPT_DIRS
 
61
# are located for the xxx test driver.
 
62
#
 
63
# xxx_INCLUDE_DIRS are additional headers directories to be searched
 
64
#
 
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.
 
68
#
 
69
 
 
70
SCRIPTS_DIRECTORY = $($(GNUSTEP_INSTANCE)_SCRIPTS_DIRECTORY)
 
71
CHECK_SCRIPT_DIRS = $($(GNUSTEP_INSTANCE)_SCRIPT_DIRS)
 
72
 
 
73
ifeq ($(SCRIPTS_DIRECTORY),)
 
74
SCRIPTS_DIRECTORY = .
 
75
endif
 
76
 
 
77
ALL_TEST_LIBRARY_LIBS =                                         \
 
78
    $(shell $(WHICH_LIB_SCRIPT)                                 \
 
79
        $(ALL_LIB_DIRS)                                         \
 
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))
 
85
 
 
86
internal-test_lib-all_:: $(GNUSTEP_OBJ_DIR) \
 
87
                         $(GNUSTEP_OBJ_DIR)/$(GNUSTEP_INSTANCE)
 
88
 
 
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)
 
93
 
 
94
dejagnu_vars = "FOUNDATION_LIBRARY=$(FOUNDATION_LIB)" \
 
95
                "OBJC_RUNTIME=$(OBJC_RUNTIME)"
 
96
 
 
97
internal-test_lib-check:: $(SCRIPTS_DIRECTORY)/config/unix.exp \
 
98
        really-testlib-check
 
99
 
 
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)); \
 
108
          else \
 
109
            runtest --tool $$f --srcdir . PROG=./$(GNUSTEP_INSTANCE) \
 
110
                  $(dejagnu_vars) $(ADDITIONAL_DEJAGNU_VARS); \
 
111
          fi; \
 
112
        done)
 
113
 
 
114
_FORCE::
 
115
 
 
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"; \
 
121
        echo "#"; \
 
122
        echo ""; \
 
123
        echo "set OBJC_RUNTIME $(OBJC_RUNTIME)"; \
 
124
        echo "set FOUNDATION_LIBRARY $(FOUNDATION_LIB)"; \
 
125
        echo ""; \
 
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"; \
 
132
        echo "}"; \
 
133
        echo "set objdir `pwd`"; \
 
134
        echo "source \"\$$OBJCTEST_DIR/common.exp\""; \
 
135
        echo ""; \
 
136
        echo "# Maintain your own code in local.exp"; \
 
137
        echo "source \"config/local.exp\"") >>$@)
 
138
 
 
139
internal-test_lib-install_::
 
140
 
 
141
internal-test_lib-uninstall_::
 
142
 
 
143
include $(GNUSTEP_MAKEFILES)/Instance/Shared/strings.make