<commit_before>﻿//======================================================================
//-----------------------------------------------------------------------
/**
 * @file        iutest_option_message.hpp
 * @brief       iris unit test コマンドラインメッセージ ファイル
 *
 * @author      t.shirayanagi
 * @par         copyright
 * Copyright (C) 2011-2018, <NAME>\n
 * This software is released under the new BSD License,
 * see LICENSE
*/
//-----------------------------------------------------------------------
//======================================================================
#ifndef INCG_IRIS_IUTEST_OPTION_MESSAGE_HPP_00EB9B17_0615_4678_9AD0_1F5B295B404F_
#define INCG_IRIS_IUTEST_OPTION_MESSAGE_HPP_00EB9B17_0615_4678_9AD0_1F5B295B404F_

//======================================================================
// include
#include "iutest_console.hpp"

namespace iutest {
namespace detail
{

//======================================================================
// class
class iuOptionMessage
{
public:
    /**
     * @brief   ヘルプの出力
    */
    static void ShowHelp();
    /**
     * @brief   バージョン出力
    */
    static void ShowVersion();
    /**
     * @brief   機能出力
    */
    static void ShowFeature();
    /**
     * @brief   コンパイラスペック出力
    */
    static void ShowSpec();
};

inline void iuOptionMessage::ShowHelp()
{
    const char* readme =
        "--------------------------------------------------\n"
        "Name\n"
        "    iutest - iris unit test framework\n"
        "--------------------------------------------------\n"
        "Command Line Options\n"
        "\n"
        "    --help, -h                       : Generate help message.\n"
        "    --iutest_list_tests              : List up tests.\n"
        "    --iutest_list_tests_with_where   : List up tests with where.\n"
        "    --iutest_color=<yes|no|auto|ansi>: Console color enable.\n"
        "    --iutest_flagfile=<file>         : Set the flag from the file.\n"
        "    --iutest_filter=<filter>         : Select the test run.\n"
        "    --iutest_shuffle                 : Do shuffle test.\n"
        "    --iutest_random_seed=<seed>      : Set random seed.\n"
        "    --iutest_also_run_disabled_tests : Run disabled tests.\n"
        "    --iutest_break_on_failure[=0|1]  : When that failed to break.\n"
        "    --iutest_throw_on_failure[=0|1]  : When that failed to throw.\n"
        "    --iutest_catch_exceptions=<0|1>  : Catch exceptions enable.\n"
        "    --iutest_print_time=<0|1>        : Setting the display of elapsed time.\n"
        "    --iutest_default_package_name=<name>\n"
        "            : Set default root package name.\n"
        "    --iutest_output=<xml|junit>[:path]\n"
        "            : Path of xml report.\n"
        "    --iutest_repeat=<count>\n"
        "            : Set the number of repetitions of the test.\n"
        "              use a negative count to repeat forever.\n"
#if IUTEST_HAS_STREAM_RESULT
        "    --iutest_stream_result_to=<host:port>\n"
        "                                     : Set stream test results server.\n"
#endif
        "    --iutest_file_location=<auto|vs|gcc>\n"
        "                                     : Format file location messages.\n"
        "    --verbose                        : Verbose option.\n"
        "    --feature                        : Show iutest feature.\n"
        "    --version, -v                    : Show iutest version.\n"
        "\n"
        "--------------------------------------------------\n"
        "License\n"
        "\n"
        "    Copyright (c) 2011-2018, Takazumi-Shirayanagi\n"
        "\n"
        "    This software is released under the new BSD License, see LICENSE\n"
        "\n";
    detail::iuConsole::color_output(detail::iuConsole::cyan, readme);
}

inline void iuOptionMessage::ShowVersion()
{
    detail::iuConsole::output("iutest version %x.%x.%x.%x\n"
        , IUTEST_MAJORVER, IUTEST_MINORVER, IUTEST_BUILD, IUTEST_REVISION);
}

/** @private */
#define IIUT_SHOW_MACRO(macro)  IIUT_SHOW_MACRO_I(#macro, IUTEST_PP_TOSTRING(macro))
#define IIUT_SHOW_MACRO_I(name, value)  detail::iuConsole::output("#define %s  %s\n", name, value)
#define IIUT_SHOW_ENABLE_MACRO(macro)   IUTEST_PP_IF(macro, IIUT_SHOW_MACRO_I(#macro, IUTEST_PP_TOSTRING(macro)), IUTEST_PP_EMPTY())
#define IIUT_SHOW_DISABLE_MACRO(macro)  IUTEST_PP_IF(macro, IUTEST_PP_EMPTY(), IIUT_SHOW_MACRO_I(#macro, IUTEST_PP_TOSTRING(macro)))

/** @private */
#define IIUT_SHOW_FEATURE_MACROS(m) \
    m (IUTEST_HAS_ANY_PARAM_TEST); \
    m (IUTEST_HAS_ASSERTION_NOEQUALTO_OBJECT); \
    m (IUTEST_HAS_ASSERTION_RETURN); \
    m (IUTEST_HAS_AUTOFIXTURE_PARAM_TEST); \
    m (IUTEST_HAS_COMBINE); \
    m (IUTEST_HAS_CONCAT); \
    m (IUTEST_HAS_CSVPARAMS); \
    m (IUTEST_HAS_EXCEPTIONS); \
    m (IUTEST_HAS_GENRAND); \
    m (IUTEST_HAS_IGNORE_TEST); \
    m (IUTEST_HAS_LONG_DOUBLE); \
    m (IUTEST_HAS_LIB); \
    m (IUTEST_HAS_MATCHERS); \
    m (IUTEST_HAS_MATCHER_ALLOF_AND_ANYOF); \
    m (IUTEST_HAS_MATCHER_ELEMENTSARE); \
    m (IUTEST_HAS_MATCHER_REGEX); \
    m (IUTEST_HAS_MINIDUMP); \
    m (IUTEST_HAS_PACKAGE); \
    m (IUTEST_HAS_PAIRWISE); \
    m (IUTEST_HAS_PARAM_METHOD_TEST); \
    m (IUTEST_HAS_PARAM_TEST); \
    m (IUTEST_HAS_PARAM_TEST_PARAM_NAME_GENERATOR); \
    m (IUTEST_HAS_PEEP); \
    m (IUTEST_HAS_PEEP_CLASS); \
    m (IUTEST_HAS_PEEP_FUNC); \
    m (IUTEST_HAS_PEEP_STATIC_FUNC); \
    m (IUTEST_HAS_PRINT_TO); \
    m (IUTEST_HAS_RANDOMVALUES); \
    m (IUTEST_HAS_REGEX); \
    m (IUTEST_HAS_REPORT_SKIPPED); \
    m (IUTEST_HAS_SOCKET); \
    m (IUTEST_HAS_SPI_LAMBDA_SUPPORT); \
    m (IUTEST_HAS_STATIC_ASSERT); \
    m (IUTEST_HAS_STATIC_ASSERT_TYPEEQ); \
    m (IUTEST_HAS_STREAM_BUFFER); \
    m (IUTEST_HAS_STREAM_RESULT); \
    m (IUTEST_HAS_TESTFIXTURE_ALIAS_BY_TUPLE); \
    m (IUTEST_HAS_TESTNAME_ALIAS); \
    m (IUTEST_HAS_TESTNAME_ALIAS_JP); \
    m (IUTEST_HAS_TYPED_TEST); \
    m (IUTEST_HAS_TYPED_TEST_APPEND_TYPENAME); \
    m (IUTEST_HAS_TYPED_TEST_P); \
    m (IUTEST_HAS_VALUESGEN); \
    m (IUTEST_HAS_VARIADIC_COMBINE); \
    m (IUTEST_HAS_VARIADIC_PAIRWISE); \
    m (IUTEST_HAS_VARIADIC_VALUES)

inline void iuOptionMessage::ShowFeature()
{
#if 0
    IIUT_SHOW_FEATURE_MACROS(IIUT_SHOW_MACRO);
#else
    IIUT_SHOW_FEATURE_MACROS(IIUT_SHOW_ENABLE_MACRO);
    IIUT_SHOW_FEATURE_MACROS(IIUT_SHOW_DISABLE_MACRO);
#endif
}

inline void iuOptionMessage::ShowSpec()
{
    IIUT_SHOW_MACRO(IUTEST_PLATFORM);

    IIUT_SHOW_MACRO(IUTEST_CHECK_STRICT);
    IIUT_SHOW_MACRO(IUTEST_HAS_ANALYSIS_ASSUME);
    IIUT_SHOW_MACRO(IUTEST_HAS_ATTRIBUTE);
    IIUT_SHOW_MACRO(IUTEST_HAS_AUTO);
    IIUT_SHOW_MACRO(IUTEST_HAS_CATCH_SEH_EXCEPTION_ASSERTION);
    IIUT_SHOW_MACRO(IUTEST_HAS_CHAR16_T);
    IIUT_SHOW_MACRO(IUTEST_HAS_CHAR32_T);
    IIUT_SHOW_MACRO(IUTEST_HAS_CLOCK);
    IIUT_SHOW_MACRO(IUTEST_HAS_CONSTEXPR);
    IIUT_SHOW_MACRO(IUTEST_HAS_CONSTEXPR_IF);
    IIUT_SHOW_MACRO(IUTEST_HAS_COUNTER_MACRO);
    IIUT_SHOW_MACRO(IUTEST_HAS_CTIME);
    IIUT_SHOW_MACRO(IUTEST_HAS_CXX_HDR_ARRAY);
    IIUT_SHOW_MACRO(IUTEST_HAS_CXX_HDR_CHRONO);
    IIUT_SHOW_MACRO(IUTEST_HAS_CXX_HDR_CODECVT);
    IIUT_SHOW_MACRO(IUTEST_HAS_CXX_HDR_CSTDINT);
    IIUT_SHOW_MACRO(IUTEST_HAS_CXX_HDR_CUCHAR);
    IIUT_SHOW_MACRO(IUTEST_HAS_CXX_HDR_RANDOM);
    IIUT_SHOW_MACRO(IUTEST_HAS_CXX_HDR_REGEX);
    IIUT_SHOW_MACRO(IUTEST_HAS_CXX11);
    IIUT_SHOW_MACRO(IUTEST_HAS_DECLTYPE);
    IIUT_SHOW_MACRO(IUTEST_HAS_DELETED_FUNCTIONS);
    IIUT_SHOW_MACRO(IUTEST_HAS_EXCEPTIONS);
    IIUT_SHOW_MACRO(IUTEST_HAS_EXPLICIT_CONVERSION);
    IIUT_SHOW_MACRO(IUTEST_HAS_EXTERN_TEMPLATE);
    IIUT_SHOW_MACRO(IUTEST_HAS_GETTIMEOFDAY);
    IIUT_SHOW_MACRO(IUTEST_HAS_HDR_CXXABI);<commit_msg>add spec message<commit_after>﻿//======================================================================
//-----------------------------------------------------------------------
/**
 * @file        iutest_option_message.hpp
 * @brief       iris unit test コマンドラインメッセージ ファイル
 *
 * @author      t.shirayanagi
 * @par         copyright
 * Copyright (C) 2011-2018, <NAME>\n
 * This software is released under the new BSD License,
 * see LICENSE
*/
//-----------------------------------------------------------------------
//======================================================================
#ifndef INCG_IRIS_IUTEST_OPTION_MESSAGE_HPP_00EB9B17_0615_4678_9AD0_1F5B295B404F_
#define INCG_IRIS_IUTEST_OPTION_MESSAGE_HPP_00EB9B17_0615_4678_9AD0_1F5B295B404F_

//======================================================================
// include
#include "iutest_console.hpp"

namespace iutest {
namespace detail
{

//======================================================================
// class
class iuOptionMessage
{
public:
    /**
     * @brief   ヘルプの出力
    */
    static void ShowHelp();
    /**
     * @brief   バージョン出力
    */
    static void ShowVersion();
    /**
     * @brief   機能出力
    */
    static void ShowFeature();
    /**
     * @brief   コンパイラスペック出力
    */
    static void ShowSpec();
};

inline void iuOptionMessage::ShowHelp()
{
    const char* readme =
        "--------------------------------------------------\n"
        "Name\n"
        "    iutest - iris unit test framework\n"
        "--------------------------------------------------\n"
        "Command Line Options\n"
        "\n"
        "    --help, -h                       : Generate help message.\n"
        "    --iutest_list_tests              : List up tests.\n"
        "    --iutest_list_tests_with_where   : List up tests with where.\n"
        "    --iutest_color=<yes|no|auto|ansi>: Console color enable.\n"
        "    --iutest_flagfile=<file>         : Set the flag from the file.\n"
        "    --iutest_filter=<filter>         : Select the test run.\n"
        "    --iutest_shuffle                 : Do shuffle test.\n"
        "    --iutest_random_seed=<seed>      : Set random seed.\n"
        "    --iutest_also_run_disabled_tests : Run disabled tests.\n"
        "    --iutest_break_on_failure[=0|1]  : When that failed to break.\n"
        "    --iutest_throw_on_failure[=0|1]  : When that failed to throw.\n"
        "    --iutest_catch_exceptions=<0|1>  : Catch exceptions enable.\n"
        "    --iutest_print_time=<0|1>        : Setting the display of elapsed time.\n"
        "    --iutest_default_package_name=<name>\n"
        "            : Set default root package name.\n"
        "    --iutest_output=<xml|junit>[:path]\n"
        "            : Path of xml report.\n"
        "    --iutest_repeat=<count>\n"
        "            : Set the number of repetitions of the test.\n"
        "              use a negative count to repeat forever.\n"
#if IUTEST_HAS_STREAM_RESULT
        "    --iutest_stream_result_to=<host:port>\n"
        "                                     : Set stream test results server.\n"
#endif
        "    --iutest_file_location=<auto|vs|gcc>\n"
        "                                     : Format file location messages.\n"
        "    --verbose                        : Verbose option.\n"
        "    --feature                        : Show iutest feature.\n"
        "    --version, -v                    : Show iutest version.\n"
        "\n"
        "--------------------------------------------------\n"
        "License\n"
        "\n"
        "    Copyright (c) 2011-2018, Takazumi-Shirayanagi\n"
        "\n"
        "    This software is released under the new BSD License, see LICENSE\n"
        "\n";
    detail::iuConsole::color_output(detail::iuConsole::cyan, readme);
}

inline void iuOptionMessage::ShowVersion()
{
    detail::iuConsole::output("iutest version %x.%x.%x.%x\n"
        , IUTEST_MAJORVER, IUTEST_MINORVER, IUTEST_BUILD, IUTEST_REVISION);
}

/** @private */
#define IIUT_SHOW_MACRO(macro)  IIUT_SHOW_MACRO_I(#macro, IUTEST_PP_TOSTRING(macro))
#define IIUT_SHOW_MACRO_I(name, value)  detail::iuConsole::output("#define %s  %s\n", name, value)
#define IIUT_SHOW_ENABLE_MACRO(macro)   IUTEST_PP_IF(macro, IIUT_SHOW_MACRO_I(#macro, IUTEST_PP_TOSTRING(macro)), IUTEST_PP_EMPTY())
#define IIUT_SHOW_DISABLE_MACRO(macro)  IUTEST_PP_IF(macro, IUTEST_PP_EMPTY(), IIUT_SHOW_MACRO_I(#macro, IUTEST_PP_TOSTRING(macro)))

/** @private */
#define IIUT_SHOW_FEATURE_MACROS(m) \
    m (IUTEST_HAS_ANY_PARAM_TEST); \
    m (IUTEST_HAS_ASSERTION_NOEQUALTO_OBJECT); \
    m (IUTEST_HAS_ASSERTION_RETURN); \
    m (IUTEST_HAS_AUTOFIXTURE_PARAM_TEST); \
    m (IUTEST_HAS_COMBINE); \
    m (IUTEST_HAS_CONCAT); \
    m (IUTEST_HAS_CSVPARAMS); \
    m (IUTEST_HAS_EXCEPTIONS); \
    m (IUTEST_HAS_GENRAND); \
    m (IUTEST_HAS_IGNORE_TEST); \
    m (IUTEST_HAS_LONG_DOUBLE); \
    m (IUTEST_HAS_LIB); \
    m (IUTEST_HAS_MATCHERS); \
    m (IUTEST_HAS_MATCHER_ALLOF_AND_ANYOF); \
    m (IUTEST_HAS_MATCHER_ELEMENTSARE); \
    m (IUTEST_HAS_MATCHER_REGEX); \
    m (IUTEST_HAS_MINIDUMP); \
    m (IUTEST_HAS_PACKAGE); \
    m (IUTEST_HAS_PAIRWISE); \
    m (IUTEST_HAS_PARAM_METHOD_TEST); \
    m (IUTEST_HAS_PARAM_TEST); \
    m (IUTEST_HAS_PARAM_TEST_PARAM_NAME_GENERATOR); \
    m (IUTEST_HAS_PEEP); \
    m (IUTEST_HAS_PEEP_CLASS); \
    m (IUTEST_HAS_PEEP_FUNC); \
    m (IUTEST_HAS_PEEP_STATIC_FUNC); \
    m (IUTEST_HAS_PRINT_TO); \
    m (IUTEST_HAS_RANDOMVALUES); \
    m (IUTEST_HAS_REGEX); \
    m (IUTEST_HAS_REPORT_SKIPPED); \
    m (IUTEST_HAS_SOCKET); \
    m (IUTEST_HAS_SPI_LAMBDA_SUPPORT); \
    m (IUTEST_HAS_STATIC_ASSERT); \
    m (IUTEST_HAS_STATIC_ASSERT_TYPEEQ); \
    m (IUTEST_HAS_STREAM_BUFFER); \
    m (IUTEST_HAS_STREAM_RESULT); \
    m (IUTEST_HAS_TESTFIXTURE_ALIAS_BY_TUPLE); \
    m (IUTEST_HAS_TESTNAME_ALIAS); \
    m (IUTEST_HAS_TESTNAME_ALIAS_JP); \
    m (IUTEST_HAS_TYPED_TEST); \
    m (IUTEST_HAS_TYPED_TEST_APPEND_TYPENAME); \
    m (IUTEST_HAS_TYPED_TEST_P); \
    m (IUTEST_HAS_VALUESGEN); \
    m (IUTEST_HAS_VARIADIC_COMBINE); \
    m (IUTEST_HAS_VARIADIC_PAIRWISE); \
    m (IUTEST_HAS_VARIADIC_VALUES)

inline void iuOptionMessage::ShowFeature()
{
#if 0
    IIUT_SHOW_FEATURE_MACROS(IIUT_SHOW_MACRO);
#else
    IIUT_SHOW_FEATURE_MACROS(IIUT_SHOW_ENABLE_MACRO);
    IIUT_SHOW_FEATURE_MACROS(IIUT_SHOW_DISABLE_MACRO);
#endif
}

inline void iuOptionMessage::ShowSpec()
{
    IIUT_SHOW_MACRO(IUTEST_PLATFORM);

    IIUT_SHOW_MACRO(IUTEST_CHECK_STRICT);
    IIUT_SHOW_MACRO(IUTEST_HAS_ANALYSIS_ASSUME);
    IIUT_SHOW_MACRO(IUTEST_HAS_ATTRIBUTE);
    IIUT_SHOW_MACRO(IUTEST_HAS_AUTO);
    IIUT_SHOW_MACRO(IUTEST_HAS_CATCH_SEH_EXCEPTION_ASSERTION);
    IIUT_SHOW_MACRO(IUTEST_HAS_CHAR16_T);
    IIUT_SHOW_MACRO(IUTEST_HAS_CHAR32_T);
    IIUT_SHOW_MACRO(IUTEST_HAS_CLOCK);
    IIUT_SHOW_MACRO(IUTEST_HAS_CONSTEXPR);
    IIUT_SHOW_MACRO(IUTEST_HAS_CONSTEXPR_IF);
    IIUT_SHOW_MACRO(IUTEST_HAS_COUNTER_MACRO);
    IIUT_SHOW_MACRO(IUTEST_HAS_CTIME);
    IIUT_SHOW_MACRO(IUTEST_HAS_CXX_HDR_ANY);
    IIUT_SHOW_MACRO(IUTEST_HAS_CXX_HDR_ARRAY);
    IIUT_SHOW_MACRO(IUTEST_HAS_CXX_HDR_CHRONO);
    IIUT_SHOW_MACRO(IUTEST_HAS_CXX_HDR_CODECVT);
    IIUT_SHOW_MACRO(IUTEST_HAS_CXX_HDR_CSTDINT);
    IIUT_SHOW_MACRO(IUTEST_HAS_CXX_HDR_CUCHAR);
    IIUT_SHOW_MACRO(IUTEST_HAS_CXX_HDR_FILESYSTEM);
    IIUT_SHOW_MACRO(IUTEST_HAS_CXX_HDR_OPTIONAL);
    IIUT_SHOW_MACRO(IUTEST_HAS_CXX_HDR_RANDOM);
    IIUT_SHOW_MACRO(IUTEST_HAS_CXX_HDR_REGEX);
    IIUT_SHOW_MACRO(IUTEST_HAS_CXX_HDR_STRING_VIEW);
    IIUT_SHOW_MACRO(IUTEST_HAS_CXX_HDR_VARIANT);
    IIUT_SHOW_MACRO(IUTEST_HAS_CXX11);
    IIUT_SHOW_MACRO(IUTEST_HAS_DECLTYPE);
    IIUT_SHOW_MACRO(IUTEST_HAS_DELETED_FUNCTIONS);
    IIUT_SHOW_MACRO(IUTEST_HAS_EXCEPTIONS);
    IIUT_SHOW_MACRO(IUTEST_HAS_EXPLICIT_CONVERSION);
    IIUT_SHOW_MACRO(IUTEST_HAS_EXTERN_TEMPLATE);
    IIUT_SHOW_MACRO(IUTEST_HAS_GETTIMEOFDAY);
    IIUT_SHOW_MACRO(IUTEST_HAS_HDR_CXXABI);
{'fraction_non_alphanumeric': 0.1733019587891122, 'fraction_numerical': 0.009793945560925972, 'mean_word_length': 2.641732283464567, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3388828', 'n_tokens_mistral': 6236, 'n_tokens_neox': 6030, 'n_words': 794}