From 6a8e03b5a9bfbc442729701f57d8dbbdb1715e53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Hangh=C3=B8j=20Henneberg?= Date: Mon, 17 Apr 2023 18:19:51 +0200 Subject: [PATCH] Fix filename sanitization with command line option When enabling the command line option the file name added to the runner did not escape the slashes on windows in the same way other paths where sanitized. Copied the sanitization from the other filename uses. --- auto/generate_test_runner.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auto/generate_test_runner.rb b/auto/generate_test_runner.rb index aa0f351..ace5930 100755 --- a/auto/generate_test_runner.rb +++ b/auto/generate_test_runner.rb @@ -389,7 +389,7 @@ class UnityTestRunnerGenerator output.puts(' {') output.puts(' if (parse_status < 0)') output.puts(' {') - output.puts(" UnityPrint(\"#{filename.gsub('.c', '')}.\");") + output.puts(" UnityPrint(\"#{filename.gsub('.c', '').gsub(/\\/, '\\\\\\')}.\");") output.puts(' UNITY_PRINT_EOL();') tests.each do |test| if (!@options[:use_param_tests]) || test[:args].nil? || test[:args].empty?