<commit_before>// Copyright <NAME> 2015 hughperkins at gmail
//
// This Source Code Form is subject to the terms of the Mozilla Public License, 
// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
// obtain one at http://mozilla.org/MPL/2.0/.

#include <iostream>

#include "util/stringhelper.h"

#include "gtest/gtest.h"

#include "test/GtestGlobals.h"

using namespace std;

string cmdline;

GTEST_API_ int main(int argc, char **argv) {
    // add filter on slow by default
    bool deleteargv = false;
    // add filter= option, easier to type than --gtest_filter= ...
    for( int i = 1; i < argc; i++ ) {
//    if( argc >= 2 && ( split( string( argv[1] ), "=" )[0] == "filter"
//        || split( string( argv[1] ), "=" )[0] == "gfilter" ) ) {
        if( split( string( argv[i] ), "=" )[0] == "tests" ) {
            // replace with "--gtest_filter=..."
            string newarg = string("--gtest_filter=") + split( string( argv[i] ), "=" )[1];
            char *newargchar = new char[ newarg.length() + 1 ];
            strcpy_safe( newargchar, newarg.c_str(), newarg.length() );
            argv[i] = newargchar;
        }
    }
    // default to -SLOW*
    if( argc == 1 ) {
        char **newargv = new char *[argc + 1];
        int newargc = argc + 1;
        for( int i = 0; i < argc; i++ ) {
            char *newarg = new char[strlen( argv[i]) + 1 ];
            newargv[i] = newarg;
            strcpy_safe( newargv[i], argv[i], 255 );
        }
        string slowfilter = "--gtest_filter=-SLOW*";
        newargv[argc] = new char[ slowfilter.length() + 1 ];
        strcpy_safe( newargv[argc], slowfilter.c_str(), 255 );
        argv = newargv;
        argc = newargc;
        deleteargv = true;
    }
//    cout << "argc " << argc << endl;<commit_msg>remove DATA* tests from default test runs<commit_after>// Copyright <NAME> 2015 hughperkins at gmail
//
// This Source Code Form is subject to the terms of the Mozilla Public License, 
// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
// obtain one at http://mozilla.org/MPL/2.0/.

#include <iostream>

#include "util/stringhelper.h"

#include "gtest/gtest.h"

#include "test/GtestGlobals.h"

using namespace std;

string cmdline;

GTEST_API_ int main(int argc, char **argv) {
    // add filter away slow and data by default
    bool deleteargv = false;
    // add filter= option, easier to type than --gtest_filter= ...
    for( int i = 1; i < argc; i++ ) {
        if( split( string( argv[i] ), "=" )[0] == "tests" ) {
            // replace with "--gtest_filter=..."
            string newarg = string("--gtest_filter=") + split( string( argv[i] ), "=" )[1];
            char *newargchar = new char[ newarg.length() + 1 ];
            strcpy_safe( newargchar, newarg.c_str(), newarg.length() );
            argv[i] = newargchar;
        }
    }
    // default to -DATA*:SLOW*
    if( argc == 1 ) {
        char **newargv = new char *[argc + 1];
        int newargc = argc + 1;
        for( int i = 0; i < argc; i++ ) {
            char *newarg = new char[strlen( argv[i]) + 1 ];
            newargv[i] = newarg;
            strcpy_safe( newargv[i], argv[i], 255 );
        }
        string slowfilter = "--gtest_filter=-DATA*:SLOW*";
        newargv[argc] = new char[ slowfilter.length() + 1 ];
        strcpy_safe( newargv[argc], slowfilter.c_str(), 255 );
        argv = newargv;
        argc = newargc;
        deleteargv = true;
    }
{'fraction_non_alphanumeric': 0.15911059774761768, 'fraction_numerical': 0.015304649148137454, 'mean_word_length': 2.192626728110599, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '5174998', 'n_tokens_mistral': 1194, 'n_tokens_neox': 1160, 'n_words': 354}