<commit_before>#include "SINLogger.h"
#include "SINTestCollection.h"
#include "SINTestFactory.h"
#include "SINAllocTester.h"
#include "SIN.h"
#include "SINAssert.h"
#include "SINASTTester.h"
#include "SINCommonTester.h"
#include "SINLoggingTester.h"
#include "SINParserTester.h"
#include "SINSymbolTableTester.h"
#include "SINRunTester.h"
#include "SINLoggerManager.h"
#include "SINObjectTester.h"
#include "SINFunctionLibraryTester.h"
#include "SINLibrary.h"
#include "SINLibraryFunctions.h"
#include "SINVirtualState.h"
#include "SINStandardLibrary.h"
#include "SINAlloc.h"

//////// for quick tests and c++ questions ///////
// (please restore to original before commits)
#include "SINConstants.h"
class out_class {
	SIN::Logger* out_p;
public:
	out_class(SIN::Logger& _out): out_p(&_out) { }
	template <typename _T>
	out_class const& operator <<(_T const& something) const {
		out_p->Notice(SIN::to_string(something));
		return *this;
	}
	SIN::Logger* logger(void) const { return out_p; }
};
// keep the above for convenience. ex:
// out << (SIN::String() << "This is" << " horrible " << (4));
#include "SINASTMITTreeVisualizerXMLProducerVisitor.h"
static InstanceProxy<out_class> g_out;

static void __print_handler(SIN::String const& _msg) {
//	SIN::LoggerManager::StreamLogger oot("STDOUT: ", SIN::Logging::Record::FINEST, SIN::STDOUT, SIN::Logging::RecordPrinter());
//	oot.Notice(_msg);
}

void quick_test(void) {
	SIN::LoggerManager::SingletonGetInstance()->MakeStdoutLogger("SIN::main::quick_test");
	out_class out(SIN::LoggerManager::SingletonGetInstance()->GetLogger("SIN::main::quick_test"));
	g_out = out;
	// keep the above for convenience

	// Example of using "out" and "FOREACH"
//	std::list<int> lis; lis.push_back(9); lis.push_back(8); lis.push_back(7); lis.push_back(6);
//	FOREACH(lis)
//		out << *ITER(lis);
//	out << (SIN::to_string("This is") << " horrible " << (4));

	__print_handler("hi");

	SIN::VM::VirtualState vs;
	vs.PushState();
	vs.Down().Up().Down().Top().RestoreState();

	SIN::Library::StandardLibrary stdlib;

	SIN::LoggerManager::SingletonGetInstance()->GetDefaultLoggerFactory()->DestroyLogger(g_out->logger());
	SIN::LoggerManager::StreamLogger loolis("Memory reporter", SIN::Logging::Record::FINEST, SIN::STDOUT, SIN::Logging::RecordPrinter());
	out_class(loolis) << (SIN::String() << "Memory leak: " << SIN::Alloc::MemoryLeaking() << " bytes");
}
////////

class MainTestCollection: public SIN::Tests::TestCollection {
	SIN::Tests::TestFactory test_factory;
	SIN::Tests::Alloc::Status alloc_test_status;
	void emulateAllocTest(void) const;
public:
	MainTestCollection(SIN::Tests::Alloc::Status const& _alloc_test_status): test_factory(), alloc_test_status(_alloc_test_status) { }
	MainTestCollection(SIN::Tests::TestFactory const& tf, SIN::Tests::Alloc::Status const& _alloc_test_status): test_factory(tf), alloc_test_status(_alloc_test_status) { }
	virtual bool RunAll(void);
}; // class MainTestCollection

