Commits

Rob Managan  committed 0d7af70

Testing on a Mac turned up a problem that did not show up on linux.
SK and I agree that we are surprised by that.

Both bld = env['BUILDERS']['PDF'] and bld = env['BUILDERS']['DVI'] had
lines like
bld.add_action('.tex', LaTeXAuxAction) # for DVI
bld.add_action('.tex', PDFLaTeXAuxAction) # for PDF
run from the initialization of two tools. This was a BAD thing.

That cured some test failures. For the rest I made all the TEX tests
initialize the environment with the os.environ PATH since the check
for the existence of the tools with where_is that looks on the system path.

So the tests still quietly exit if the tool is not on the system path
and now find if it is in a non-standard location like I have.

  • Participants
  • Parent commits ca05e38

Comments (0)

Files changed (10)

File src/engine/SCons/Tool/latex.py

     bld = env['BUILDERS']['DVI']
     bld.add_action('.ltx', LaTeXAuxAction)
     bld.add_action('.latex', LaTeXAuxAction)
-    bld.add_action('.tex', LaTeXAuxAction)
     bld.add_emitter('.ltx', SCons.Tool.tex.tex_eps_emitter)
     bld.add_emitter('.latex', SCons.Tool.tex.tex_eps_emitter)
-    bld.add_emitter('.tex', SCons.Tool.tex.tex_eps_emitter)
 
     env['LATEX']        = 'latex'
     env['LATEXFLAGS']   = SCons.Util.CLVar('-interaction=nonstopmode')

File src/engine/SCons/Tool/pdflatex.py

     bld = env['BUILDERS']['PDF']
     bld.add_action('.ltx', PDFLaTeXAuxAction)
     bld.add_action('.latex', PDFLaTeXAuxAction)
-    bld.add_action('.tex', PDFLaTeXAuxAction)
     bld.add_emitter('.ltx', SCons.Tool.tex.tex_pdf_emitter)
     bld.add_emitter('.latex', SCons.Tool.tex.tex_pdf_emitter)
-    bld.add_emitter('.tex', SCons.Tool.tex.tex_pdf_emitter)
 
     env['PDFLATEX']      = 'pdflatex'
     env['PDFLATEXFLAGS'] = SCons.Util.CLVar('-interaction=nonstopmode')

File test/TEX/auxiliaries.py

 test.subdir(['docs'])
 
 test.write(['SConstruct'], """\
+import os
 env = Environment(tools = ['pdftex', 'dvipdf', 'dvips', 'tex', 'latex'],
-                  ENV = {},
+                  ENV = {'PATH' : os.environ['PATH']},
                   BUILD_DIR = '#build/docs')
 
 # Use 'duplicate=1' because LaTeX toolchain does not work properly for

File test/TEX/bibliography.py

     test.skip_test("Could not find dvips or bibtex; skipping test(s).\n")
 
 test.write('SConstruct', """\
-env = Environment(tools = ['tex', 'latex', 'dvips'])
+import os
+env = Environment(tools = ['tex', 'latex', 'dvips'],ENV = {'PATH' : os.environ['PATH']})
 env.PostScript('simple', 'simple.tex')
 """)
 

File test/TEX/bibtex-latex-rerun.py

     test.skip_test("Could not find pdflatex; skipping test(s).\n")
 
 test.write(['SConstruct'], """\
-env = Environment(tools=['pdftex', 'tex'])
+import os
+env = Environment(tools=['pdftex', 'tex'],ENV = {'PATH' : os.environ['PATH']})
 env.PDF( 'bibtest.tex' )
 """)
 

File test/TEX/clean.py

 """
 
 test.write('SConstruct', """\
-DVI( "foo.ltx" )
+import os
+env = Environment(tools = ['tex', 'latex'],
+                  ENV = {'PATH' : os.environ['PATH']})
+env.DVI( "foo.ltx" )
 """)
 
 test.write('foo.ltx', input_file)

File test/TEX/makeindex.py

     test.skip_test("Could not find pdflatex or makeindex; skipping test(s).\n")
 
 test.write('SConstruct', """\
-PDF( "no_index.tex" )
-PDF( "simple.tex" )
+import os
+env = Environment(tools = ['pdftex', 'dvipdf', 'tex', 'latex'],
+                  ENV = {'PATH' : os.environ['PATH']})
+env.PDF( "no_index.tex" )
+env.PDF( "simple.tex" )
 """)
 
 test.write('no_index.tex', r"""

File test/TEX/multi-run.py

 if tex:
 
     test.write(['work1', 'SConstruct'], """\
-DVI( "foo.tex" )
-PDF( "foo.tex" )
+import os
+env = Environment(tools = ['pdftex', 'dvipdf', 'tex', 'latex'],
+                  ENV = {'PATH' : os.environ['PATH']})
+env.DVI( "foo.tex" )
+env.PDF( "foo.tex" )
 """)
 
     test.write(['work1', 'foo.tex'], input_file)
         test.fail_test(1)
 
     test.write(['work3', 'SConstruct'], """\
-DVI( "foo3.tex" )
+import os
+env = Environment(tools = ['tex', 'latex'],
+                  ENV = {'PATH' : os.environ['PATH']})
+env.DVI( "foo3.tex" )
 """)
 
     test.write(['work3', 'foo3.tex'], input_file3)
 if latex:
 
     test.write(['work2', 'SConstruct'], """\
-DVI( "foo.ltx" )
-PDF( "foo.ltx" )
+import os
+env = Environment(tools = ['dvi', 'pdf', 'pdftex', 'dvipdf', 'pdflatex', 'tex', 'latex'],
+                  ENV = {'PATH' : os.environ['PATH']})
+env.DVI( "foo.ltx" )
+env.PDF( "foo.ltx" )
 """)
 
     test.write(['work2', 'foo.ltx'], input_file)
         test.fail_test(1)
 
     test.write(['work3', 'SConstruct'], """\
-DVI( "foo3.tex" )
-PDF( "foo3.tex" )
+import os
+env = Environment(tools = ['pdftex', 'dvipdf', 'tex', 'latex'],
+                  ENV = {'PATH' : os.environ['PATH']})
+env.DVI( "foo3.tex" )
+env.PDF( "foo3.tex" )
 """)
 
     test.write(['work3', 'foo3.tex'], input_file3)
 
 
     test.write(['work4', 'SConstruct'], """\
-DVI( "foo.ltx" )
+import os
+env = Environment(tools = ['tex', 'latex'],
+                  ENV = {'PATH' : os.environ['PATH']})
+env.DVI( "foo.ltx" )
 """)
     test.write(['work4', 'foo.ltx'], input_file2)
 

File test/TEX/subdir-input.py

 test.subdir('sub')
 
 test.write('SConstruct', """\
-env = Environment(TOOLS = ['tex', 'pdftex'])
+import os
+env = Environment(TOOLS = ['tex', 'pdftex'], ENV = {'PATH' : os.environ['PATH']})
 env.PDF( 'sub/x.tex' )
 env.DVI( 'sub/x.tex' )
 """)

File test/TEX/subdir_variantdir_input.py

 test.subdir(['docs','sub'])
 
 test.write('SConstruct', """\
-env = Environment(TOOLS = ['tex', 'pdftex'])
+import os
+env = Environment(TOOLS = ['tex', 'pdftex'],ENV = {'PATH' : os.environ['PATH']})
 
 env.VariantDir('build', 'docs',duplicate=0)
 env.SConscript('build/SConscript', exports = ['env'])