Skip to content

Commit

Permalink
pouvoir créer un .tlg à partir de config + fichier
Browse files Browse the repository at this point in the history
  • Loading branch information
maieul committed May 3, 2020
1 parent f282cd3 commit 9bf28d1
Showing 1 changed file with 25 additions and 13 deletions.
38 changes: 25 additions & 13 deletions dev-tools/create-tlg.py
@@ -1,24 +1,36 @@
#!/usr/bin/python3
# This file create the tlg file for testing regression on example file.
# Use : create-tlg.py
# Use : create-tlg.py <optional file> <optional config>
#
from glob import glob
import os.path
import subprocess
directories = glob("testfiles-*")
from sys import argv
if len(argv) == 3:
directories = ["testfiles-" + argv[2]]
this_file = argv[1] + '.lvt'
else :
directories = glob("testfiles-*")

for this_directory in directories:
def create_file(this_config, this_directory, this_file):
run = ["l3build", "save", "-c"+this_config, "fichier"]
basename, extension = os.path.splitext(os.path.basename(this_file))
if extension == ".lvt":
run[3] = basename
print ("*****")
print (this_directory+"/"+this_file)
print ("*****")

#create the .tlg
subprocess.run(run)

for this_directory in directories:
this_config = this_directory.replace("testfiles","config")
run = ["l3build", "save", "-c"+this_config, "fichier"]
for this_file in os.listdir(this_directory):
basename, extension = os.path.splitext(os.path.basename(this_file))
if extension == ".lvt":
run[3] = basename
print ("*****")
print (this_directory+"/"+this_file)
print ("*****")
if len(argv) == 3:
create_file(this_config, this_directory, this_file)
else:
for this_file in os.listdir(this_directory):
create_file(this_config, this_directory, this_file)


#create the .tlg
subprocess.run(run)

0 comments on commit 9bf28d1

Please sign in to comment.