test/genscripts.py
author Krista Bennett <krista@pep-project.org>
Thu, 24 May 2018 12:25:34 +0200
branchENGINE-434
changeset 2696 54689953f3bd
child 3249 03119f76ea35
permissions -rw-r--r--
Added more stuff, including scripts. 434 will have to wait on Volker's answer for now - moving to libetpan probs
krista@2696
     1
# This file is under GNU General Public License 3.0
krista@2696
     2
# see LICENSE.txt
krista@2696
     3
krista@2696
     4
from os import listdir, getcwd
krista@2696
     5
from os.path import isfile, join
krista@2696
     6
from re import sub
krista@2696
     7
import os
krista@2696
     8
import stat
krista@2696
     9
import datetime
krista@2696
    10
krista@2696
    11
srcpath = join(getcwd(), "src/engine_tests")
krista@2696
    12
krista@2696
    13
ls = listdir(srcpath)
krista@2696
    14
krista@2696
    15
for f in ls:
krista@2696
    16
    if isfile(join(srcpath, f)):
krista@2696
    17
        if (f.endswith(".cc")):
krista@2696
    18
            suite = sub('\.cc$', '', f)
krista@2696
    19
            outfile = open(suite, 'w')
krista@2696
    20
            output = (
krista@2696
    21
                "#!/bin/bash\n"
krista@2696
    22
                "# This is a convenience script for launching individual tests and tab completion with TestDriver \n\n" +
krista@2696
    23
                "./TestDriver " + suite + "\n\n")
krista@2696
    24
            outfile.write(output)
krista@2696
    25
            os.chmod(suite, 
krista@2696
    26
                     (stat.S_IRWXU | stat.S_IRGRP | stat.S_IROTH | stat.S_IXGRP | stat.S_IXOTH))
krista@2696
    27
            outfile.close()