-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 14.04.2013 10:54, LRN wrote:
> This patch should integrate the testsuite imported from pthreads
> with winpthreads. (includes re-generated configure and Makefile.in
> - it is very sad that those are tracked in SVN).
>
OK, here is a better patch - split into parts, without generated
files. Say "think you" to git-svn and its wonderful awesomeness!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQEcBAEBAgAGBQJRaqqYAAoJEOs4Jb6SI2CwVOQH/iQJq/QHNUGJJfjfr6aj2afS
GCskdC8Hr3XvTSSltTx38UfvM8alQaKE2W+T21JakjHk380IYm6paqN/4LpB9lul
iM13Uu2SQiw7iZ6o5YHvuHgahMcCB+JpbtkcF6Ac5Egu/BEodQnp3tD73D19m5xo
jU7eJutnGneBjG1JCwaxTsNrD2IHujvkX1NpQp9P6TAw/Y6wpi7DmQ6gIReQVWgy
i3mpHIdRjlj5qY1R752o+ttKDXdVfkn7X3c96mR9rU6AdHwsaOIap9vwcmQRHRDt
GXV2F/v8NqbISTTZeeSJWcwQYtxDjHyoum+8THpDUj0D2h20oF+Gl5/hGbYcrzo=
=wWKE
-----END PGP SIGNATURE-----
From b10962796e7dbd89718a964edec9db9b58760c26 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1?=
=?UTF-8?q?=D1=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= <[email protected]>
Date: Sun, 14 Apr 2013 14:21:20 +0400
Subject: [PATCH 1/3] Integrate the testsuite
---
Makefile.am | 2 ++
configure.ac | 11 +++++++++-
tests/Makefile.am | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 78 insertions(+), 1 deletion(-)
create mode 100644 tests/Makefile.am
diff --git a/Makefile.am b/Makefile.am
index f117785..f57a553 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -33,6 +33,8 @@ libpthread_dll_a_DEPENDENCIES = libwinpthread.la
libpthread_dll_a_SOURCES =
endif
+SUBDIRS = tests
+
# Tell libtool how to use the resource compiler
.rc.lo:
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --tag=RC --mode=compile
$(RC) $(RCFLAGS) -i $< -o $@
diff --git a/configure.ac b/configure.ac
index b579286..40c3449 100644
--- a/configure.ac
+++ b/configure.ac
@@ -53,5 +53,14 @@ AC_TYPE_SIZE_T
AC_SUBST([RCFLAGS])
-AC_CONFIG_FILES([Makefile])
+AC_MSG_CHECKING(if benchmarking tests should be run)
+AC_ARG_ENABLE(
+ [benchmarks],
+ [AS_HELP_STRING([--enable-benchmarks], [enable benchmarking tests])],
+ [enable_benchmarks=${enableval}],
+ [enable_benchmarks=no])
+AC_MSG_RESULT($enable_benchmarks)
+AM_CONDITIONAL([ENABLE_BENCHMARKS], [test "x$enable_benchmarks" = "xyes"])
+
+AC_CONFIG_FILES([Makefile tests/Makefile])
AC_OUTPUT
diff --git a/tests/Makefile.am b/tests/Makefile.am
new file mode 100644
index 0000000..8aed465
--- /dev/null
+++ b/tests/Makefile.am
@@ -0,0 +1,66 @@
+INCLUDES = -I$(top_srcdir)/include
+
+LDADD = $(top_builddir)/libwinpthread.la
+
+noinst_LTLIBRARIES = \
+ libbench.la
+libbench_la_SOURCES = \
+ benchlib.c
+libbench_la_LIBADD = \
+ $(LDADD)
+
+if ENABLE_BENCHMARKS
+ BENCHMARKS = benchtest1 benchtest2 benchtest3 benchtest4 benchtest5
+else
+ BENCHMARKS =
+endif
+
+TESTS = \
+ sizes loadfree \
+ self1 mutex5 \
+ mutex1 mutex1n mutex1e mutex1r \
+ semaphore1 semaphore2 semaphore3 \
+ mutex2 mutex3 \
+ mutex2r mutex2e mutex3r mutex3e \
+ condvar1 condvar1_1 condvar1_2 condvar2 condvar2_1 \
+ exit1 create1 create2 reuse1 reuse2 equal1 \
+ kill1 valid1 valid2 \
+ exit2 exit3 exit4 exit5 \
+ join0 join1 detach1 join2 join3 \
+ mutex4 mutex6 mutex6n mutex6e mutex6r \
+ mutex6s mutex6es mutex6rs \
+ mutex7 mutex7n mutex7e mutex7r \
+ mutex8 mutex8n mutex8e mutex8r \
+ count1 \
+ once1 once2 once3 once4 \
+ self2 \
+ cancel1 cancel2 \
+ semaphore4 semaphore4t semaphore5 \
+ barrier1 barrier2 barrier3 barrier4 barrier5 barrier6 \
+ tsd1 tsd2 delay1 delay2 eyal1 \
+ condvar3 condvar3_1 condvar3_2 condvar3_3 \
+ condvar4 condvar5 condvar6 \
+ condvar7 condvar8 condvar9 \
+ errno1 \
+ rwlock1 rwlock2 rwlock3 rwlock4 \
+ rwlock5 rwlock6 rwlock7 rwlock8 \
+ rwlock2_t rwlock3_t rwlock4_t rwlock5_t rwlock6_t rwlock6_t2 \
+ context1 \
+ cancel3 cancel4 cancel5 cancel6a cancel6d \
+ cancel7 cancel8 \
+ cleanup0 cleanup1 cleanup2 cleanup3 \
+ priority1 priority2 inherit1 \
+ spin1 spin2 spin3 spin4 \
+ exception1 exception2 exception3 \
+ cancel9 create3 stress1 \
+ $(BENCHMARKS)
+
+cancel9_LDADD = $(LDADD) -lws2_32
+
+benchtest1_LDADD = $(LDADD) libbench.la
+benchtest2_LDADD = $(LDADD) libbench.la
+benchtest3_LDADD = $(LDADD) libbench.la
+benchtest4_LDADD = $(LDADD) libbench.la
+benchtest5_LDADD = $(LDADD) libbench.la
+
+noinst_PROGRAMS = $(TESTS)
--
1.8.0.3
From 4a2a7122823df8c30179fa5cc6a6f6b118e7788b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1?=
=?UTF-8?q?=D1=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= <[email protected]>
Date: Sun, 14 Apr 2013 14:21:44 +0400
Subject: [PATCH 2/3] Improve create2 test
---
tests/create2.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/tests/create2.c b/tests/create2.c
index 2ffb64e..db83c72 100644
--- a/tests/create2.c
+++ b/tests/create2.c
@@ -34,7 +34,9 @@
* --------------------------------------------------------------------------
*
* Test Synopsis:
- * - Test that threads have a Win32 handle when started.
+ * - Test that threads run after pthread_create(),
+ * end before pthread_join() returns,
+ * and that thread function code is executed.
*
* Test Method (Validation or Falsification):
* - Statistical, not absolute (depends on sample size).
@@ -81,7 +83,8 @@ static int washere = 0;
void * func(void * arg)
{
- washere = 1;
+ int *iptr = (int *) arg;
+ washere = *iptr;
return (void *) 0;
}
@@ -99,9 +102,9 @@ main()
for (i = 0; i < NUMTHREADS; i++)
{
washere = 0;
- assert(pthread_create(&t, &attr, func, NULL) == 0);
+ assert(pthread_create(&t, &attr, func, (void *) &i) == 0);
pthread_join(t, &result);
- assert(washere == 1);
+ assert(washere == i);
}
return 0;
--
1.8.0.3
From b17c850c435d6348c884ddd2f5a1bae2eaa4d864 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1?=
=?UTF-8?q?=D1=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= <[email protected]>
Date: Sun, 14 Apr 2013 14:31:57 +0400
Subject: [PATCH 3/3] Fix parallel builds
---
Makefile.am | 2 +-
tests/Makefile.am | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am
index f57a553..44f9b6b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -33,7 +33,7 @@ libpthread_dll_a_DEPENDENCIES = libwinpthread.la
libpthread_dll_a_SOURCES =
endif
-SUBDIRS = tests
+SUBDIRS = . tests
# Tell libtool how to use the resource compiler
.rc.lo:
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 8aed465..4b01811 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -8,6 +8,8 @@ libbench_la_SOURCES = \
benchlib.c
libbench_la_LIBADD = \
$(LDADD)
+libbench_la_DEPENDENCIES = \
+ $(LDADD)
if ENABLE_BENCHMARKS
BENCHMARKS = benchtest1 benchtest2 benchtest3 benchtest4 benchtest5
--
1.8.0.3
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public