Better reporting during running example projects

This commit is contained in:
Mark VanderVoord
2026-05-29 11:26:20 -04:00
parent 7a591c4115
commit c3a01d8d65
4 changed files with 14 additions and 14 deletions
-1
View File
@@ -43,7 +43,6 @@ CLFAGS += -Wno-misleading-indentation
CFLAGS += -Wstrict-prototypes CFLAGS += -Wstrict-prototypes
CFLAGS += -Wundef CFLAGS += -Wundef
CFLAGS += -Wold-style-definition CFLAGS += -Wold-style-definition
#CFLAGS += -Wno-misleading-indentation
TARGET_BASE1=test1 TARGET_BASE1=test1
TARGET_BASE2=test2 TARGET_BASE2=test2
-1
View File
@@ -43,7 +43,6 @@ CLFAGS += -Wno-misleading-indentation
CFLAGS += -Wstrict-prototypes CFLAGS += -Wstrict-prototypes
CFLAGS += -Wundef CFLAGS += -Wundef
CFLAGS += -Wold-style-definition CFLAGS += -Wold-style-definition
#CFLAGS += -Wno-misleading-indentation
TARGET_BASE1=all_tests TARGET_BASE1=all_tests
TARGET1 = $(TARGET_BASE1)$(TARGET_EXTENSION) TARGET1 = $(TARGET_BASE1)$(TARGET_EXTENSION)
+1 -1
View File
@@ -42,7 +42,7 @@ CFLAGS += -Wno-unknown-pragmas
CFLAGS += -Wstrict-prototypes CFLAGS += -Wstrict-prototypes
CFLAGS += -Wundef CFLAGS += -Wundef
CFLAGS += -Wold-style-definition CFLAGS += -Wold-style-definition
#CFLAGS += -Wno-misleading-indentation CFLAGS += -Wno-misleading-indentation
TARGET_BASE1=test1 TARGET_BASE1=test1
+13 -11
View File
@@ -419,24 +419,26 @@ module RakefileHelpers
end end
def run_examples() def run_examples()
report "\nRunning Unity Examples"
total_tests = total_ignored = 0 total_tests = total_ignored = 0
# If we're set up to use gcc, the makefiles should work too. otherwise, just run example 3 # If we're set up to use gcc, the makefiles should work too. otherwise, just run example 3
examples = if $cfg_file_base.nil? || ($cfg_file_base =~ /gcc/) examples = if $cfg_file_base.nil? || ($cfg_file_base =~ /gcc/)
[ {
"cd ../examples/example_1 && make -s ci", :example_1 => "cd ../examples/example_1 && make -s ci",
"cd ../examples/example_2 && make -s ci" :example_2 => "cd ../examples/example_2 && make -s ci"
] }
else else
[] {}
end + if $unity_test_config_file_in_targets
["cd ../examples/example_3 && rake config[#{$cfg_file_base}] default"]
else
["cd ../examples/example_3 && rake config[\"../#{$unity_test_config_file}\"] default"]
end end
examples.each do |cmd| if $unity_test_config_file_in_targets
examples[:example_3] = "cd ../examples/example_3 && rake config[#{$cfg_file_base}] default"
else
examples[:example_3] = "cd ../examples/example_3 && rake config[\"../#{$unity_test_config_file}\"] default"
end
examples.each_pair do |key, cmd|
report "\nRunning Unity Example: #{key.to_s}"
execute(cmd, false).each_line do |line| execute(cmd, false).each_line do |line|
if line =~ /(\d+) Tests \d+ Failures (\d+) Ignored/ if line =~ /(\d+) Tests \d+ Failures (\d+) Ignored/
total_tests += Regexp.last_match(1).to_i total_tests += Regexp.last_match(1).to_i