static int waitToByeBye(void);
int main(int argc, char *argv[]) {
	// Early testing: LoggerManager taints the memory module.
	SIN::Tests::Alloc::Status s;
	SIN::Tests::Alloc::test(s); // TODO and one day this will be moved in along with the rest of the tests

	if (SIN::Initialise()) {
		MainTestCollection mtc(s);
		mtc.RunAll();
		quick_test();
	}
	else
		SINASSERT(!"Initialisation failed");

	SIN::Alloc::ChunksMap undeallocated_chunks(SIN::Alloc::UndeallocatedChunks());
	SIN::CleanUp();
	return waitToByeBye();
}

///// MainTestCollection ////////////////////
bool MainTestCollection::RunAll(void) {
	emulateAllocTest();
	SIN::Tests::AST::test(&test_factory);
	SIN::Tests::Common::test(&test_factory);
	SIN::Tests::Logging::test(&test_factory);
	SIN::Tests::Parser::test(&test_factory);
	SIN::Tests::ST::test(&test_factory);
	SIN::Tests::Run::test(&test_factory);
	SIN::Tests::OBJ::test(&test_factory);
	SIN::Tests::FunctionLibrary::test(&test_factory);
	return true;
}

void MainTestCollection::emulateAllocTest(void) const {
	SIN::Logger& logga(SIN::LoggerManager::SingletonGetInstance()->GetLogger("SIN::Tests::Alloc"));
	logga.Notice(alloc_test_status.failed ? SIN::to_string("FAIL'D at line ") << alloc_test_status.at_line : "OK");
	SIN::LoggerManager::SingletonGetInstance()->GetDefaultLoggerFactory()->DestroyLogger(&logga);
}


/// Wait to byebye
static int waitToByeBye(void) {
#ifdef _DEBUG
#ifdef _MSC_VER
	system("pause");
#elif defined(_LINUX_)
	getchar();
#endif
#else
#ifdef _MSC_VER
#elif defined(_LINUX)
	getchar();
#endif
#endif
	return 0;
}
<commit_msg>* removed useless tests again from main<commit_after>#include "SINLogger.h"
#include "SINTestCollection.h"
#include "SINTestFactory.h"
#include "SINAllocTester.h"
#include "SIN.h"
#include "SINAssert.h"
#include "SINASTTester.h"
#include "SINCommonTester.h"
#include "SINLoggingTester.h"
#include "SINParserTester.h"
#include "SINSymbolTableTester.h"
#include "SINRunTester.h"
#include "SINLoggerManager.h"
#include "SINObjectTester.h"
#include "SINFunctionLibraryTester.h"
#include "SINLibrary.h"
#include "SINLibraryFunctions.h"
#include "SINVirtualState.h"
#include "SINStandardLibrary.h"
#include "SINAlloc.h"

//////// for quick tests and c++ questions ///////
// (please restore to original before commits)
#include "SINConstants.h"
class out_class {
	SIN::Logger* out_p;
public:
	out_class(SIN::Logger& _out): out_p(&_out) { }
	template <typename _T>
	out_class const& operator <<(_T const& something) const {
		out_p->Notice(SIN::to_string(something));
		return *this;
	}
	SIN::Logger* logger(void) const { return out_p; }
};
// keep the above for convenience. ex:
// out << (SIN::String() << "This is" << " horrible " << (4));
#include "SINASTMITTreeVisualizerXMLProducerVisitor.h"
static InstanceProxy<out_class> g_out;

static void __print_handler(SIN::String const& _msg) {
//	SIN::LoggerManager::StreamLogger oot("STDOUT: ", SIN::Logging::Record::FINEST, SIN::STDOUT, SIN::Logging::RecordPrinter());
//	oot.Notice(_msg);
}

