$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r65841 - in sandbox/chrono/libs/chrono/test: . clock clock/hires clock/process clock/thread clock_req
From: vicente.botet_at_[hidden]
Date: 2010-10-08 14:37:34
Author: viboes
Date: 2010-10-08 14:37:31 EDT (Fri, 08 Oct 2010)
New Revision: 65841
URL: http://svn.boost.org/trac/boost/changeset/65841
Log:
Chrono: 
* Added Clock tests
Added:
   sandbox/chrono/libs/chrono/test/clock/check_clock_invariants.hpp   (contents, props changed)
   sandbox/chrono/libs/chrono/test/clock/check_clock_now.hpp   (contents, props changed)
   sandbox/chrono/libs/chrono/test/clock/process/
   sandbox/chrono/libs/chrono/test/clock/process/consistency.pass.cpp   (contents, props changed)
   sandbox/chrono/libs/chrono/test/clock/process/now.pass.cpp   (contents, props changed)
   sandbox/chrono/libs/chrono/test/clock/thread/
   sandbox/chrono/libs/chrono/test/clock/thread/consistency.pass.cpp   (contents, props changed)
   sandbox/chrono/libs/chrono/test/clock/thread/now.pass.cpp   (contents, props changed)
Removed:
   sandbox/chrono/libs/chrono/test/clock/nothing_to_do.pass.cpp
   sandbox/chrono/libs/chrono/test/clock_req/
Text files modified: 
   sandbox/chrono/libs/chrono/test/Jamfile.v2                       |     7 +++++++                                 
   sandbox/chrono/libs/chrono/test/clock/hires/consistency.pass.cpp |    28 ++--------------------------            
   sandbox/chrono/libs/chrono/test/clock/hires/now.pass.cpp         |    21 +++------------------                   
   3 files changed, 12 insertions(+), 44 deletions(-)
Modified: sandbox/chrono/libs/chrono/test/Jamfile.v2
==============================================================================
--- sandbox/chrono/libs/chrono/test/Jamfile.v2	(original)
+++ sandbox/chrono/libs/chrono/test/Jamfile.v2	2010-10-08 14:37:31 EDT (Fri, 08 Oct 2010)
@@ -221,6 +221,13 @@
         [ run clock/system/from_time_t.pass.cpp :  :  : <link>static : clock.system.from_time_t.pass ]
         [ run clock/system/rep_signed.pass.cpp :  :  : <link>static : clock.system.rep_signed.pass ]
         [ run clock/system/to_time_t.pass.cpp :  :  : <link>static : clock.system.to_time_t.pass ]
+        
+        [ run clock/process/consistency.pass.cpp :  :  : <link>static : clock.process.consistency.pass ]
+        [ run clock/process/now.pass.cpp :  :  : <link>static : clock.process.now.pass ]
+        
+        [ run clock/thread/consistency.pass.cpp :  :  : <link>static : clock.thread.consistency.pass ]
+        [ run clock/thread/now.pass.cpp :  :  : <link>static : clock.thread.now.pass ]
+        
         ;
 
 
