medfall

A super great game engine
Log | Files | Refs

test_suite.hpp (1254B)


      1 /*  Relacy Race Detector
      2  *  Copyright (c) 2008-2013, Dmitry S. Vyukov
      3  *  All rights reserved.
      4  *  This software is provided AS-IS with no warranty, either express or implied.
      5  *  This software is distributed under a license and may not be copied,
      6  *  modified or distributed except as expressly authorized under the
      7  *  terms of the license contained in the file LICENSE in this distribution.
      8  */
      9 
     10 #ifndef RL_TEST_SUITE_HPP
     11 #define RL_TEST_SUITE_HPP
     12 #ifdef _MSC_VER
     13 #   pragma once
     14 #endif
     15 
     16 #include "base.hpp"
     17 #include "test_result.hpp"
     18 
     19 
     20 namespace rl
     21 {
     22 
     23 
     24 template<
     25     typename derived_t,
     26     thread_id_t static_thread_count_param,
     27     test_result_e result = test_result_success>
     28 struct test_suite : nocopy<>
     29 {
     30     static thread_id_t const dynamic_thread_count = 0;
     31 
     32     struct params
     33     {
     34         static thread_id_t const static_thread_count = static_thread_count_param;
     35         static thread_id_t const dynamic_thread_count = derived_t::dynamic_thread_count;
     36         static thread_id_t const thread_count = static_thread_count + dynamic_thread_count;
     37         static test_result_e const expected_result = result;
     38     };
     39 
     40     void invariant() {}
     41     void before() {}
     42     void after() {}
     43 };
     44 
     45 
     46 }
     47 
     48 #endif