void quick_test(void) {
	SIN::LoggerManager::SingletonGetInstance()->MakeStdoutLogger("SIN::main::quick_test");
	out_class out(SIN::LoggerManager::SingletonGetInstance()->GetLogger("SIN::main::quick_test"));
	g_out = out;
	// keep the above for convenience

	// Example of using "out" and "FOREACH"
//	std::list<int> lis; lis.push_back(9); lis.push_back(8); lis.push_back(7); lis.push_back(6);
//	FOREACH(lis)
//		out << *ITER(lis);
//	out << (SIN::to_string("This is") << " horrible " << (4));

	__print_handler("hi");

	SIN::VM::VirtualState vs;
	vs.PushState();
	vs.Down().Up().Down().Top().RestoreState();

	SIN::Library::StandardLibrary stdlib;

	SIN::LoggerManager::SingletonGetInstance()->GetDefaultLoggerFactory()->DestroyLogger(g_out->logger());
	SIN::LoggerManager::StreamLogger loolis("Memory reporter", SIN::Logging::Record::FINEST, SIN::STDOUT, SIN::Logging::RecordPrinter());
	out_class(loolis) << (SIN::String() << "Memory leak: " << SIN::Alloc::MemoryLeaking() << " bytes");
}
////////

class MainTestCollection: public SIN::Tests::TestCollection {
	SIN::Tests::TestFactory test_factory;
	SIN::Tests::Alloc::Status alloc_test_status;
	void emulateAllocTest(void) const;
public:
	MainTestCollection(SIN::Tests::Alloc::Status const& _alloc_test_status): test_factory(), alloc_test_status(_alloc_test_status) { }
	MainTestCollection(SIN::Tests::TestFactory const& tf, SIN::Tests::Alloc::Status const& _alloc_test_status): test_factory(tf), alloc_test_status(_alloc_test_status) { }
	virtual bool RunAll(void);
}; // class MainTestCollection

static int waitToByeBye(void);
int main(int argc, char *argv[]) {
	// Early testing: LoggerManager taints the memory module.
	SIN::Tests::Alloc::Status s;
	SIN::Tests::Alloc::test(s); // TODO and one day this will be moved in along with the rest of the tests

	if (SIN::Initialise()) {
		MainTestCollection mtc(s);
		mtc.RunAll();
		quick_test();
	}
	else
		SINASSERT(!"Initialisation failed");

	SIN::Alloc::ChunksMap undeallocated_chunks(SIN::Alloc::UndeallocatedChunks());
	SIN::CleanUp();
	return waitToByeBye();
}

///// MainTestCollection ////////////////////
bool MainTestCollection::RunAll(void) {
	//emulateAllocTest();
	//SIN::Tests::AST::test(&test_factory);
	//SIN::Tests::Common::test(&test_factory);
	//SIN::Tests::Logging::test(&test_factory);
	//SIN::Tests::Parser::test(&test_factory);
	//SIN::Tests::ST::test(&test_factory);
	SIN::Tests::Run::test(&test_factory);
	//SIN::Tests::OBJ::test(&test_factory);
	//SIN::Tests::FunctionLibrary::test(&test_factory);
	return true;
}

void MainTestCollection::emulateAllocTest(void) const {
	SIN::Logger& logga(SIN::LoggerManager::SingletonGetInstance()->GetLogger("SIN::Tests::Alloc"));
	logga.Notice(alloc_test_status.failed ? SIN::to_string("FAIL'D at line ") << alloc_test_status.at_line : "OK");
	SIN::LoggerManager::SingletonGetInstance()->GetDefaultLoggerFactory()->DestroyLogger(&logga);
}


/// Wait to byebye
static int waitToByeBye(void) {
#ifdef _DEBUG
#ifdef _MSC_VER
	system("pause");
#elif defined(_LINUX_)
	getchar();
#endif
#else
#ifdef _MSC_VER
#elif defined(_LINUX)
	getchar();
#endif
#endif
	return 0;
}

{'fraction_non_alphanumeric': 0.17473347547974413, 'fraction_numerical': 0.0014925373134328358, 'mean_word_length': 5.546406140963015, 'pattern_counts': {'":': 0, '<': 65, '<?xml version=': 0, '>': 27, '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': '5075391', 'n_tokens_mistral': 3327, 'n_tokens_neox': 3291, 'n_words': 584}