test/genscripts.py
author Krista 'DarthMama' Bennett <krista@pep.foundation>
Wed, 06 Feb 2019 07:17:26 +0100
branchsync
changeset 3270 d8aea79654c3
parent 3249 03119f76ea35
permissions -rw-r--r--
default with ENGINE-448 and ENGINE-510 merged in, tests updated
     1 #! /usr/bin/env python3
     2 
     3 # This file is under GNU General Public License 3.0
     4 # see LICENSE.txt
     5 
     6 from os import listdir, getcwd
     7 from os.path import isfile, join
     8 from re import sub
     9 import os
    10 import stat
    11 import datetime
    12 
    13 srcpath = join(getcwd(), "src/engine_tests")
    14 
    15 ls = listdir(srcpath)
    16 
    17 for f in ls:
    18     if isfile(join(srcpath, f)):
    19         if (f.endswith(".cc")):
    20             suite = sub('\.cc$', '', f)
    21             outfile = open(suite, 'w')
    22             output = (
    23                 "#!/bin/bash\n"
    24                 "# This is a convenience script for launching individual tests and tab completion with TestDriver \n\n" +
    25                 "./TestDriver " + suite + "\n\n")
    26             outfile.write(output)
    27             os.chmod(suite, 
    28                      (stat.S_IRWXU | stat.S_IRGRP | stat.S_IROTH | stat.S_IXGRP | stat.S_IXOTH))
    29             outfile.close()