Added: sandbox/chrono/libs/chrono/test/clock/check_clock_invariants.hpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/chrono/test/clock/check_clock_invariants.hpp	2010-10-08 14:37:31 EDT (Fri, 08 Oct 2010)
@@ -0,0 +1,24 @@
+//  Copyright 2010 Vicente J. Botet Escriba
+//  Distributed under the Boost Software License, Version 1.0.
+//  See http://www.boost.org/LICENSE_1_0.txt
+
+#ifndef BOOST_CHRONO_CHECK_CLOCK_INVARIANTS_HPP
+#define BOOST_CHRONO_CHECK_CLOCK_INVARIANTS_HPP
+
+#include <boost/type_traits/is_same.hpp>
+
+#if !defined(BOOST_NO_STATIC_ASSERT)
+#define NOTHING ""
+#endif
+
+template <typename Clock>
+void check_clock_invariants()
+{
+    BOOST_CHRONO_STATIC_ASSERT((boost::is_same<typename Clock::rep, typename Clock::duration::rep>::value), NOTHING, ());
+    BOOST_CHRONO_STATIC_ASSERT((boost::is_same<typename Clock::period, typename Clock::duration::period>::value), NOTHING, ());
+    BOOST_CHRONO_STATIC_ASSERT((boost::is_same<typename Clock::duration, typename Clock::time_point::duration>::value), NOTHING, ());
+    BOOST_CHRONO_STATIC_ASSERT(Clock::is_monotonic || !Clock::is_monotonic, NOTHING, ());
+    // to be replaced by has static member bool is_monotonic
+}
+
+#endif
Added: sandbox/chrono/libs/chrono/test/clock/check_clock_now.hpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/chrono/test/clock/check_clock_now.hpp	2010-10-08 14:37:31 EDT (Fri, 08 Oct 2010)
@@ -0,0 +1,16 @@
+//  Copyright 2010 Vicente J. Botet Escriba
+//  Distributed under the Boost Software License, Version 1.0.
+//  See http://www.boost.org/LICENSE_1_0.txt
+
+#ifndef BOOST_CHRONO_CHECK_CLOCK_NOW_HPP
+#define BOOST_CHRONO_CHECK_CLOCK_NOW_HPP
+
+#include <boost/chrono.hpp>
+
+template <typename Clock>
+void check_clock_now()
+{
+	typename Clock::time_point t1 = Clock::now();
+}
+
+#endif
Modified: sandbox/chrono/libs/chrono/test/clock/hires/consistency.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/clock/hires/consistency.pass.cpp	(original)
+++ sandbox/chrono/libs/chrono/test/clock/hires/consistency.pass.cpp	2010-10-08 14:37:31 EDT (Fri, 08 Oct 2010)
@@ -2,35 +2,11 @@
 //  Distributed under the Boost Software License, Version 1.0.
 //  See http://www.boost.org/LICENSE_1_0.txt
 
-// Adapted from llvm/libcxx/test/utilities/chrono
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <chrono>
-
-// high_resolution_clock
-
-// check clock invariants
-
 #include <boost/chrono.hpp>
-#include <boost/type_traits/is_same.hpp>
-
-#if !defined(BOOST_NO_STATIC_ASSERT)
-#define NOTHING ""
-#endif
+#include <libs/chrono/test/clock/check_clock_invariants.hpp>
 
 int main()
 {
-    typedef boost::chrono::high_resolution_clock C;
-    BOOST_CHRONO_STATIC_ASSERT((boost::is_same<C::rep, C::duration::rep>::value), NOTHING, ());
-    BOOST_CHRONO_STATIC_ASSERT((boost::is_same<C::period, C::duration::period>::value), NOTHING, ());
-    BOOST_CHRONO_STATIC_ASSERT((boost::is_same<C::duration, C::time_point::duration>::value), NOTHING, ());
-    BOOST_CHRONO_STATIC_ASSERT(C::is_monotonic || !C::is_monotonic, NOTHING, ());
+    check_clock_invariants<boost::chrono::high_resolution_clock>();
     return 0;    
 }
Modified: sandbox/chrono/libs/chrono/test/clock/hires/now.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/clock/hires/now.pass.cpp	(original)
+++ sandbox/chrono/libs/chrono/test/clock/hires/now.pass.cpp	2010-10-08 14:37:31 EDT (Fri, 08 Oct 2010)
@@ -2,27 +2,12 @@
 //  Distributed under the Boost Software License, Version 1.0.
 //  See http://www.boost.org/LICENSE_1_0.txt
 
-// Adapted from llvm/libcxx/test/utilities/chrono
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <chrono>
-
-// high_resolution_clock
-
-// static time_point now();
-
 #include <boost/chrono.hpp>
+//#include <libs/chrono/test/clock/check_clock_now.hpp>
+#include "../check_clock_now.hpp"
 
 int main()
 {
-    typedef boost::chrono::high_resolution_clock C;
-    C::time_point t1 = C::now();
+	check_clock_now<boost::chrono::high_resolution_clock>();
     return 0;    
 }
