pull up r24469, r24530, r24533, r24534, r24535, r24537 from trunk
[krb5.git] / src / ccapi / test / Makefile.in
index 7e71dcf63ed01b298ee4ada560fa40bb0cb63e4a..bf950b6a7f490701c07b44d3ed4ee4d88d0aa49d 100644 (file)
@@ -1,16 +1,15 @@
-thisconfigdir=..$(S)..
-myfulldir=ccapi$(S)test
 mydir=ccapi$(S)test
 BUILDTOP=..$(S)..
+CCAPI=$(BUILDTOP)$(S)CCAPI
 
 !if defined(KRB5_KFW_COMPILE)
 KFWINC= /I$(BUILDTOP)\..\..\krbcc\include
 !endif
 
-# Because all the sources are in ., 
+# 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.
+    -I$(BUILDTOP)$(S)util$(S)et /I. -I$(CCAPI)$(S)COMMON -I$(CCAPI)$(S)LIB
 
 # run with "make all" to create CCAPI tests in "/tmp/ccapi_test"
 # run resulting tests with "sh test_ccapi.sh"
@@ -22,15 +21,32 @@ LOCALINCLUDES = /I$(BUILDTOP) /I$(BUILDTOP)$(S)include /I$(BUILDTOP)$(S)include$
 ##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
 
+##DOS##LIBSRC=ccapi_ccache.c \
+##DOS##       ccapi_ccache_iterator.c \
+##DOS##       ccapi_context.c \
+##DOS##       ccapi_context_change_time.c \
+##DOS##       ccapi_err.c \
+##DOS##       ccapi_ipc.c \
+##DOS##       ccapi_credentials.c \
+##DOS##       ccapi_credentials_iterator.c \
+##DOS##       ccapi_string.c \
+##DOS##       ccapi_v2.c
+
+##DOS##COMSRC=cci_cred_union.c \
+##DOS##       cci_identifier.c \
+##DOS##       cci_message.c
+
+##DOS##COWSRC=cci_os_identifier.c
+
 SRCDIR  = .
 DSTROOT = $(SRCDIR)
 OBJDIR  = $(DSTROOT)$(S)ccapi_intermediates
 DSTDIR  = $(DSTROOT)$(S)ccapi_test
 TESTDIR = $(DSTDIR)$(S)tests
+SRCTMP  = $(SRCDIR)\srctmp
 
 SCRIPT_NAME = test_ccapi.sh
 
@@ -38,19 +54,38 @@ OBJECTS =   $(OUTPRE)test_ccapi_ccache.$(OBJEXT) \
             $(OUTPRE)test_ccapi_check.$(OBJEXT) \
             $(OUTPRE)test_ccapi_constants.$(OBJEXT) \
             $(OUTPRE)test_ccapi_context.$(OBJEXT) \
+            $(OUTPRE)test_ccapi_v2.$(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) \
+PINGOBJS =  $(OUTPRE)ccapi_ccache.$(OBJEXT) \
+            $(OUTPRE)ccapi_ccache_iterator.$(OBJEXT) \
+            $(OUTPRE)ccapi_context.$(OBJEXT) \
+            $(OUTPRE)ccapi_context_change_time.$(OBJEXT) \
+            $(OUTPRE)ccapi_err.$(OBJEXT) \
+            $(OUTPRE)ccapi_ipc.$(OBJEXT) \
+            $(OUTPRE)ccapi_credentials.$(OBJEXT) \
+            $(OUTPRE)ccapi_credentials_iterator.$(OBJEXT) \
+            $(OUTPRE)ccapi_string.$(OBJEXT) \
+            $(OUTPRE)ccapi_v2.$(OBJEXT) \
+            $(OUTPRE)cci_cred_union.$(OBJEXT) \
+            $(OUTPRE)cci_identifier.$(OBJEXT) \
+            $(OUTPRE)cci_os_identifier.$(OBJEXT) \
+            $(OUTPRE)cci_message.$(OBJEXT) \
+            $(OUTPRE)ccs_request_c.$(OBJEXT) \
             $(OUTPRE)pingtest.$(OBJEXT) \
             $(OBJECTS)
 
-TEST_NAMES =    test_constants \
+TESTALLOBJS=$(OUTPRE)main.$(OBJEXT) \
+            $(OBJECTS)
+
+TEST_NAMES =    test_cc_ccache_iterator_next \
+                test_constants \
                 test_cc_initialize \
-                test_cc_context_get_version 
-                
+                test_cc_credentials_iterator_next
+
 MORE_TESTS =    test_cc_context_release \
                 test_cc_context_get_change_time \
                 test_cc_context_get_default_ccache_name \
@@ -78,17 +113,33 @@ MORE_TESTS =    test_cc_context_release \
                 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
+                test_cc_shutdown \
+                test_cc_get_change_time \
+                test_cc_open \
+                test_cc_create \
+                test_cc_close \
+                test_cc_destroy \
+                test_cc_get_cred_version \
+                test_cc_get_name \
+                test_cc_get_principal \
+                test_cc_set_principal \
+                test_cc_store \
+                test_cc_remove_cred \
+                test_cc_seq_fetch_NCs_begin \
+                test_cc_seq_fetch_NCs_next \
+                test_cc_seq_fetch_creds_begin \
+                test_cc_seq_fetch_creds_next \
+                test_cc_get_NC_info
+
 
 ##### Linker
 LINK   = link
 LIBS    = -lkrb5
-##DOS##LIBS = advapi32.lib rpcrt4.lib user32.lib ws2_32.lib ccapi.lib
+##DOS##LIBS = $(CLIB) $(SLIB) 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
+all-mac::     setup-test-dir pingtest simple_lock_test build-base build-tests link-tests copy-script success-message
+all-windows:: setup-windows build-base $(OUTPRE)pingtest.exe build-tests build-testall copy-script success-message
 
 # compile base files used by all tests
 build-base: $(PINGOBJS)
@@ -97,14 +148,14 @@ build-base: $(PINGOBJS)
 # compile each test
 build-tests: $(TEST_NAMES)
     @echo build-tests complete.
-    
-$(TEST_NAMES): 
-    @echo DBG: $@    
+
+$(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)"
@@ -112,22 +163,31 @@ 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)
+setup-windows: $(WINH) $(LIBSRC) $(COMSRC) $(COWSRC)
        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\$@ .
 
+$(LIBSRC):
+    copy ..\lib\$@ .
+
+$(COMSRC):
+    copy ..\common\$@ .
+
+$(COWSRC):
+    copy ..\common\win\$@ .
+
 # 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 
+$(OUTPRE)pingtest.exe: $(OBJECTS) $(PINGOBJS)
+# 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
@@ -136,16 +196,22 @@ $(OUTPRE)pingtest.exe: $(OBJECTS)
         @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) $(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)
 
+build-testall: $(TEST_NAMES) $(OBJECTS) $(TESTALLOBJS) testall.exe
+
+testall.exe:
+    $(LINK) $(linkdebug) /map:$(@B)1.map -out:$(*B)1.exe $(conflags) $(TESTALLOBJS) $(LIBS) $(conslibdll)
+
+
 simple_lock_test:
        $(CC) -o $(TESTDIR)/simple_lock_test simple_lock_test.c $(LIBS)
 
 copy-script:
-       cp $(SCRIPT_NAME) $(DSTDIR)/$(SCRIPT_NAME)
+       $(CP) $(SCRIPT_NAME) $(DSTDIR)$(S)$(SCRIPT_NAME)
 
 success-message:
        @echo