summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Managan <managan1@llnl.gov>2010-08-23 17:47:01 (GMT)
committerRobert Managan <managan1@llnl.gov>2010-08-23 17:47:01 (GMT)
commit9506aa8bf245a3dfedfe844e8b86e842fe328635 (patch)
treee49fced10504f22624a6d910d0891824c9d61e89
parentf749db22fb9a0956dd119dca0761103393522b87 (diff)
downloadSCons-9506aa8bf245a3dfedfe844e8b86e842fe328635.zip
SCons-9506aa8bf245a3dfedfe844e8b86e842fe328635.tar.gz
SCons-9506aa8bf245a3dfedfe844e8b86e842fe328635.tar.bz2
Clean up this test so it is platform agnostic. Added a builder to do the
file copy and rename so it is same for Windows, Linux and Mac
-rw-r--r--test/TEX/generated_files.py37
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)
""")