From 4b8ca0cba45b88803f99b9d91d2a8c7ec7f9f46d Mon Sep 17 00:00:00 2001 From: rpj Date: Fri, 1 Apr 2005 09:13:32 +0000 Subject: '' --- tests/ChangeLog | 6 ++++++ tests/GNUmakefile | 15 ++++++++++++++- tests/Makefile | 12 ++++++++++++ tests/self1.c | 7 +++++++ 4 files changed, 39 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/ChangeLog b/tests/ChangeLog index 7b03968..87cb3b0 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,9 @@ +2005-04-01 Ross Johnson + + * GNUmakefile: Add target to test linking static link library. + * Makefile: Likewise. + * self1.c: Run process attach/detach routines when static linked. + 2005-03-16 Ross Johnson * mutex5.c: Prevent optimiser from removing asserts. diff --git a/tests/GNUmakefile b/tests/GNUmakefile index b8b1c91..2f3cf85 100644 --- a/tests/GNUmakefile +++ b/tests/GNUmakefile @@ -74,7 +74,6 @@ COPYFILES = $(HDR) $(LIB) $(DLL) $(QAPC) # If a test case returns a non-zero exit code to the shell, make will # stop. -XTESTS = once3 TESTS = sizes loadfree \ self1 mutex5 mutex1 mutex1e mutex1n mutex1r \ semaphore1 semaphore2 semaphore3 \ @@ -108,8 +107,12 @@ TESTS = sizes loadfree \ BENCHTESTS = \ benchtest1 benchtest2 benchtest3 benchtest4 benchtest5 +STATICTESTS = \ + self1 + PASSES = $(TESTS:%=%.pass) BENCHRESULTS = $(BENCHTESTS:%=%.bench) +STATICRESULTS = $(STATICTESTS:%=%.pass) help: @ $(ECHO) "Run one of the following command lines:" @@ -118,6 +121,7 @@ help: @ $(ECHO) "make clean GCE (to test using GCE dll with C++ (EH) applications)" @ $(ECHO) "make clean GC-bench (to benchtest using GNU C dll with C cleanup code)" @ $(ECHO) "make clean GCE-bench (to benchtest using GNU C dll with C++ exception handling)" + @ $(ECHO) "make clean GC-static (to test using GC static lib with C (no EH) applications)" all: @ $(MAKE) clean GC @@ -139,12 +143,20 @@ GC-bench: GCE-bench: $(MAKE) TEST=GCE CC=g++ XXCFLAGS="-mthreads -D__CLEANUP_CXX" XXLIBS="benchlib." all-bench +GC-static: + $(MAKE) TEST=GC CC=gcc XXCFLAGS="-D__CLEANUP_C -DPTW32_STATIC_LIB" DLL="" all-static + all-pass: $(PASSES) @ $(ECHO) ALL TESTS PASSED! Congratulations! all-bench: $(BENCHRESULTS) @ $(ECHO) BENCH TESTS COMPLETED. +all-static: $(STATICRESULTS) + @ $(ECHO) ALL STATIC TESTS PASSED! Congratulations! + @ $(ECHO) Build and test the DLL to run all tests. + @ $(ECHO) This test only confirms that the static lib links correctly. + benchtest1.bench: benchtest2.bench: benchtest3.bench: @@ -332,4 +344,5 @@ clean: - $(RM) *.exe - $(RM) *.pass - $(RM) *.bench + - $(RM) *.static - $(RM) *.log diff --git a/tests/Makefile b/tests/Makefile index 3b75670..6e6ecf3 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -120,6 +120,9 @@ PASSES= sizes.pass loadfree.pass \ BENCHRESULTS = \ benchtest1.bench benchtest2.bench benchtest3.bench benchtest4.bench benchtest5.bench +STATICRESULTS = \ + self1.pass + help: @ $(ECHO) Run one of the following command lines: @ $(ECHO) nmake clean VC (to test using VC dll with VC (no EH) applications) @@ -130,6 +133,7 @@ help: @ $(ECHO) nmake clean VCX-bench (to benchtest using VC dll with C++ bench app) @ $(ECHO) nmake clean VCE-bench (to benchtest using VCE dll with C++ bench app) @ $(ECHO) nmake clean VSE-bench (to benchtest using VSE dll with SEH bench app) + @ $(ECHO) nmake clean VC-static (to test using VC static lib with VC (no EH) applications) all: @ nmake clean VC @@ -148,6 +152,11 @@ tests: $(CPLIB) $(CPDLL) $(CPHDR) $(QAPC) $(PASSES) benchtests: $(CPLIB) $(CPDLL) $(CPHDR) $(XXLIBS) $(BENCHRESULTS) @ $(ECHO) ALL BENCH TESTS DONE. +statictests: $(CPLIB) $(CPDLL) $(CPHDR) $(STATICRESULTS) + @ $(ECHO) ALL STATIC TESTS DONE. + @ $(ECHO) Build and test the DLL to run all tests. + @ $(ECHO) The static test only confirms that the .lib links correctly. + sizes.pass: sizes.exe @ $(ECHO) ... Running $(TEST)$(DLL_VER) test: $*.exe @ .\$*.exe > SIZES.$(TEST) @@ -191,6 +200,9 @@ VC-bench: VCX-bench: @ nmake TEST="$@" CPLIB="$(VCLIB)" CPDLL="$(VCDLL)" EHFLAGS="$(VCXFLAGS)" XXLIBS="benchlib.o" benchtests +VC-static: + @ nmake TEST="$@" CPLIB="$(VCLIB)" CPDLL="" EHFLAGS="$(VCFLAGS) /DPTW32_STATIC_LIB" statictests + .c.exe: @ $(ECHO) $(CC) $(EHFLAGS) $(CFLAGS) $(INCLUDES) $< /Fe$@ /link $(LFLAGS) $(CPLIB) $(XXLIBS) @ $(CC) $(EHFLAGS) $(CFLAGS) $(INCLUDES) $< /Fe$@ /link $(LFLAGS) $(CPLIB) $(XXLIBS) diff --git a/tests/self1.c b/tests/self1.c index 773aee1..59498d9 100644 --- a/tests/self1.c +++ b/tests/self1.c @@ -54,9 +54,16 @@ main(int argc, char * argv[]) */ pthread_t self; +#ifdef PTW32_STATIC_LIB + pthread_win32_process_attach_np(); +#endif + self = pthread_self(); assert(self.p != NULL); +#ifdef PTW32_STATIC_LIB + pthread_win32_process_detach_np(); +#endif return 0; } -- cgit v1.2.3