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