<commit_before>/*
 *  main.cpp
 *  MonkeyWorksCore
 *
 *  Created by <NAME> on 3/30/06.
 *  Copyright 2006 __MyCompanyName__. All rights reserved.
 *
 */


//#include "MonkeyWorksCoreTest/GenericDataTest.h"
//#include "MonkeyWorksCoreTest/SchedulerTest.h"
//#include "MonkeyWorksCoreTest/ClockTest.h"

#include "cppunit/ui/text/TestRunner.h"
#include <cppunit/TestCase.h>
#include <cppunit/TestSuite.h>
#include <cppunit/TestFixture.h>
#include <cppunit/XmlOutputter.h>
#include <cppunit/extensions/HelperMacros.h>

// test runner
int main(int argc, char *argv[]) {
  
  CppUnit::TestFactoryRegistry &registry = 
    CppUnit::TestFactoryRegistry::getRegistry("Unit Test");
  
  CppUnit::TextUi::TestRunner runner;
  CppUnit::XmlOutputter* outputter =
    new CppUnit::XmlOutputter(&runner.result(), std::cout, std::string("MonkeyWorksTestRunner Output"));
  runner.setOutputter(outputter);
  
  runner.addTest( registry.makeTest() );
  //runner.addTest( GenericDataTestFixture::suite() ); //include this commected out 
  bool returnval = runner.run( "", false );    // Run all tests
  
  // return !returnval because it is 1 on success
  return !returnval;
}
<commit_msg>Added option to select and run an individual unit test by name<commit_after>/*
 *  main.cpp
 *  MonkeyWorksCore
 *
 *  Created by <NAME> on 3/30/06.
 *  Copyright 2006 __MyCompanyName__. All rights reserved.
 *
 */


//#include "MonkeyWorksCoreTest/GenericDataTest.h"
//#include "MonkeyWorksCoreTest/SchedulerTest.h"
//#include "MonkeyWorksCoreTest/ClockTest.h"

#include "cppunit/ui/text/TestRunner.h"
#include <cppunit/TestCase.h>
#include <cppunit/TestSuite.h>
#include <cppunit/TestFixture.h>
#include <cppunit/XmlOutputter.h>
#include <cppunit/extensions/HelperMacros.h>

// test runner
int main(int argc, char *argv[]) {
  
  CppUnit::TestFactoryRegistry &registry = 
    CppUnit::TestFactoryRegistry::getRegistry("Unit Test");
  
  CppUnit::TextUi::TestRunner runner;
  CppUnit::XmlOutputter* outputter =
    new CppUnit::XmlOutputter(&runner.result(), std::cout, std::string("MonkeyWorksTestRunner Output"));
  runner.setOutputter(outputter);
  
  runner.addTest( registry.makeTest() );
  //runner.addTest( GenericDataTestFixture::suite() ); //include this commected out 

    bool returnval;
    if (argc > 1)
        returnval = runner.run( argv[1], false );  // Run specified test
    else
        returnval = runner.run( "", false );       // Run all tests
  
  // return !returnval because it is 1 on success
  return !returnval;
}

{'fraction_non_alphanumeric': 0.1359300476947536, 'fraction_numerical': 0.008744038155802861, 'mean_word_length': 4.310126582278481, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 16, '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': '5171840', 'n_tokens_mistral': 856, 'n_tokens_neox': 822, 'n_words': 179}