aboutsummaryrefslogtreecommitdiff
path: root/src/ccapi/test/Makefile.in
diff options
context:
space:
mode:
authorKevin Koch <kpkoch@mit.edu>2008-02-19 15:22:13 +0000
committerKevin Koch <kpkoch@mit.edu>2008-02-19 15:22:13 +0000
commit1ad7c24419422ce0d62c80699eb4cd30b1c3d51b (patch)
treea8d853bff3d5101093ed37a2a9cf8f3fbc8628fb /src/ccapi/test/Makefile.in
parentc90fb4c40ec4fb78e4d1b2a40c9c5af36225603c (diff)
downloadkrb5-1ad7c24419422ce0d62c80699eb4cd30b1c3d51b.zip
krb5-1ad7c24419422ce0d62c80699eb4cd30b1c3d51b.tar.gz
krb5-1ad7c24419422ce0d62c80699eb4cd30b1c3d51b.tar.bz2
Changes to integrate the CCAPI build into the build structure, build the test suite and fixes to random problems discovered along the way
Since no platform other than windows builds CCAPI using the build system, some conditionalizing may be necessary when other platforms use the makefiles. src/Makefile.in: Add CPPFLAGS that seemed to be missing; run wconfig for ccapi/(lib, server, test). config/win-pre.in: DEBUGOPT /ZI doesn't seem to provide enough debugging information under VS2005; /Zi does. windows/build/bkw.pl: Fix -no<switch> so that -nonodebug will work. Otherwise, can't do debug build. Move Get/PutTspData out of dllmain; add tlsindex argument. Comment out some debug messages. TargetVersion: 1.7 Component: krb5-libs Ticket: 5594 Tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20229 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/ccapi/test/Makefile.in')
-rw-r--r--src/ccapi/test/Makefile.in145
1 files changed, 122 insertions, 23 deletions
diff --git a/src/ccapi/test/Makefile.in b/src/ccapi/test/Makefile.in
index f0c10cb..7e71dcf 100644
--- a/src/ccapi/test/Makefile.in
+++ b/src/ccapi/test/Makefile.in
@@ -1,34 +1,110 @@
-thisconfigdir=../..
-myfulldir=ccapi/test
-mydir=ccapi/test
+thisconfigdir=..$(S)..
+myfulldir=ccapi$(S)test
+mydir=ccapi$(S)test
+BUILDTOP=..$(S)..
+
+!if defined(KRB5_KFW_COMPILE)
+KFWINC= /I$(BUILDTOP)\..\..\krbcc\include
+!endif
+
+# Because all the sources are in .,
+# the only includes we need are to directories outside of ccapi.
+LOCALINCLUDES = /I$(BUILDTOP) /I$(BUILDTOP)$(S)include /I$(BUILDTOP)$(S)include$(S)krb5 $(KFWINC) \
+ -I$(BUILDTOP)$(S)util$(S)et /I.
# run with "make all" to create CCAPI tests in "/tmp/ccapi_test"
# run resulting tests with "sh test_ccapi.sh"
-LIBS = -lkrb5
+##DOS##CPPFLAGS = $(CPPFLAGS) /EHsc -D_CRTAPI1=_cdecl -D_CRTAPI2=_cdecl -DWINVER=0x0501 \
+##DOS## -D_WIN32_WINNT=0x0501 -D_CRT_SECURE_NO_WARNINGS
-SRCDIR = src
-DSTROOT = /tmp
-OBJDIR = $(DSTROOT)/ccapi_intermediates
-DSTDIR = $(DSTROOT)/ccapi_test
-TESTDIR = $(DSTDIR)/tests
-
-SCRIPT_NAME = test_ccapi.sh
+##DOS##WINH = cci_debugging.h \
+##DOS## ccs_reply.h \
+##DOS## ccs_request.h \
+##DOS## ccs_request_c.c \
+##DOS## cci_stream.h \
+##DOS## cci_types.h \
+##DOS## win-utils.h
-OBJECTS = test_ccapi_ccache.o test_ccapi_check.o test_ccapi_constants.o test_ccapi_context.o test_ccapi_globals.o test_ccapi_iterators.o test_ccapi_log.o test_ccapi_util.o
-_OBJECTS = $(OBJECTS:.o=)
+SRCDIR = .
+DSTROOT = $(SRCDIR)
+OBJDIR = $(DSTROOT)$(S)ccapi_intermediates
+DSTDIR = $(DSTROOT)$(S)ccapi_test
+TESTDIR = $(DSTDIR)$(S)tests
-TEST_OBJECTS = test_constants.o test_cc_initialize.o test_cc_context_get_version.o test_cc_context_release.o test_cc_context_get_change_time.o test_cc_context_get_default_ccache_name.o test_cc_context_open_ccache.o test_cc_context_open_default_ccache.o test_cc_context_create_ccache.o test_cc_context_create_default_ccache.o test_cc_context_create_new_ccache.o test_cc_context_new_ccache_iterator.o test_cc_context_compare.o test_cc_ccache_release.o test_cc_ccache_destroy.o test_cc_ccache_set_default.o test_cc_ccache_get_credentials_version.o test_cc_ccache_get_name.o test_cc_ccache_get_principal.o test_cc_ccache_set_principal.o test_cc_ccache_store_credentials.o test_cc_ccache_remove_credentials.o test_cc_ccache_new_credentials_iterator.o test_cc_ccache_get_change_time.o test_cc_ccache_get_last_default_time.o test_cc_ccache_move.o test_cc_ccache_compare.o test_cc_ccache_get_kdc_time_offset.o test_cc_ccache_set_kdc_time_offset.o test_cc_ccache_clear_kdc_time_offset.o test_cc_ccache_iterator_next.o test_cc_credentials_iterator_next.o
-TEST_NAMES = $(TEST_OBJECTS:.o=)
+SCRIPT_NAME = test_ccapi.sh
-all: setup-test-dir simple_lock_test build-base build-tests link-tests copy-script success-message
+OBJECTS = $(OUTPRE)test_ccapi_ccache.$(OBJEXT) \
+ $(OUTPRE)test_ccapi_check.$(OBJEXT) \
+ $(OUTPRE)test_ccapi_constants.$(OBJEXT) \
+ $(OUTPRE)test_ccapi_context.$(OBJEXT) \
+ $(OUTPRE)test_ccapi_globals.$(OBJEXT) \
+ $(OUTPRE)test_ccapi_iterators.$(OBJEXT) \
+ $(OUTPRE)test_ccapi_log.$(OBJEXT) \
+ $(OUTPRE)test_ccapi_util.$(OBJEXT)
+
+PINGOBJS = $(OUTPRE)ccs_request_c.$(OBJEXT) \
+ $(OUTPRE)pingtest.$(OBJEXT) \
+ $(OBJECTS)
+
+TEST_NAMES = test_constants \
+ test_cc_initialize \
+ test_cc_context_get_version
+
+MORE_TESTS = test_cc_context_release \
+ test_cc_context_get_change_time \
+ test_cc_context_get_default_ccache_name \
+ test_cc_context_open_ccache \
+ test_cc_context_open_default_ccache \
+ test_cc_context_create_ccache \
+ test_cc_context_create_default_ccache \
+ test_cc_context_create_new_ccache \
+ test_cc_context_new_ccache_iterator \
+ test_cc_context_compare \
+ test_cc_ccache_release \
+ test_cc_ccache_destroy \
+ test_cc_ccache_set_default \
+ test_cc_ccache_get_credentials_version \
+ test_cc_ccache_get_name \
+ test_cc_ccache_get_principal \
+ test_cc_ccache_set_principal \
+ test_cc_ccache_store_credentials \
+ test_cc_ccache_remove_credentials \
+ test_cc_ccache_new_credentials_iterator \
+ test_cc_ccache_get_change_time \
+ test_cc_ccache_get_last_default_time \
+ test_cc_ccache_move \
+ test_cc_ccache_compare \
+ test_cc_ccache_get_kdc_time_offset \
+ test_cc_ccache_set_kdc_time_offset \
+ test_cc_ccache_clear_kdc_time_offset \
+ test_cc_ccache_iterator_next \
+ test_cc_credentials_iterator_next
+
+##### Linker
+LINK = link
+LIBS = -lkrb5
+##DOS##LIBS = advapi32.lib rpcrt4.lib user32.lib ws2_32.lib ccapi.lib
+LFLAGS = /nologo $(LOPTS)
+
+all-mac:: setup-test-dir pingtest stop_here simple_lock_test build-base build-tests link-tests copy-script success-message
+all-windows:: setup-windows build-base $(OUTPRE)pingtest.exe build-tests copy-script stop_here success-message
# compile base files used by all tests
-build-base: $(OBJECTS)
+build-base: $(PINGOBJS)
+##++ These two rules build each element of the list:
# compile each test
-build-tests: $(TEST_OBJECTS)
-
+build-tests: $(TEST_NAMES)
+ @echo build-tests complete.
+
+$(TEST_NAMES):
+ @echo DBG: $@
+ $(CC) $(ALL_CFLAGS) -Fe$(TESTDIR)$(S)$@.exe -Fd$(OBJDIR)$(S)$@.obj $@.c $(OBJECTS) $(LIBS)
+# Clean .obj from .:
+ $(RM) $@.$(OBJEXT)
+##-- These two rules build each element of the list.
+
# Make a build directory
setup-test-dir:
@echo "Removing old destination directory... $(DSTDIR)"
@@ -36,12 +112,35 @@ setup-test-dir:
mkdir -p "$(TESTDIR)"
if [ -d "$(OBJDIR)" ]; then chmod -R u+w "$(OBJDIR)" && rm -rf "$(OBJDIR)"; fi
mkdir -p "$(OBJDIR)"
+
+## The same trick as used in TEST_NAMES to run an action on each element ofthe list WINH:
+setup-windows: $(WINH)
+ if NOT exist $(TESTDIR) mkdir $(TESTDIR)
+ if NOT exist $(OBJDIR) mkdir $(OBJDIR)
+ set LINK = link
+
+# This rule assumes that nmake in ..\lib\win has already run.
+# That is how ..\Makefile.in is set up.
+$(WINH):
+ copy ..\lib\win\srctmp\$@ .
+
+# This rule assumes that nmake in ..\lib\win\ has already run.
+$(OUTPRE)pingtest.exe: $(OBJECTS)
+# There doesn't appear to be any way to examine a variable and return a value
+# indicating whether a string is present in it. We use a perl script to
+# check the LIB variable. If the path to ccapi.lib isn't present, the script
+# deletes a.tmp and the following nmake actions correct LIB.
+ echo %%PATH%% > a.tmp
+ perl setlib.pl
+ if not exist a.tmp (
+ @echo Adding ..\lib\win\srctmp to LIB
+ set LIB=%%LIB%%;..\lib\win\srctmp
+ )
+ $(LINK) $(linkdebug) /map:$(@B)1.map -out:$(*B)1.exe $(conflags) $(PINGOBJS) $(LIBS)
+ $(LINK) $(LFLAGS) /map:$(@B)2.map /out:$(*B)2.exe $(conflags) $(PINGOBJS) $(LIBS) $(conlibsdll)
link-tests: $(TEST_NAMES)
-$(TEST_NAMES): $(TEST_OBJECTS)
- $(CC) -o $(TESTDIR)/$@ $(OBJDIR)/$@.o $(OBJECTS) $(LIBS)
-
simple_lock_test:
$(CC) -o $(TESTDIR)/simple_lock_test simple_lock_test.c $(LIBS)
@@ -54,5 +153,5 @@ success-message:
.PHONY: clean
-clean:
+clean::
-rm -rf "$(OBJDIR)"