summaryrefslogtreecommitdiff
path: root/test/runtest/simple
diff options
context:
space:
mode:
Diffstat (limited to 'test/runtest/simple')
-rw-r--r--test/runtest/simple/combined.py28
-rw-r--r--test/runtest/simple/fail.py25
-rw-r--r--test/runtest/simple/no_result.py31
-rw-r--r--test/runtest/simple/pass.py18
4 files changed, 50 insertions, 52 deletions
diff --git a/test/runtest/simple/combined.py b/test/runtest/simple/combined.py
index a54e57c12..e594c5048 100644
--- a/test/runtest/simple/combined.py
+++ b/test/runtest/simple/combined.py
@@ -1,6 +1,8 @@
#!/usr/bin/env python
#
-# __COPYRIGHT__
+# MIT License
+#
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -20,9 +22,6 @@
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
"""
Test a combination of a passing test, failing test, and no-result
@@ -45,20 +44,20 @@ test.write_failing_test(test_fail_py)
test.write_no_result_test(test_no_result_py)
test.write_passing_test(test_pass_py)
-expect_stdout = """\
-%(pythonstring)s%(pythonflags)s %(test_fail_py)s
+expect_stdout = f"""\
+{pythonstring}{pythonflags} {test_fail_py}
FAILING TEST STDOUT
-%(pythonstring)s%(pythonflags)s %(test_no_result_py)s
+{pythonstring}{pythonflags} {test_no_result_py}
NO RESULT TEST STDOUT
-%(pythonstring)s%(pythonflags)s %(test_pass_py)s
+{pythonstring}{pythonflags} {test_pass_py}
PASSING TEST STDOUT
Failed the following test:
-\t%(test_fail_py)s
+\t{test_fail_py}
NO RESULT from the following test:
-\t%(test_no_result_py)s
-""" % locals()
+\t{test_no_result_py}
+"""
expect_stderr = """\
FAILING TEST STDERR
@@ -66,12 +65,7 @@ NO RESULT TEST STDERR
PASSING TEST STDERR
"""
-test.run(
- arguments='-k test',
- status=1,
- stdout=expect_stdout,
- stderr=expect_stderr
-)
+test.run(arguments='-k test', status=1, stdout=expect_stdout, stderr=expect_stderr)
test.must_exist('failed_tests.log')
test.must_contain('failed_tests.log', test_fail_py)
diff --git a/test/runtest/simple/fail.py b/test/runtest/simple/fail.py
index f26f00e9a..5e1979a1b 100644
--- a/test/runtest/simple/fail.py
+++ b/test/runtest/simple/fail.py
@@ -1,6 +1,8 @@
#!/usr/bin/env python
#
-# __COPYRIGHT__
+# MIT License
+#
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -20,38 +22,35 @@
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
"""
Test how we handle a failing test specified on the command line.
"""
+import os
+
import TestRuntest
pythonstring = TestRuntest.pythonstring
pythonflags = TestRuntest.pythonflags
+test_fail_py = os.path.join('test', 'fail.py')
test = TestRuntest.TestRuntest()
-
test.subdir('test')
-
test.write_failing_test(['test', 'fail.py'])
-expect_stdout = """\
-%(pythonstring)s%(pythonflags)s test/fail.py
+expect_stdout = f"""\
+{pythonstring}{pythonflags} {test_fail_py}
FAILING TEST STDOUT
-""" % locals()
+"""
expect_stderr = """\
FAILING TEST STDERR
"""
-test.run(arguments='-k test/fail.py',
- status=1,
- stdout=expect_stdout,
- stderr=expect_stderr)
+test.run(
+ arguments='-k test/fail.py', status=1, stdout=expect_stdout, stderr=expect_stderr
+)
test.pass_test()
diff --git a/test/runtest/simple/no_result.py b/test/runtest/simple/no_result.py
index 33f28e4a9..beb82b01c 100644
--- a/test/runtest/simple/no_result.py
+++ b/test/runtest/simple/no_result.py
@@ -27,35 +27,40 @@
Test how we handle a no-results test specified on the command line.
"""
+import os
+
import TestRuntest
pythonstring = TestRuntest.pythonstring
pythonflags = TestRuntest.pythonflags
+test_no_result_py = os.path.join('test', 'no_result.py')
test = TestRuntest.TestRuntest()
-
test.subdir('test')
-
test.write_no_result_test(['test', 'no_result.py'])
-expect_stdout = """\
-%(pythonstring)s%(pythonflags)s test/no_result.py
+expect_stdout = f"""\
+{pythonstring}{pythonflags} {test_no_result_py}
NO RESULT TEST STDOUT
-""" % locals()
+"""
expect_stderr = """\
NO RESULT TEST STDERR
"""
-test.run(arguments='--no-ignore-skips -k test/no_result.py',
- status=2,
- stdout=expect_stdout,
- stderr=expect_stderr)
+test.run(
+ arguments='--no-ignore-skips -k test/no_result.py',
+ status=2,
+ stdout=expect_stdout,
+ stderr=expect_stderr,
+)
-test.run(arguments='-k test/no_result.py',
- status=0,
- stdout=expect_stdout,
- stderr=expect_stderr)
+test.run(
+ arguments='-k test/no_result.py',
+ status=0,
+ stdout=expect_stdout,
+ stderr=expect_stderr,
+)
test.pass_test()
diff --git a/test/runtest/simple/pass.py b/test/runtest/simple/pass.py
index 7ceb9a054..408ef4c28 100644
--- a/test/runtest/simple/pass.py
+++ b/test/runtest/simple/pass.py
@@ -1,6 +1,8 @@
#!/usr/bin/env python
#
-# __COPYRIGHT__
+# MIT License
+#
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -20,29 +22,27 @@
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
"""
Test how we handle a passing test specified on the command line.
"""
+import os
+
import TestRuntest
pythonstring = TestRuntest.pythonstring
pythonflags = TestRuntest.pythonflags
+test_pass_py = os.path.join('test', 'pass.py')
test = TestRuntest.TestRuntest()
-
test.subdir('test')
-
test.write_passing_test(['test', 'pass.py'])
-expect_stdout = """\
-%(pythonstring)s%(pythonflags)s test/pass.py
+expect_stdout = f"""\
+{pythonstring}{pythonflags} {test_pass_py}
PASSING TEST STDOUT
-""" % locals()
+"""
expect_stderr = """\
PASSING TEST STDERR