From 1bfdfb28bafc7c6fe26da7ebae06fff7c24af29a Mon Sep 17 00:00:00 2001 From: David Boehme Date: Thu, 16 Jan 2025 11:02:55 -0800 Subject: [PATCH] Properly escape backslashes in Python strings (#634) --- test/ci_app_tests/test_json.py | 2 +- test/ci_app_tests/test_loopreport.py | 2 +- test/ci_app_tests/test_monitor.py | 2 +- test/ci_app_tests/test_report.py | 4 ++-- test/ci_app_tests/test_textlog.py | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/ci_app_tests/test_json.py b/test/ci_app_tests/test_json.py index 04c1cdb20..d9885f573 100644 --- a/test/ci_app_tests/test_json.py +++ b/test/ci_app_tests/test_json.py @@ -63,7 +63,7 @@ def test_jsontree(self): target_cmd = [ './ci_test_macros' ] query_cmd = [ '../../src/tools/cali-query/cali-query', - '-q', 'SELECT count(),sum(time.inclusive.duration.ns),loop,iteration#main\ loop group by loop,iteration#main\ loop format json-split' ] + '-q', 'SELECT count(),sum(time.inclusive.duration.ns),loop,iteration#main\\ loop group by loop,iteration#main\\ loop format json-split' ] caliper_config = { 'CALI_CONFIG_PROFILE' : 'serial-trace', diff --git a/test/ci_app_tests/test_loopreport.py b/test/ci_app_tests/test_loopreport.py index f3cbca10e..e1177ad9d 100644 --- a/test/ci_app_tests/test_loopreport.py +++ b/test/ci_app_tests/test_loopreport.py @@ -115,7 +115,7 @@ def test_loopreport_target_loop_selection(self): """ Loop statistics option """ def test_loop_stats(self): target_cmd = [ './ci_test_macros', '10', 'spot,loop.stats,output=stdout' ] - query_cmd = [ '../../src/tools/cali-query/cali-query', '-q', 'let r=leaf() select * where r=main\ loop format json' ] + query_cmd = [ '../../src/tools/cali-query/cali-query', '-q', 'let r=leaf() select * where r=main\\ loop format json' ] obj = json.loads( cat.run_test_with_query(target_cmd, query_cmd, None) ) diff --git a/test/ci_app_tests/test_monitor.py b/test/ci_app_tests/test_monitor.py index 9be424fdc..4080d9832 100644 --- a/test/ci_app_tests/test_monitor.py +++ b/test/ci_app_tests/test_monitor.py @@ -14,7 +14,7 @@ def test_loopmonitor_iter_interval(self): caliper_config = { 'CALI_SERVICES_ENABLE' : 'loop_monitor,trace,report', 'CALI_LOOP_MONITOR_ITERATION_INTERVAL' : '5', - 'CALI_REPORT_CONFIG' : 'select * where iteration#main\ loop format expand', + 'CALI_REPORT_CONFIG' : 'select * where iteration#main\\ loop format expand', 'CALI_REPORT_FILENAME' : 'stdout', 'CALI_LOG_VERBOSITY' : '0' } diff --git a/test/ci_app_tests/test_report.py b/test/ci_app_tests/test_report.py index a8324e816..7ad0393ae 100644 --- a/test/ci_app_tests/test_report.py +++ b/test/ci_app_tests/test_report.py @@ -52,7 +52,7 @@ def test_report_nested_key(self): caliper_config = { 'CALI_SERVICES_ENABLE' : 'event,trace,report', - 'CALI_REPORT_CONFIG' : 'select *,count() group by path,iteration#main\ loop format expand', + 'CALI_REPORT_CONFIG' : 'select *,count() group by path,iteration#main\\ loop format expand', 'CALI_LOG_VERBOSITY' : '0' } @@ -97,7 +97,7 @@ def test_report_aggregation_aliases(self): caliper_config = { 'CALI_SERVICES_ENABLE' : 'event,trace,report', - 'CALI_REPORT_CONFIG' : 'select *,count() as my\\ count\\ alias group by path,iteration#main\ loop format expand', + 'CALI_REPORT_CONFIG' : 'select *,count() as my\\ count\\ alias group by path,iteration#main\\ loop format expand', 'CALI_LOG_VERBOSITY' : '0' } diff --git a/test/ci_app_tests/test_textlog.py b/test/ci_app_tests/test_textlog.py index ddf5e5421..932b08af8 100644 --- a/test/ci_app_tests/test_textlog.py +++ b/test/ci_app_tests/test_textlog.py @@ -12,7 +12,7 @@ def test_textlog_with_end_event(self): caliper_config = { 'CALI_SERVICES_ENABLE' : 'event,textlog', - 'CALI_TEXTLOG_TRIGGER' : 'iteration#main\ loop', + 'CALI_TEXTLOG_TRIGGER' : 'iteration#main\\ loop', 'CALI_TEXTLOG_FORMATSTRING' : '%region% iteration: %[2]iteration#main loop%', 'CALI_LOG_VERBOSITY' : '0', }