<commit_before>#include <iostream>
#include <string>
#include <vector>

class TestCase {
	public:
  	TestCase (const std::string& testName) : testName(testName) {;}

    virtual std::string getTestName() const {return testName;}
    virtual void runTest() const = 0;

  private:
    std::string testName;
};

class TestSet {
	public:
		static TestSet& getTestSet() {
    	static TestSet* tset = new TestSet();
      return *tset;
    }

    void addTest(const TestCase* b) {
			tests.push_back(b);
    	std::cout << "adding test " << b->getTestName() << std::endl;
    }

		void run() {
			for (size_t i = 0; i < tests.size(); ++i) {
				tests[i]->runTest();
			}
		}

	private:
		std::vector<const TestCase*> tests;
  	TestSet()  {;}
    ~TestSet()  {;}
};


class TestCaseAdder {
	public:
  	TestCaseAdder(const TestCase* b) {
    	TestSet::getTestSet().addTest(b);
   	}

    ~TestCaseAdder() { }
};


#define TEST(NAME)                                                    \
	class NAME : public TestCase {                                      \
    public:                                                           \
    	NAME(const std::string& testName) : TestCase( testName ) { ; }  \
      virtual void runTest() const;                                   \
    private:                                                          \
      static TestCaseAdder adder;                                     \
  };                                                                  \
  TestCaseAdder NAME::adder(new NAME(#NAME));                         \
  void NAME::runTest() const
<commit_msg>improved code documentation in TinyTest.hpp<commit_after>#include <iostream>
#include <string>
#include <vector>

/******************************************************************************
 **       Classes for definition, and automagic detection of test cases      **
 ******************************************************************************/

/**
 * \brief TODO
 */
class TestCase {
	public:
  	TestCase (const std::string& testName) : testName(testName) {;}
  	virtual ~TestCase();

    virtual std::string getTestName() const {return testName;}
    virtual void runTest() const = 0;

  private:
    std::string testName;
};

/**
 * \brief TODO
 */
class TestSet {
	public:
		static TestSet& getTestSet() {
    	static TestSet* tset = new TestSet();
      return *tset;
    }

    void addTest(const TestCase* b) {
			tests.push_back(b);
    	std::cout << "adding test " << b->getTestName() << std::endl;
    }

		void run() {
			for (size_t i = 0; i < tests.size(); ++i) {
				tests[i]->runTest();
			}
		}

	private:
		std::vector<const TestCase*> tests;
  	TestSet()  {;}
    ~TestSet()  {;}
};

/**
 * \brief TODO
 */
class TestCaseAdder {
	public:
  	TestCaseAdder(const TestCase* b) {
    	TestSet::getTestSet().addTest(b);
   	}

    ~TestCaseAdder() { }
};

/******************************************************************************
 **                   Macros for test case definition                        **
 ******************************************************************************/

#define TEST(NAME)                                                    \
	class NAME : public TestCase {                                      \
    public:                                                           \
    	NAME(const std::string& testName) : TestCase( testName ) { ; }  \
      virtual void runTest() const;                                   \
    private:                                                          \
      static TestCaseAdder adder;                                     \
  };                                                                  \
  TestCaseAdder NAME::adder(new NAME(#NAME));                         \
  void NAME::runTest() const

/******************************************************************************
 **               Macros for testing conditions in test cases                **
 ******************************************************************************/

{'fraction_non_alphanumeric': 0.22302158273381295, 'fraction_numerical': 0.0009923096005953857, 'mean_word_length': 1.695187165775401, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 22, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1140742', 'n_tokens_mistral': 1080, 'n_tokens_neox': 988, 'n_words': 235}