1
0
mirror of https://github.com/ThrowTheSwitch/Unity.git synced 2026-01-23 00:15:58 +01:00

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.
This commit is contained in:
Jon Hanghøj Henneberg
2023-04-17 18:19:51 +02:00
parent c40b80a917
commit 6a8e03b5a9

View File

@@ -389,7 +389,7 @@ class UnityTestRunnerGenerator
output.puts(' {') output.puts(' {')
output.puts(' if (parse_status < 0)') output.puts(' if (parse_status < 0)')
output.puts(' {') output.puts(' {')
output.puts(" UnityPrint(\"#{filename.gsub('.c', '')}.\");") output.puts(" UnityPrint(\"#{filename.gsub('.c', '').gsub(/\\/, '\\\\\\')}.\");")
output.puts(' UNITY_PRINT_EOL();') output.puts(' UNITY_PRINT_EOL();')
tests.each do |test| tests.each do |test|
if (!@options[:use_param_tests]) || test[:args].nil? || test[:args].empty? if (!@options[:use_param_tests]) || test[:args].nil? || test[:args].empty?