Boost logo

Threads-Devel :

Subject: Re: [Threads-devel] PATCH: Disable native_handle tests on win32 to make all unit-tests pass
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2013-01-05 08:37:39


Le 05/01/13 11:18, Fredrik Orderud a écrit :
> Currently, 10 of the boost thread unit-tests on trunk fail when
> building with msvc-11 (Microsoft Visual Studio 2012). All of the
> failing tests are due to native_handle() methods not being implemented
> on win32 [1]. The boost thread synchronization doc states that
> native_handle() is an optional method that is not available on all
> platforms [2]. Therefore, one can argue that the lack of
> native_handle() must not necessarily be treated as an error in the
> tests. I've therefore attached a patch that disables native_handle
> tests on win32, so that all unit-tests pass.
>
> The reason for my request is that it would be very nice with a
> error-free unit-test baseline prior to implementing changes to the
> thread library.
>
>
Hi,

I have found an alternative that consists in not running the test when
threadapi is win32

Please could you check the following patch?

I would commit it if it works for you.

Best,
Vicente

svn diff libs/thread/test/Jamfile.v2
Index: libs/thread/test/Jamfile.v2
===================================================================
--- libs/thread/test/Jamfile.v2 (revision 82351)
+++ libs/thread/test/Jamfile.v2 (working copy)
@@ -132,6 +132,20 @@
      ;
  }

+rule thread-run2-noit-pthread ( sources : name )
+{
+ return
+ [ run $(sources) ../build//boost_thread : : :
<threadapi>win32:<build>no
+ : $(name) ]
+ [ run $(sources) ../src/tss_null.cpp
../build//boost_thread/<link>static
+ : : : <threadapi>win32:<build>no
+ : $(name)_lib ]
+ #[ run $(sources) ../build//boost_thread : : :
+ # <define>BOOST_THREAD_DONT_PROVIDE_INTERRUPTIONS
+ # : $(name)_noit ]
+ ;
+}
+
  rule thread-run2-h ( sources : name )
  {
      return
@@ -253,7 +267,7 @@
            [ thread-compile-fail
./sync/conditions/condition_variable/copy_fail.cpp : :
condition_variable__copy_f ]
            [ thread-run2-noit
./sync/conditions/condition_variable/default_pass.cpp :
condition_variable__default_p ]
            [ thread-run2-noit
./sync/conditions/condition_variable/dtor_pass.cpp :
condition_variable__dtor_p ]
- [ thread-run2-noit
./sync/conditions/condition_variable/native_handle_pass.cpp :
condition_variable__native_handle_p ]
+ [ thread-run2-noit-pthread
./sync/conditions/condition_variable/native_handle_pass.cpp :
condition_variable__native_handle_p ]
            [ thread-run2-noit
./sync/conditions/condition_variable/wait_pass.cpp :
condition_variable__wait_p ]
            [ thread-run2-noit
./sync/conditions/condition_variable/wait_for_pass.cpp :
condition_variable__wait_for_p ]
            [ thread-run2-noit
./sync/conditions/condition_variable/wait_for_pred_pass.cpp :
condition_variable__wait_for_pred_p ]
@@ -502,7 +516,7 @@
            [ thread-compile-fail
./sync/mutual_exclusion/mutex/copy_fail.cpp : : mutex__copy_f ]
            [ thread-run2-noit
./sync/mutual_exclusion/mutex/default_pass.cpp : mutex__default_p ]
            [ thread-run2-noit
./sync/mutual_exclusion/mutex/lock_pass.cpp : mutex__lock_p ]
- [ thread-run2-noit
./sync/mutual_exclusion/mutex/native_handle_pass.cpp :
mutex__native_handle_p ]
+ [ thread-run2-noit-pthread
./sync/mutual_exclusion/mutex/native_handle_pass.cpp :
mutex__native_handle_p ]
            [ thread-run2-noit
./sync/mutual_exclusion/mutex/try_lock_pass.cpp : mutex__try_lock_p ]
      ;

@@ -513,7 +527,7 @@
            [ thread-compile-fail
./sync/mutual_exclusion/recursive_mutex/copy_fail.cpp : :
recursive_mutex__copy_f ]
            [ thread-run2-noit
./sync/mutual_exclusion/recursive_mutex/default_pass.cpp :
recursive_mutex__default_p ]
            [ thread-run2-noit
./sync/mutual_exclusion/recursive_mutex/lock_pass.cpp :
recursive_mutex__lock_p ]
- [ thread-run2-noit
./sync/mutual_exclusion/recursive_mutex/native_handle_pass.cpp :
recursive_mutex__native_handle_p ]
+ [ thread-run2-noit-pthread
./sync/mutual_exclusion/recursive_mutex/native_handle_pass.cpp :
recursive_mutex__native_handle_p ]
            [ thread-run2-noit
./sync/mutual_exclusion/recursive_mutex/try_lock_pass.cpp :
recursive_mutex__try_lock_p ]
      ;

@@ -524,7 +538,7 @@
            [ thread-compile-fail
./sync/mutual_exclusion/recursive_timed_mutex/copy_fail.cpp : :
recursive_timed_mutex__copy_f ]
            [ thread-run2-noit
./sync/mutual_exclusion/recursive_timed_mutex/default_pass.cpp :
recursive_timed_mutex__default_p ]
            [ thread-run2-noit
./sync/mutual_exclusion/recursive_timed_mutex/lock_pass.cpp :
recursive_timed_mutex__lock_p ]
- [ thread-run2-noit
./sync/mutual_exclusion/recursive_timed_mutex/native_handle_pass.cpp :
recursive_timed_mutex__native_handle_p ]
+ [ thread-run2-noit-pthread
./sync/mutual_exclusion/recursive_timed_mutex/native_handle_pass.cpp :
recursive_timed_mutex__native_handle_p ]
            [ thread-run2-noit
./sync/mutual_exclusion/recursive_timed_mutex/try_lock_for_pass.cpp :
recursive_timed_mutex__try_lock_for_p ]
            [ thread-run2-noit
./sync/mutual_exclusion/recursive_timed_mutex/try_lock_pass.cpp :
recursive_timed_mutex__try_lock_p ]
            [ thread-run2-noit
./sync/mutual_exclusion/recursive_timed_mutex/try_lock_until_pass.cpp :
recursive_timed_mutex__try_lock_until_p ]
@@ -537,7 +551,7 @@
            [ thread-compile-fail
./sync/mutual_exclusion/timed_mutex/copy_fail.cpp : : timed_mutex__copy_f ]
            [ thread-run2-noit
./sync/mutual_exclusion/timed_mutex/default_pass.cpp :
timed_mutex__default_p ]
            [ thread-run2-noit
./sync/mutual_exclusion/timed_mutex/lock_pass.cpp : timed_mutex__lock_p ]
- [ thread-run2-noit
./sync/mutual_exclusion/timed_mutex/native_handle_pass.cpp :
timed_mutex__native_handle_p ]
+ [ thread-run2-noit-pthread
./sync/mutual_exclusion/timed_mutex/native_handle_pass.cpp :
timed_mutex__native_handle_p ]
            [ thread-run2-noit
./sync/mutual_exclusion/timed_mutex/try_lock_for_pass.cpp :
timed_mutex__try_lock_for_p ]
            [ thread-run2-noit
./sync/mutual_exclusion/timed_mutex/try_lock_pass.cpp :
timed_mutex__try_lock_p ]
            [ thread-run2-noit
./sync/mutual_exclusion/timed_mutex/try_lock_until_pass.cpp :
timed_mutex__try_lock_until_p ]


Threads-Devel list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk