<commit_before>/**
 * @file   tester.cpp
 * @brief  Tester project entry-point.
 * @author zer0
 * @date   2016-11-01
 */

#include <gtest/gtest.h>
#include <tester/DemoAsset.hpp>
#include <libtbag/libtbag.h>
#include <libtbag/string/Commander.hpp>
#include <libtbag/signal/SignalHandler.hpp>
#include <libtbag/log/Log.hpp>

#include <cstdlib>
#include <iostream>
#include <string>

static char const * const DEFAULT_GTEST_FILTER = "-NetworkTest.*";

static char const * const DEFAULT_NETWORK_TEST_SERVER_IP = "0.0.0.0";
static char const * const DEFAULT_NETWORK_TEST_CLIENT_IP = "127.0.0.1";
static  int const         DEFAULT_NETWORK_TEST_PORT      = 20000;

enum class TestMode
{
    UNKNOWN_ERROR = 0,
    TEST,
};

bool checkNetworkArgument(libtbag::string::Arguments const & args, std::string & ip, int & port)
{
    if (args.optString(0, &ip)) {
        if (args.optInteger(1, &port) == false) {
            port = DEFAULT_NETWORK_TEST_PORT;
        }
        return true;
    }
    return false;
}

int main(int argc, char **argv)
{
    tbInitialize();
    libtbag::signal::registerDefaultStdTerminateHandler();
    libtbag::signal::registerDefaultHandler();

    libtbag::DemoAsset asset;
    asset.create_temp_dir();

    TestMode mode = TestMode::TEST;
    std::string ip;
    int port;

    {   // COMMAND-LINE PARSING.
        using namespace libtbag::string;
        Commander cmd;
        cmd.insert("", [&](Arguments const & args){
        });
        cmd.request(argc, argv);
    }

    switch (mode) {
    case TestMode::TEST:
        testing::GTEST_FLAG(filter) = DEFAULT_GTEST_FILTER;
        testing::InitGoogleTest(&argc, argv);
        return RUN_ALL_TESTS();
    default: break;
    }

    std::cout << "Argument error.\n";
    return EXIT_FAILURE;
}

<commit_msg>Fixed a gtest filter value.<commit_after>/**
 * @file   tester.cpp
 * @brief  Tester project entry-point.
 * @author zer0
 * @date   2016-11-01
 */

#include <gtest/gtest.h>
#include <tester/DemoAsset.hpp>
#include <libtbag/libtbag.h>
#include <libtbag/string/Commander.hpp>
#include <libtbag/signal/SignalHandler.hpp>
#include <libtbag/log/Log.hpp>

#include <cstdlib>
#include <iostream>
#include <string>

static char const * const DEFAULT_GTEST_FILTER = "-Network*Test.*";

static char const * const DEFAULT_NETWORK_TEST_SERVER_IP = "0.0.0.0";
static char const * const DEFAULT_NETWORK_TEST_CLIENT_IP = "127.0.0.1";
static  int const         DEFAULT_NETWORK_TEST_PORT      = 20000;

enum class TestMode
{
    UNKNOWN_ERROR = 0,
    TEST,
};

bool checkNetworkArgument(libtbag::string::Arguments const & args, std::string & ip, int & port)
{
    if (args.optString(0, &ip)) {
        if (args.optInteger(1, &port) == false) {
            port = DEFAULT_NETWORK_TEST_PORT;
        }
        return true;
    }
    return false;
}

int main(int argc, char **argv)
{
    tbInitialize();
    libtbag::signal::registerDefaultStdTerminateHandler();
    libtbag::signal::registerDefaultHandler();

    libtbag::DemoAsset asset;
    asset.create_temp_dir();

    TestMode mode = TestMode::TEST;
    std::string ip;
    int port;

    {   // COMMAND-LINE PARSING.
        using namespace libtbag::string;
        Commander cmd;
        cmd.insert("", [&](Arguments const & args){
        });
        cmd.request(argc, argv);
    }

    switch (mode) {
    case TestMode::TEST:
        testing::GTEST_FLAG(filter) = DEFAULT_GTEST_FILTER;
        testing::InitGoogleTest(&argc, argv);
        return RUN_ALL_TESTS();
    default: break;
    }

    std::cout << "Argument error.\n";
    return EXIT_FAILURE;
}


{'fraction_non_alphanumeric': 0.13318473112287546, 'fraction_numerical': 0.015045973808860406, 'mean_word_length': 3.1550925925925926, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5478393', 'n_tokens_mistral': 1247, 'n_tokens_neox': 1211, 'n_words': 258}