Line data Source code
1 : // Author(s): Frank Stappers 2 : // Copyright: see the accompanying file COPYING or copy at 3 : // https://github.com/mCRL2org/mCRL2/blob/master/COPYING 4 : // 5 : // Distributed under the Boost Software License, Version 1.0. 6 : // (See accompanying file LICENSE_1_0.txt or copy at 7 : // http://www.boost.org/LICENSE_1_0.txt) 8 : // 9 : /// \file mcrl2/data/detail/rewrite_strategies.h 10 : /// \brief Utility functions for unit testing 11 : 12 : #ifndef MCRL2_DATA_DETAIL_REWRITE_STRATEGIES_H 13 : #define MCRL2_DATA_DETAIL_REWRITE_STRATEGIES_H 14 : 15 : #include "mcrl2/data/rewrite_strategy.h" 16 : #include <algorithm> 17 : #include <cctype> 18 : #include <fstream> 19 : #include <vector> 20 : 21 : namespace mcrl2 22 : { 23 : 24 : namespace data 25 : { 26 : 27 : namespace detail 28 : { 29 : 30 : /// \brief Static initialisation of rewrite strategies used for testing. 31 : static inline 32 12 : std::vector<data::rewrite_strategy> initialise_test_rewrite_strategies(const bool with_prover) 33 : { 34 12 : std::vector<data::rewrite_strategy> result; 35 12 : result.push_back(data::jitty); 36 12 : if (with_prover) 37 : { 38 0 : result.push_back(data::jitty_prover); 39 : } 40 : #ifdef MCRL2_TEST_JITTYC 41 : #ifdef MCRL2_ENABLE_JITTYC 42 : result.push_back(data::jitty_compiling); 43 : if (with_prover) 44 : { 45 : result.push_back(data::jitty_compiling_prover); 46 : } 47 : #endif // MCRL2_ENABLE_JITTYC 48 : #endif // MCRL2_TEST_JITTYC 49 : 50 12 : return result; 51 0 : } 52 : 53 : /// \brief Rewrite strategies that should be tested. 54 : inline 55 190 : const std::vector<data::rewrite_strategy>& get_test_rewrite_strategies(const bool with_prover) 56 : { 57 190 : static std::vector<data::rewrite_strategy> rewrite_strategies = initialise_test_rewrite_strategies(with_prover); 58 190 : return rewrite_strategies; 59 : } 60 : 61 : } // namespace detail 62 : 63 : } // namespace data 64 : 65 : } // namespace mcrl2 66 : 67 : #endif // MCRL2_DATA_DETAIL_REWRITE_STRATEGIES_H