2
myfulldir=ccapi$(S)test
5
CCAPI=$(BUILDTOP)$(S)CCAPI
7
!if defined(KRB5_KFW_COMPILE)
8
KFWINC= /I$(BUILDTOP)\..\..\krbcc\include
11
# Because all the sources are in .,
12
# the only includes we need are to directories outside of ccapi.
13
LOCALINCLUDES = /I$(BUILDTOP) /I$(BUILDTOP)$(S)include /I$(BUILDTOP)$(S)include$(S)krb5 $(KFWINC) \
14
-I$(BUILDTOP)$(S)util$(S)et /I. -I$(CCAPI)$(S)COMMON -I$(CCAPI)$(S)LIB
16
# run with "make all" to create CCAPI tests in "/tmp/ccapi_test"
17
# run resulting tests with "sh test_ccapi.sh"
19
##DOS##CPPFLAGS = $(CPPFLAGS) /EHsc -D_CRTAPI1=_cdecl -D_CRTAPI2=_cdecl -DWINVER=0x0501 \
20
##DOS## -D_WIN32_WINNT=0x0501 -D_CRT_SECURE_NO_WARNINGS
22
##DOS##WINH = cci_debugging.h \
24
##DOS## ccs_request.h \
25
##DOS## ccs_request_c.c \
26
##DOS## cci_stream.h \
30
##DOS##LIBSRC=ccapi_ccache.c \
31
##DOS## ccapi_ccache_iterator.c \
32
##DOS## ccapi_context.c \
33
##DOS## ccapi_context_change_time.c \
35
##DOS## ccapi_credentials.c \
36
##DOS## ccapi_credentials_iterator.c \
37
##DOS## ccapi_string.c \
40
##DOS##COMSRC=cci_cred_union.c \
41
##DOS## cci_identifier.c \
42
##DOS## cci_message.c \
45
##DOS##COWSRC=cci_os_identifier.c
49
OBJDIR = $(DSTROOT)$(S)ccapi_intermediates
50
DSTDIR = $(DSTROOT)$(S)ccapi_test
51
TESTDIR = $(DSTDIR)$(S)tests
52
SRCTMP = $(SRCDIR)\srctmp
54
SCRIPT_NAME = test_ccapi.sh
56
OBJECTS = $(OUTPRE)test_ccapi_ccache.$(OBJEXT) \
57
$(OUTPRE)test_ccapi_check.$(OBJEXT) \
58
$(OUTPRE)test_ccapi_constants.$(OBJEXT) \
59
$(OUTPRE)test_ccapi_context.$(OBJEXT) \
60
$(OUTPRE)test_ccapi_v2.$(OBJEXT) \
61
$(OUTPRE)test_ccapi_globals.$(OBJEXT) \
62
$(OUTPRE)test_ccapi_iterators.$(OBJEXT) \
63
$(OUTPRE)test_ccapi_log.$(OBJEXT) \
64
$(OUTPRE)test_ccapi_util.$(OBJEXT)
66
PINGOBJS = $(OUTPRE)ccapi_ccache.$(OBJEXT) \
67
$(OUTPRE)ccapi_ccache_iterator.$(OBJEXT) \
68
$(OUTPRE)ccapi_context.$(OBJEXT) \
69
$(OUTPRE)ccapi_context_change_time.$(OBJEXT) \
70
$(OUTPRE)ccapi_ipc.$(OBJEXT) \
71
$(OUTPRE)ccapi_credentials.$(OBJEXT) \
72
$(OUTPRE)ccapi_credentials_iterator.$(OBJEXT) \
73
$(OUTPRE)ccapi_string.$(OBJEXT) \
74
$(OUTPRE)ccapi_v2.$(OBJEXT) \
75
$(OUTPRE)cci_cred_union.$(OBJEXT) \
76
$(OUTPRE)cci_identifier.$(OBJEXT) \
77
$(OUTPRE)cci_os_identifier.$(OBJEXT) \
78
$(OUTPRE)cci_message.$(OBJEXT) \
79
$(OUTPRE)cci_stream.$(OBJEXT) \
80
$(OUTPRE)ccs_request_c.$(OBJEXT) \
81
$(OUTPRE)pingtest.$(OBJEXT) \
84
TESTALLOBJS=$(OUTPRE)main.$(OBJEXT) \
87
TEST_NAMES = test_cc_ccache_iterator_next \
90
test_cc_credentials_iterator_next
92
MORE_TESTS = test_cc_context_release \
93
test_cc_context_get_change_time \
94
test_cc_context_get_default_ccache_name \
95
test_cc_context_open_ccache \
96
test_cc_context_open_default_ccache \
97
test_cc_context_create_ccache \
98
test_cc_context_create_default_ccache \
99
test_cc_context_create_new_ccache \
100
test_cc_context_new_ccache_iterator \
101
test_cc_context_compare \
102
test_cc_ccache_release \
103
test_cc_ccache_destroy \
104
test_cc_ccache_set_default \
105
test_cc_ccache_get_credentials_version \
106
test_cc_ccache_get_name \
107
test_cc_ccache_get_principal \
108
test_cc_ccache_set_principal \
109
test_cc_ccache_store_credentials \
110
test_cc_ccache_remove_credentials \
111
test_cc_ccache_new_credentials_iterator \
112
test_cc_ccache_get_change_time \
113
test_cc_ccache_get_last_default_time \
114
test_cc_ccache_move \
115
test_cc_ccache_compare \
116
test_cc_ccache_get_kdc_time_offset \
117
test_cc_ccache_set_kdc_time_offset \
118
test_cc_ccache_clear_kdc_time_offset \
120
test_cc_get_change_time \
125
test_cc_get_cred_version \
127
test_cc_get_principal \
128
test_cc_set_principal \
130
test_cc_remove_cred \
131
test_cc_seq_fetch_NCs_begin \
132
test_cc_seq_fetch_NCs_next \
133
test_cc_seq_fetch_creds_begin \
134
test_cc_seq_fetch_creds_next \
141
##DOS##LIBS = advapi32.lib rpcrt4.lib user32.lib ws2_32.lib ccapi.lib
142
LFLAGS = /nologo $(LOPTS)
144
all-mac:: setup-test-dir pingtest simple_lock_test build-base build-tests link-tests copy-script success-message
145
all-windows:: setup-windows build-base $(OUTPRE)pingtest.exe build-tests build-testall copy-script success-message
147
# compile base files used by all tests
148
build-base: $(PINGOBJS)
150
##++ These two rules build each element of the list:
152
build-tests: $(TEST_NAMES)
153
@echo build-tests complete.
157
$(CC) $(ALL_CFLAGS) -Fe$(TESTDIR)$(S)$@.exe -Fd$(OBJDIR)$(S)$@.obj $@.c $(OBJECTS) $(LIBS)
160
##-- These two rules build each element of the list.
162
# Make a build directory
164
@echo "Removing old destination directory... $(DSTDIR)"
165
if [ -d "$(DSTDIR)" ]; then chmod -R u+w "$(DSTDIR)" && rm -rf "$(DSTDIR)"; fi
166
mkdir -p "$(TESTDIR)"
167
if [ -d "$(OBJDIR)" ]; then chmod -R u+w "$(OBJDIR)" && rm -rf "$(OBJDIR)"; fi
170
## The same trick as used in TEST_NAMES to run an action on each element ofthe list WINH:
171
setup-windows: $(WINH) $(LIBSRC) $(COMSRC) $(COWSRC)
172
if NOT exist $(TESTDIR) mkdir $(TESTDIR)
173
if NOT exist $(OBJDIR) mkdir $(OBJDIR)
176
# This rule assumes that nmake in ..\lib\win has already run.
177
# That is how ..\Makefile.in is set up.
179
copy ..\lib\win\srctmp\$@ .
188
copy ..\common\win\$@ .
190
# This rule assumes that nmake in ..\lib\win\ has already run.
191
$(OUTPRE)pingtest.exe: $(OBJECTS) $(PINGOBJS)
192
# There doesn't appear to be any way to examine a variable and return a value
193
# indicating whether a string is present in it. We use a perl script to
194
# check the LIB variable. If the path to ccapi.lib isn't present, the script
195
# deletes a.tmp and the following nmake actions correct LIB.
196
echo %%PATH%% > a.tmp
199
@echo Adding ..\lib\win\srctmp to LIB
200
set LIB=%%LIB%%;..\lib\win\srctmp
202
$(LINK) $(linkdebug) /map:$(@B)1.map -out:$(*B)1.exe $(conflags) $(PINGOBJS) $(LIBS)
203
$(LINK) $(LFLAGS) /map:$(@B)2.map /out:$(*B)2.exe $(conflags) $(PINGOBJS) $(LIBS) $(conlibsdll)
205
link-tests: $(TEST_NAMES)
207
build-testall: $(TEST_NAMES) $(OBJECTS) $(TESTALLOBJS) testall.exe
210
$(LINK) $(linkdebug) /map:$(@B)1.map -out:$(*B)1.exe $(conflags) $(TESTALLOBJS) $(LIBS) $(conslibdll)
214
$(CC) -o $(TESTDIR)/simple_lock_test simple_lock_test.c $(LIBS)
220
cp $(SCRIPT_NAME) $(DSTDIR)$(S)$(SCRIPT_NAME)
224
@echo "CCAPI tests created in $(DSTDIR)"