1 mydir=lib$(S)rpc$(S)unit-test
2 BUILDTOP=$(REL)..$(S)..$(S)..
4 OBJS= client.o rpc_test_clnt.o rpc_test_svc.o server.o
5 SRCS= client.c rpc_test_clnt.c rpc_test_svc.c server.c
9 client: client.o rpc_test_clnt.o $(GSSRPC_DEPLIBS) $(KRB5_BASE_DEPLIBS)
10 $(CC_LINK) -o client client.o rpc_test_clnt.o \
11 $(GSSRPC_LIBS) $(KRB5_BASE_LIBS)
13 server: server.o rpc_test_svc.o $(GSSRPC_DEPLIBS) $(KRB5_BASE_DEPLIBS)
14 $(CC_LINK) -o server server.o rpc_test_svc.o \
15 $(GSSRPC_LIBS) $(KRB5_BASE_LIBS)
17 client.o server.o: rpc_test.h
19 # If rpc_test.h and rpc_test_*.c do not work on your system, you can
20 # try using rpcgen by uncommenting these lines (be sure to uncomment
21 # then in the generated not Makefile.in).
22 # rpc_test.h rpc_test_clnt.c rpc_test_svc.c: rpc_test.x
23 # -rm -f rpc_test_clnt.c rpc_test_svc.c rpc_test.h
24 # -ln -s $(srcdir)/rpc_test.x .
25 # rpcgen -l rpc_test.x -o rpc_test_clnt.c
26 # rpcgen -m rpc_test.x -o rpc_test_svc.c
27 # rpcgen -h rpc_test.x -o rpc_test.h
30 # rm -f rpc_test.h rpc_test_clnt.c rpc_test_svc.c
33 check unit-test: unit-test-@DO_TEST@
37 @echo "+++ WARNING: lib/rpc unit tests not run."
38 @echo "+++ Either tcl, runtest, or Perl is unavailable."
40 @echo 'Skipped rpc tests: runtest or Perl not found' >> $(SKIPTESTS)
42 unit-test-ok: unit-test-body
46 $(RM) krb5cc_rpc_test_*
47 $(ENV_SETUP) $(VALGRIND) $(START_SERVERS)
48 RPC_TEST_SRVTAB=/tmp/rpc_test_v5srvtab.$$$$ ; export RPC_TEST_SRVTAB ; \
49 trap "echo Failed, cleaning up... ; rm -f $$RPC_TEST_SRVTAB ; $(ENV_SETUP) $(STOP_SERVERS) ; trap '' 0 ; exit 1" 0 1 2 3 14 15 ; \
51 $(RUNTEST) SERVER=./server CLIENT=./client \
52 KINIT=$(BUILDTOP)/clients/kinit/kinit \
53 KDESTROY=$(BUILDTOP)/clients/kdestroy/kdestroy \
54 PRIOCNTL_HACK=@PRIOCNTL_HACK@ VALGRIND="$(VALGRIND)" \
55 PASS="$(PASS)" --tool rpc_test $(RUNTESTFLAGS) ; \
57 echo Cleaning up... ; \
58 rm -f $$RPC_TEST_SRVTAB krb5cc_rpc_test_* ; \
59 $(ENV_SETUP) $(STOP_SERVERS) ; \
65 $(RM) dbg.log rpc_test.log rpc_test.sum