summaryrefslogtreecommitdiffstats
path: root/test/TEX
diff options
context:
space:
mode:
authorMats Wichmann <mats@linux.com>2020-02-07 18:52:53 (GMT)
committerMats Wichmann <mats@linux.com>2020-02-07 23:39:37 (GMT)
commite8e8d71df80b9b690ef9f2d5b83378f23677e30f (patch)
tree975bfaf04b6b8d63d86fcb0827f4b8e8d226af73 /test/TEX
parentef011014b343288919292560fa24e108874c059a (diff)
downloadSCons-e8e8d71df80b9b690ef9f2d5b83378f23677e30f.zip
SCons-e8e8d71df80b9b690ef9f2d5b83378f23677e30f.tar.gz
SCons-e8e8d71df80b9b690ef9f2d5b83378f23677e30f.tar.bz2
Stop calling os.system in tests.
This converts the remaining tests that called os.system themselves to use subprocess instead. Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'test/TEX')
-rwxr-xr-xtest/TEX/biber_biblatex.py7
-rw-r--r--test/TEX/biber_biblatex2.py7
-rwxr-xr-xtest/TEX/biblatex.py7
-rw-r--r--test/TEX/biblatex_plain.py7
-rw-r--r--test/TEX/clean.py7
-rw-r--r--test/TEX/glossaries.py7
-rw-r--r--test/TEX/glossary.py7
-rw-r--r--test/TEX/lstinputlisting.py7
-rw-r--r--test/TEX/multibib.py7
-rw-r--r--test/TEX/newglossary.py7
-rw-r--r--test/TEX/nomencl.py7
-rw-r--r--test/TEX/recursive_scanner_dependencies_import.py7
-rw-r--r--test/TEX/variant_dir_bibunit.py7
-rw-r--r--test/TEX/variant_dir_newglossary.py7
14 files changed, 56 insertions, 42 deletions
diff --git a/test/TEX/biber_biblatex.py b/test/TEX/biber_biblatex.py
index 6ee8121..10c75af 100755
--- a/test/TEX/biber_biblatex.py
+++ b/test/TEX/biber_biblatex.py
@@ -30,8 +30,9 @@ Test creation of a Tex document that uses the multibib oackage
Test courtesy Rob Managan.
"""
+import subprocess
+
import TestSCons
-import os
test = TestSCons.TestSCons()
@@ -43,8 +44,8 @@ biber = test.where_is('biber')
if not biber:
test.skip_test("Could not find 'biber'; skipping test.\n")
-gloss = os.system('kpsewhich biblatex.sty')
-if not gloss==0:
+cp = subprocess.run('kpsewhich biblatex.sty', shell=True)
+if cp.returncode:
test.skip_test("biblatex.sty not installed; skipping test(s).\n")
diff --git a/test/TEX/biber_biblatex2.py b/test/TEX/biber_biblatex2.py
index 61fafcf..92c7ea9 100644
--- a/test/TEX/biber_biblatex2.py
+++ b/test/TEX/biber_biblatex2.py
@@ -32,8 +32,9 @@ Require both be installed
Test courtesy Rob Managan.
"""
+import subprocess
+
import TestSCons
-import os
test = TestSCons.TestSCons()
@@ -49,8 +50,8 @@ bibtex = test.where_is('bibtex')
if not bibtex:
test.skip_test("Could not find 'bibtex'; skipping test.\n")
-biblatex = os.system('kpsewhich biblatex.sty')
-if not biblatex==0:
+cp = subprocess.run('kpsewhich biblatex.sty', shell=True)
+if cp.returncode:
test.skip_test("biblatex.sty not installed; skipping test(s).\n")
diff --git a/test/TEX/biblatex.py b/test/TEX/biblatex.py
index bb88aaa..1e605cf 100755
--- a/test/TEX/biblatex.py
+++ b/test/TEX/biblatex.py
@@ -30,8 +30,9 @@ Test creation of a Tex document that uses the biblatex package
Test courtesy Rob Managan.
"""
+import subprocess
+
import TestSCons
-import os
test = TestSCons.TestSCons()
@@ -39,8 +40,8 @@ latex = test.where_is('pdflatex')
if not latex:
test.skip_test("Could not find 'pdflatex'; skipping test.\n")
-biblatex = os.system('kpsewhich biblatex.sty')
-if not biblatex==0:
+cp = subprocess.run('kpsewhich biblatex.sty', shell=True)
+if cp.returncode:
test.skip_test("biblatex.sty not installed; skipping test(s).\n")
diff --git a/test/TEX/biblatex_plain.py b/test/TEX/biblatex_plain.py
index 5cad924..0fe15f8 100644
--- a/test/TEX/biblatex_plain.py
+++ b/test/TEX/biblatex_plain.py
@@ -30,8 +30,9 @@ Test creation of a Tex document that uses the biblatex package
Test courtesy Rob Managan.
"""
+import subprocess
+
import TestSCons
-import os
test = TestSCons.TestSCons()
@@ -39,8 +40,8 @@ latex = test.where_is('pdflatex')
if not latex:
test.skip_test("Could not find 'pdflatex'; skipping test.\n")
-biblatex = os.system('kpsewhich biblatex.sty')
-if not biblatex==0:
+cp = subprocess.run('kpsewhich biblatex.sty', shell=True)
+if cp.returncode:
test.skip_test("biblatex.sty not installed; skipping test(s).\n")
diff --git a/test/TEX/clean.py b/test/TEX/clean.py
index 781caa1..4cae61d 100644
--- a/test/TEX/clean.py
+++ b/test/TEX/clean.py
@@ -28,7 +28,8 @@ r"""
Check that all auxilary files created by LaTeX are properly cleaned by scons -c.
"""
-import os
+import subprocess
+
import TestSCons
test = TestSCons.TestSCons()
@@ -38,8 +39,8 @@ latex = test.where_is('latex')
if not latex:
test.skip_test("Could not find 'latex'; skipping test(s).\n")
-comment = os.system('kpsewhich comment.sty')
-if not comment==0:
+cp = subprocess.run('kpsewhich comment.sty', shell=True)
+if cp.returncode:
test.skip_test("comment.sty not installed; skipping test(s).\n")
# package hyperref generates foo.out
diff --git a/test/TEX/glossaries.py b/test/TEX/glossaries.py
index cbb6964..a9fd1dc 100644
--- a/test/TEX/glossaries.py
+++ b/test/TEX/glossaries.py
@@ -31,7 +31,8 @@ be aware of the necessary created glossary files.
Test configuration contributed by Robert Managan.
"""
-import os
+import subprocess
+
import TestSCons
test = TestSCons.TestSCons()
@@ -41,8 +42,8 @@ latex = test.where_is('latex')
if not latex:
test.skip_test("Could not find 'latex'; skipping test(s).\n")
-gloss = os.system('kpsewhich glossaries.sty')
-if not gloss==0:
+cp = subprocess.run('kpsewhich glossaries.sty', shell=True)
+if cp.returncode:
test.skip_test("glossaries.sty not installed; skipping test(s).\n")
test.write('SConstruct', """\
diff --git a/test/TEX/glossary.py b/test/TEX/glossary.py
index ef13ca1..d4ab579 100644
--- a/test/TEX/glossary.py
+++ b/test/TEX/glossary.py
@@ -31,7 +31,8 @@ be aware of the necessary created glossary files.
Test configuration contributed by Robert Managan.
"""
-import os
+import subprocess
+
import TestSCons
test = TestSCons.TestSCons()
@@ -41,8 +42,8 @@ latex = test.where_is('latex')
if not latex:
test.skip_test("Could not find 'latex'; skipping test(s).\n")
-gloss = os.system('kpsewhich glossary.sty')
-if not gloss==0:
+cp = subprocess.run('kpsewhich glossary.sty', shell=True)
+if cp.returncode:
test.skip_test("glossary.sty not installed; skipping test(s).\n")
test.write('SConstruct', """\
diff --git a/test/TEX/lstinputlisting.py b/test/TEX/lstinputlisting.py
index 1f5020b..40f935b 100644
--- a/test/TEX/lstinputlisting.py
+++ b/test/TEX/lstinputlisting.py
@@ -31,8 +31,9 @@ changes.
Thanks to Stefan Hepp for the patch that fixed this.
"""
+import subprocess
+
import TestSCons
-import os
test = TestSCons.TestSCons()
@@ -41,8 +42,8 @@ pdflatex = test.where_is('pdflatex')
if not pdflatex:
test.skip_test("Could not find 'pdflatex'; skipping test(s).\n")
-listings = os.system('kpsewhich listings.sty')
-if not listings==0:
+cp = subprocess.run('kpsewhich listings.sty', shell=True)
+if cp.returncode:
test.skip_test("listings.sty not installed; skipping test(s).\n")
test.write(['SConstruct'], """\
diff --git a/test/TEX/multibib.py b/test/TEX/multibib.py
index 114ade6..f80384a 100644
--- a/test/TEX/multibib.py
+++ b/test/TEX/multibib.py
@@ -30,8 +30,9 @@ Test creation of a Tex document that uses the multibib oackage
Test courtesy Rob Managan.
"""
+import subprocess
+
import TestSCons
-import os
test = TestSCons.TestSCons()
@@ -39,8 +40,8 @@ latex = test.where_is('latex')
if not latex:
test.skip_test("Could not find 'latex'; skipping test.\n")
-multibib = os.system('kpsewhich multibib.sty')
-if not multibib==0:
+cp = subprocess.run('kpsewhich multibib.sty', shell=True)
+if cp.returncode:
test.skip_test("multibib.sty not installed; skipping test(s).\n")
test.subdir(['src'])
diff --git a/test/TEX/newglossary.py b/test/TEX/newglossary.py
index 5d868a8..70296cf 100644
--- a/test/TEX/newglossary.py
+++ b/test/TEX/newglossary.py
@@ -31,7 +31,8 @@ be aware of the necessary created glossary files.
Test configuration contributed by Robert Managan.
"""
-import os
+import subprocess
+
import TestSCons
test = TestSCons.TestSCons()
@@ -41,8 +42,8 @@ latex = test.where_is('latex')
if not latex:
test.skip_test("Could not find 'latex'; skipping test(s).\n")
-gloss = os.system('kpsewhich glossaries.sty')
-if not gloss==0:
+cp = subprocess.run('kpsewhich glossaries.sty', shell=True)
+if cp.returncode:
test.skip_test("glossaries.sty not installed; skipping test(s).\n")
test.write('SConstruct', """\
diff --git a/test/TEX/nomencl.py b/test/TEX/nomencl.py
index 0eb0b84..9cbced7 100644
--- a/test/TEX/nomencl.py
+++ b/test/TEX/nomencl.py
@@ -31,7 +31,8 @@ be aware of the necessary created glossary files.
Test configuration contributed by Robert Managan.
"""
-import os
+import subprocess
+
import TestSCons
test = TestSCons.TestSCons()
@@ -41,8 +42,8 @@ latex = test.where_is('latex')
if not latex:
test.skip_test("Could not find 'latex'; skipping test(s).\n")
-nomencl = os.system('kpsewhich nomencl.sty')
-if not nomencl==0:
+cp = subprocess.run('kpsewhich nomencl.sty', shell=True)
+if cp.returncode:
test.skip_test("nomencl.sty not installed; skipping test(s).\n")
test.write('SConstruct', """\
diff --git a/test/TEX/recursive_scanner_dependencies_import.py b/test/TEX/recursive_scanner_dependencies_import.py
index a7b5e4a..7b6cb65 100644
--- a/test/TEX/recursive_scanner_dependencies_import.py
+++ b/test/TEX/recursive_scanner_dependencies_import.py
@@ -34,7 +34,8 @@ recursive_scanner_dependencies_input.py test because \input and
dependencies are found only by the scanner.
"""
-import os
+import subprocess
+
import TestSCons
test = TestSCons.TestSCons()
@@ -44,8 +45,8 @@ pdflatex = test.where_is('pdflatex')
if not pdflatex:
test.skip_test("Could not find 'pdflatex'; skipping test(s).\n")
-latex_import = os.system('kpsewhich import.sty')
-if latex_import != 0:
+cp = subprocess.run('kpsewhich import.sty', shell=True)
+if cp.returncode:
test.skip_test("import.sty not installed; skipping test(s).\n")
test.subdir('subdir')
diff --git a/test/TEX/variant_dir_bibunit.py b/test/TEX/variant_dir_bibunit.py
index e127a76..2a669ba 100644
--- a/test/TEX/variant_dir_bibunit.py
+++ b/test/TEX/variant_dir_bibunit.py
@@ -34,8 +34,9 @@ Latex produces by default.
Test courtesy Rob Managan.
"""
+import subprocess
+
import TestSCons
-import os
test = TestSCons.TestSCons()
@@ -44,8 +45,8 @@ bibtex = test.where_is('bibtex')
if not all((latex, bibtex)):
test.skip_test("Could not find 'latex' and/or 'bibtex'; skipping test.\n")
-bibunits = os.system('kpsewhich bibunits.sty')
-if not bibunits==0:
+cp = subprocess.run('kpsewhich bibunits.sty', shell=True)
+if cp.returncode:
test.skip_test("bibunits.sty not installed; skipping test(s).\n")
test.subdir(['src'])
diff --git a/test/TEX/variant_dir_newglossary.py b/test/TEX/variant_dir_newglossary.py
index 5e4d10d..ae865aa 100644
--- a/test/TEX/variant_dir_newglossary.py
+++ b/test/TEX/variant_dir_newglossary.py
@@ -31,7 +31,8 @@ with variant_dir.
Test configuration contributed by Kendrick Boyd.
"""
-import os
+import subprocess
+
import TestSCons
test = TestSCons.TestSCons()
@@ -41,8 +42,8 @@ latex = test.where_is('latex')
if not latex:
test.skip_test("Could not find 'latex'; skipping test(s).\n")
-gloss = os.system('kpsewhich glossaries.sty')
-if gloss!=0:
+cp = subprocess.run('kpsewhich glossaries.sty', shell=True)
+if cp.returncode:
test.skip_test("glossaries.sty not installed; skipping test(s).\n")