diff options
author | rpj <rpj> | 2005-04-01 09:00:27 +0000 |
---|---|---|
committer | rpj <rpj> | 2005-04-01 09:00:27 +0000 |
commit | f7d9daf2243a111623aff7856b24632ef49cefcc (patch) | |
tree | 8bc4fabc31812fb64d2d4ac558f07908757b01a6 /tests | |
parent | f6f9976af7a520dd1aeced4f104f4d4711f28e23 (diff) |
''
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ChangeLog | 6 | ||||
-rw-r--r-- | tests/GNUmakefile | 15 | ||||
-rw-r--r-- | tests/Makefile | 12 | ||||
-rw-r--r-- | tests/self1.c | 7 |
4 files changed, 39 insertions, 1 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog index edf7ded..3d152ba 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,9 @@ +2005-04-01 Ross Johnson <ross@desk.home> + + * 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 <rpj@callisto.canberra.edu.au>
* mutex5.c: Prevent optimiser from removing asserts. diff --git a/tests/GNUmakefile b/tests/GNUmakefile index 08709a8..4ecce80 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 dfb0f3c..f9dfd41 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; } |