From 9e3cf110dee968c08cfe15196ab0910a7fad072d Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Thu, 30 Nov 2023 19:58:21 -0600 Subject: [PATCH] Fix many incorrect string escape sequences. --- test/debugger.py | 10 +++++----- test/feature_implicit_dependency.py | 4 ++-- test/generators_test.py | 4 ++-- test/testing.py | 28 ++++++++++++++-------------- test/timedata.py | 8 ++++---- test/toolset-mock/src/MockProgram.py | 2 +- 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/test/debugger.py b/test/debugger.py index 856cef0c4d..6ef81a9d61 100644 --- a/test/debugger.py +++ b/test/debugger.py @@ -45,7 +45,7 @@ def test_run(): run(t, """\ (b2db) run -ftest.jam Starting program: {{bjam}} -ftest.jam -Child {{\d+}} exited with status 0 +Child {{\\d+}} exited with status 0 (b2db) quit """) @@ -60,7 +60,7 @@ def test_exit_status(): (b2db) run -ftest.jam Starting program: {{bjam}} -ftest.jam -Child {{\d+}} exited with status 1 +Child {{\\d+}} exited with status 1 (b2db) quit """) t.cleanup() @@ -384,7 +384,7 @@ def test_breakpoints(): Deleted breakpoint 3 (b2db) run -ftest.jam Starting program: {{bjam}} -ftest.jam -Child {{\d+}} exited with status 0 +Child {{\\d+}} exited with status 0 (b2db) quit """) t.cleanup() @@ -473,7 +473,7 @@ def test_breakpoints_running(): (b2db) clear test.jam:12 Deleted breakpoint 4 (b2db) continue -Child {{\d+}} exited with status 0 +Child {{\\d+}} exited with status 0 (b2db) quit """) t.cleanup() @@ -553,7 +553,7 @@ def test_run_running(): Breakpoint 1, module scope at test.jam:1 1 UPDATE ; (b2db) run -ftest.jam -Child {{\d+}} exited with status 0 +Child {{\\d+}} exited with status 0 Starting program: {{bjam}} -ftest.jam Breakpoint 1, module scope at test.jam:1 1 UPDATE ; diff --git a/test/feature_implicit_dependency.py b/test/feature_implicit_dependency.py index 55699ffb9d..0122f3dc08 100644 --- a/test/feature_implicit_dependency.py +++ b/test/feature_implicit_dependency.py @@ -87,14 +87,14 @@ class bbb-generator : generator flags make-ccc AAAPATH : ; rule make-ccc ( target : sources * : properties * ) { - ECHO aaa path\: [ on $(target) return $(AAAPATH) ] ; + ECHO aaa path\\: [ on $(target) return $(AAAPATH) ] ; common.copy $(target) : $(sources) ; } flags make-ddd BBBPATH : ; rule make-ddd ( target : sources * : properties * ) { - ECHO bbb path\: [ on $(target) return $(BBBPATH) ] ; + ECHO bbb path\\: [ on $(target) return $(BBBPATH) ] ; common.copy $(target) : $(sources) ; } diff --git a/test/generators_test.py b/test/generators_test.py index 606fe8644b..3eee05d8ba 100644 --- a/test/generators_test.py +++ b/test/generators_test.py @@ -252,9 +252,9 @@ def test_generated_target_names(): We use the following target generation structure with differently named BBX targets: - /---> BB1 ---\ + /---> BB1 ---\\ AAA --<----> BB2 ---->--> CCC --(composing)--> DDD - \---> BB3 ---/ + \\---> BB3 ---/ The extra generator at the end is needed because generating a top-level CCC target directly would requires us to explicitly specify a name for it. diff --git a/test/testing.py b/test/testing.py index e34ab11f4c..c711ac0ee4 100755 --- a/test/testing.py +++ b/test/testing.py @@ -529,20 +529,20 @@ def write_subdir(dir): t.write("outside/project/Jamroot", "run ../other/test.cpp ;") t.run_build_system(["--dump-tests", "-n", "-d0"], match=TestCmd.match_re, stdout= -"""boost-test\(RUN\) ".*/pass-run" : "pass-run\.cpp" -boost-test\(RUN_FAIL\) ".*/fail-run" : "fail-run\.cpp" -boost-test\(LINK\) ".*/pass-link" : "pass-link\.cpp" -boost-test\(LINK_FAIL\) ".*/fail-link" : "fail-link\.cpp" -boost-test\(COMPILE\) ".*/pass-compile" : "pass-compile\.cpp" -boost-test\(COMPILE_FAIL\) ".*/fail-compile" : "fail-compile\.cpp" -boost-test\(RUN\) "any/test" : "libs/any/test\.cpp" -boost-test\(RUN\) "any/test" : "libs/any/test/test\.cpp" -boost-test\(RUN\) "any/test" : "libs/any/example/test\.cpp" -boost-test\(RUN\) "bcp/test" : "tools/bcp/test/test\.cpp" -boost-test\(RUN\) "bcp/test" : "tools/bcp/example/test\.cpp" -boost-test\(RUN\) ".*/subdir/test/test" : "subdir/test/test\.cpp" -boost-test\(RUN\) "test" : "status/test\.cpp" -boost-test\(RUN\) ".*/outside/project/test" : "../other/test.cpp" +"""boost-test\\(RUN\\) ".*/pass-run" : "pass-run\\.cpp" +boost-test\\(RUN_FAIL\\) ".*/fail-run" : "fail-run\\.cpp" +boost-test\\(LINK\\) ".*/pass-link" : "pass-link\\.cpp" +boost-test\\(LINK_FAIL\\) ".*/fail-link" : "fail-link\\.cpp" +boost-test\\(COMPILE\\) ".*/pass-compile" : "pass-compile\\.cpp" +boost-test\\(COMPILE_FAIL\\) ".*/fail-compile" : "fail-compile\\.cpp" +boost-test\\(RUN\\) "any/test" : "libs/any/test\\.cpp" +boost-test\\(RUN\\) "any/test" : "libs/any/test/test\\.cpp" +boost-test\\(RUN\\) "any/test" : "libs/any/example/test\\.cpp" +boost-test\\(RUN\\) "bcp/test" : "tools/bcp/test/test\\.cpp" +boost-test\\(RUN\\) "bcp/test" : "tools/bcp/example/test\\.cpp" +boost-test\\(RUN\\) ".*/subdir/test/test" : "subdir/test/test\\.cpp" +boost-test\\(RUN\\) "test" : "status/test\\.cpp" +boost-test\\(RUN\\) ".*/outside/project/test" : "../other/test.cpp" """) t.cleanup() diff --git a/test/timedata.py b/test/timedata.py index 6d66b6b0b2..3a4e25a787 100644 --- a/test/timedata.py +++ b/test/timedata.py @@ -77,12 +77,12 @@ def basic_jam_action_test(): t.write("baz", "nothing") expected_output = """\ -\.\.\.found 4 targets\.\.\. -\.\.\.updating 2 targets\.\.\. +\\.\\.\\.found 4 targets\\.\\.\\. +\\.\\.\\.updating 2 targets\\.\\.\\. make bar time foo -bar +user: [0-9\.]+ +system: +[0-9\.]+ +clock: +[0-9\.]+ * -\.\.\.updated 2 targets\.\.\.$ +bar +user: [0-9.]+ +system: +[0-9.]+ +clock: +[0-9.]+ * +\\.\\.\\.updated 2 targets\\.\\.\\.$ """ t.run_build_system(["-ffile.jam", "-d+1"], stdout=expected_output, diff --git a/test/toolset-mock/src/MockProgram.py b/test/toolset-mock/src/MockProgram.py index f0cc858d7f..2d411efa38 100644 --- a/test/toolset-mock/src/MockProgram.py +++ b/test/toolset-mock/src/MockProgram.py @@ -190,7 +190,7 @@ def allow_properties(*args): # Use this in the stdout argument of command to print the command # for running another script. def script(name): - return os.path.join(os.path.dirname(__file__), "bin", re.sub('\.py$', '', name)) + return os.path.join(os.path.dirname(__file__), "bin", re.sub('\\.py$', '', name)) def match(command_line): for (p, stdout) in known_patterns: