Let's enable validation of examples. failures should trip errors.

Also make them verbose so we can see what is going on.
This commit is contained in:
Mark VanderVoord
2024-04-02 18:44:35 -04:00
parent 93e2f528cc
commit 9cc8fb5302
6 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ ${BUILD_DIR}/main: ${SRC_DIR}/main.c ${SRC_DIR}/foo.c
${CC} $< -o $@ ${CC} $< -o $@
run: run:
./build/main || true ./build/main
test: setup test: setup
+1 -1
View File
@@ -13,5 +13,5 @@ void test_foo_init_should_initialize_multiplier()
{ {
foo_init(); foo_init();
TEST_ASSERT_FALSE(1); TEST_ASSERT_FALSE(0);
} }
+1 -1
View File
@@ -236,7 +236,7 @@ module RakefileHelpers
else else
"#{simulator[:command]} #{simulator[:pre_support]} #{executable} #{simulator[:post_support]}" "#{simulator[:command]} #{simulator[:pre_support]} #{executable} #{simulator[:post_support]}"
end end
output = execute(cmd_str, true, true) output = execute(cmd_str, true)
test_results = $cfg['compiler']['build_path'] + test_base test_results = $cfg['compiler']['build_path'] + test_base
test_results += if output.match(/OK$/m).nil? test_results += if output.match(/OK$/m).nil?
'.testfail' '.testfail'
+1 -1
View File
@@ -99,7 +99,7 @@ if $0 == __FILE__
# --strippables are dealt with separately since the user is allowed to # --strippables are dealt with separately since the user is allowed to
# enter any valid regular expression as argument # enter any valid regular expression as argument
options = option_maker(options, 'strippables', Regexp.last_match(1)) options = option_maker(options, 'strippables', Regexp.last_match(1))
when /^--([a-zA-Z0-9._\\\/:\s]+)="?([a-zA-Z0-9._\-\\\/:\s;]*)"?/x when /^--([a-zA-Z0-9._\\\/:\s]+)="?([a-zA-Z0-9._\-\\\/:\s;@#%!$&\(\)\*]*)"?/x
options = option_maker(options, Regexp.last_match(1), options = option_maker(options, Regexp.last_match(1),
Regexp.last_match(2)) Regexp.last_match(2))
else else
+1 -1
View File
@@ -91,7 +91,7 @@ namespace :test do
desc "Test cmock examples" desc "Test cmock examples"
task :examples => [:prep_system_tests] do task :examples => [:prep_system_tests] do
run_examples() run_examples(true)
end end
#individual system tests #individual system tests
+2 -2
View File
@@ -395,7 +395,7 @@ module RakefileHelpers
end end
end end
def run_examples() def run_examples(verbose=false, raise_on_failure=true)
report "\n" report "\n"
report "-----------------\n" report "-----------------\n"
report "VALIDATE EXAMPLES\n" report "VALIDATE EXAMPLES\n"
@@ -404,7 +404,7 @@ module RakefileHelpers
"cd #{File.join("..","examples","temp_sensor")} && rake ci" "cd #{File.join("..","examples","temp_sensor")} && rake ci"
].each do |cmd| ].each do |cmd|
report "Testing '#{cmd}'" report "Testing '#{cmd}'"
execute(cmd, false) execute(cmd, verbose, raise_on_failure)
end end
end end