Deleted: sandbox/chrono/libs/chrono/test/clock/nothing_to_do.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/clock/nothing_to_do.pass.cpp	2010-10-08 14:37:31 EDT (Fri, 08 Oct 2010)
+++ (empty file)
@@ -1,12 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-int main()
-{
-}
Added: sandbox/chrono/libs/chrono/test/clock/process/consistency.pass.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/chrono/test/clock/process/consistency.pass.cpp	2010-10-08 14:37:31 EDT (Fri, 08 Oct 2010)
@@ -0,0 +1,16 @@
+//  Copyright 2010 Vicente J. Botet Escriba
+//  Distributed under the Boost Software License, Version 1.0.
+//  See http://www.boost.org/LICENSE_1_0.txt
+
+#include <boost/chrono.hpp>
+#include <boost/chrono/process_cpu_clocks.hpp>
+#include "../check_clock_invariants.hpp"
+
+int main()
+{
+    check_clock_invariants<boost::chrono::process_real_cpu_clock>();
+    check_clock_invariants<boost::chrono::process_user_cpu_clock>();
+    check_clock_invariants<boost::chrono::process_system_cpu_clock>();
+    check_clock_invariants<boost::chrono::process_cpu_clock>();
+    return 0;    
+}
Added: sandbox/chrono/libs/chrono/test/clock/process/now.pass.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/chrono/test/clock/process/now.pass.cpp	2010-10-08 14:37:31 EDT (Fri, 08 Oct 2010)
@@ -0,0 +1,16 @@
+//  Copyright 2010 Vicente J. Botet Escriba
+//  Distributed under the Boost Software License, Version 1.0.
+//  See http://www.boost.org/LICENSE_1_0.txt
+
+#include "../check_clock_now.hpp"
+#include <boost/chrono/process_cpu_clocks.hpp>
+#include <boost/chrono.hpp>
+
+int main()
+{
+	check_clock_now<boost::chrono::process_real_cpu_clock>();
+	check_clock_now<boost::chrono::process_user_cpu_clock>();
+	check_clock_now<boost::chrono::process_system_cpu_clock>();
+	check_clock_now<boost::chrono::process_cpu_clock>();
+    return 0;    
+}
Added: sandbox/chrono/libs/chrono/test/clock/thread/consistency.pass.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/chrono/test/clock/thread/consistency.pass.cpp	2010-10-08 14:37:31 EDT (Fri, 08 Oct 2010)
@@ -0,0 +1,15 @@
+//  Copyright 2010 Vicente J. Botet Escriba
+//  Distributed under the Boost Software License, Version 1.0.
+//  See http://www.boost.org/LICENSE_1_0.txt
+
+#include <boost/chrono.hpp>
+#include <boost/chrono/thread_clock.hpp>
+#include "../check_clock_invariants.hpp"
+
+int main()
+{
+#if defined(BOOST_CHRONO_HAS_THREAD_CLOCK) 
+    check_clock_invariants<boost::chrono::thread_clock>();
+#endif    
+    return 0;    
+}
Added: sandbox/chrono/libs/chrono/test/clock/thread/now.pass.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/chrono/test/clock/thread/now.pass.cpp	2010-10-08 14:37:31 EDT (Fri, 08 Oct 2010)
@@ -0,0 +1,16 @@
+//  Copyright 2010 Vicente J. Botet Escriba
+//  Distributed under the Boost Software License, Version 1.0.
+//  See http://www.boost.org/LICENSE_1_0.txt
+
+
+#include "../check_clock_now.hpp"
+#include <boost/chrono/thread_clock.hpp>
+#include <boost/chrono.hpp>
+
+int main()
+{
+#if defined(BOOST_CHRONO_HAS_THREAD_CLOCK) 
+	check_clock_now<boost::chrono::thread_clock>();
+#endif    
+    return 0;    
+}