test/genscripts.py
author Krista 'DarthMama' Bennett <krista@pep.foundation>
Fri, 10 May 2019 14:07:57 +0200
branchsync
changeset 3660 5baccf081566
parent 3249 03119f76ea35
permissions -rw-r--r--
Upgraded to cpptest 2.0.0 compatibility - pre 2.0.0 cpptest will no longer compile! (There's no define to operate on for conditional compilation here, so I am just unilaterally upgrading, since the release is from January, and the previous release is more than 2 years old...
     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()