mirror of
https://github.com/ThrowTheSwitch/CMock.git
synced 2026-08-02 01:07:50 +00:00
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:
@@ -23,7 +23,7 @@ ${BUILD_DIR}/main: ${SRC_DIR}/main.c ${SRC_DIR}/foo.c
|
||||
${CC} $< -o $@
|
||||
|
||||
run:
|
||||
./build/main || true
|
||||
./build/main
|
||||
|
||||
test: setup
|
||||
|
||||
|
||||
@@ -13,5 +13,5 @@ void test_foo_init_should_initialize_multiplier()
|
||||
{
|
||||
foo_init();
|
||||
|
||||
TEST_ASSERT_FALSE(1);
|
||||
TEST_ASSERT_FALSE(0);
|
||||
}
|
||||
|
||||
@@ -236,7 +236,7 @@ module RakefileHelpers
|
||||
else
|
||||
"#{simulator[:command]} #{simulator[:pre_support]} #{executable} #{simulator[:post_support]}"
|
||||
end
|
||||
output = execute(cmd_str, true, true)
|
||||
output = execute(cmd_str, true)
|
||||
test_results = $cfg['compiler']['build_path'] + test_base
|
||||
test_results += if output.match(/OK$/m).nil?
|
||||
'.testfail'
|
||||
|
||||
+1
-1
@@ -99,7 +99,7 @@ if $0 == __FILE__
|
||||
# --strippables are dealt with separately since the user is allowed to
|
||||
# enter any valid regular expression as argument
|
||||
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),
|
||||
Regexp.last_match(2))
|
||||
else
|
||||
|
||||
+1
-1
@@ -91,7 +91,7 @@ namespace :test do
|
||||
|
||||
desc "Test cmock examples"
|
||||
task :examples => [:prep_system_tests] do
|
||||
run_examples()
|
||||
run_examples(true)
|
||||
end
|
||||
|
||||
#individual system tests
|
||||
|
||||
@@ -395,7 +395,7 @@ module RakefileHelpers
|
||||
end
|
||||
end
|
||||
|
||||
def run_examples()
|
||||
def run_examples(verbose=false, raise_on_failure=true)
|
||||
report "\n"
|
||||
report "-----------------\n"
|
||||
report "VALIDATE EXAMPLES\n"
|
||||
@@ -404,7 +404,7 @@ module RakefileHelpers
|
||||
"cd #{File.join("..","examples","temp_sensor")} && rake ci"
|
||||
].each do |cmd|
|
||||
report "Testing '#{cmd}'"
|
||||
execute(cmd, false)
|
||||
execute(cmd, verbose, raise_on_failure)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user