diff options
-rw-r--r-- | test/TEX/generated_files.py | 37 |
1 files changed, 10 insertions, 27 deletions
diff --git a/test/TEX/generated_files.py b/test/TEX/generated_files.py index c121fa3..339d3b3 100644 --- a/test/TEX/generated_files.py +++ b/test/TEX/generated_files.py @@ -49,42 +49,25 @@ import os env = Environment(ENV = { 'PATH' : os.environ['PATH'] }) -VariantDir('pdf', 'src') -SConscript('pdf/SConscript') -""") - -if os.sys.platform == "Windows": - test.write(['src','gen.bat'], """ -copy main.src main.tex -""") - test.chmod(['src','gen.bat'],0755) - - test.write(['src','SConscript'],""" -import os -env = Environment(ENV = os.environ) - -env.Depends('main.tex', 'gen.bat') -env.Command('main.tex', 'main.src', 'cd pdf && ./gen.sh') +copy_latex = Builder(action='cp $SOURCE $TARGET', + suffix='.tex', + src_suffix='.src') +env.Append( BUILDERS={'CopyLatex' : copy_latex} ) -# latexing -pdf = env.PDF('main.tex') +Export(['env']) +VariantDir('pdf', 'src') +SConscript('pdf/SConscript') """) -else: - test.write(['src','gen.sh'], """ -cp main.src main.tex -""") - test.chmod(['src','gen.sh'],0755) test.write(['src','SConscript'],""" import os -env = Environment(ENV = os.environ) +Import('env') -env.Depends('main.tex', 'gen.sh') -env.Command('main.tex', 'main.src', 'cd pdf && ./gen.sh') +latex_file = env.CopyLatex('main.src') # latexing -pdf = env.PDF('main.tex') +pdf = env.PDF(latex_file) """) |