<commit_before>#!/usr/bin/python

import os
import os.path
import re

gettestname = re.compile('^(.*TestCase)\.cc')

pri = open('unit_tests.pri', 'w')
pri.write('TEST_BASE = src/unit_tests\n')

for filename in os.listdir('.'):
    match = gettestname.match(filename)
    if match is not None:
        testname = match.group(1)

        if not os.path.exists(testname):
            os.mkdir(testname)

        pro = open(testname+'/'+testname+'.pro', 'w')
        pro.write('''
TEMPLATE = app
ROOT = ../../..
SUBMODULES = $$ROOT/submodule

INCLUDEPATH += $$ROOT/src
LIBS += $$ROOT/lib/libmgl.a -lcppunit
SOURCES += ../UnitTestMain.cc ../UnitTestUtils.cc
HEADERS += ../UnitTestUtils.h

JSON_CPP_SRC = $$SUBMODULES/json-cpp
include($$JSON_CPP_SRC/json-cpp.pri)
<commit_msg>[finishes: 30735985] Added openmp flags to make tests compile.  We may need to merge this if it becomes a problem on non-linux<commit_after>#!/usr/bin/python

import os
import os.path
import re

gettestname = re.compile('^(.*TestCase)\.cc')

pri = open('unit_tests.pri', 'w')
pri.write('TEST_BASE = src/unit_tests\n')

for filename in os.listdir('.'):
    match = gettestname.match(filename)
    if match is not None:
        testname = match.group(1)

        if not os.path.exists(testname):
            os.mkdir(testname)

        pro = open(testname+'/'+testname+'.pro', 'w')
        pro.write('''
TEMPLATE = app
ROOT = ../../..
SUBMODULES = $$ROOT/submodule

INCLUDEPATH += $$ROOT/src
LIBS += $$ROOT/lib/libmgl.a -lcppunit -lgomp
SOURCES += ../UnitTestMain.cc ../UnitTestUtils.cc
HEADERS += ../UnitTestUtils.h
QMAKE_CXXFLAGS += -fopenmp

JSON_CPP_SRC = $$SUBMODULES/json-cpp
include($$JSON_CPP_SRC/json-cpp.pri)

{'fraction_non_alphanumeric': 0.16893894487255484, 'fraction_numerical': 0.005927682276229994, 'mean_word_length': 3.295165394402036, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4603244', 'n_tokens_mistral': 640, 'n_tokens_neox': 603, 'n_words': 130}