mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2026-01-25 09:21:36 +01:00
Refactor all yaml files for self-tests to fit Ceedling format for wider reuse.
Fix mistake in unity selftest without output spy running. Namespace self-tests for consistency across ThrowTheSwitch projects (like being able to test:all) Reduce clutter of NAMED self-tests in task list.
This commit is contained in:
@@ -786,7 +786,7 @@ RUNNER_TESTS = [
|
||||
:options => {
|
||||
:cmdline_args => true,
|
||||
},
|
||||
:cmdline_args => "-n testRunnerGeneratorSma*",
|
||||
:cmdline_args => "-n=testRunnerGeneratorSma*",
|
||||
:expected => {
|
||||
:to_pass => [ 'test_ThisTestAlwaysPasses',
|
||||
'spec_ThisTestPassesWhenNormalSetupRan',
|
||||
@@ -1183,15 +1183,7 @@ def runner_test(test, runner, expected, test_defines, cmdline_args, features)
|
||||
link_it(test_base, obj_list)
|
||||
|
||||
# Execute unit test and generate results file
|
||||
simulator = build_simulator_fields
|
||||
cmdline_args ||= ""
|
||||
executable = $cfg['linker']['bin_files']['destination'] + test_base + $cfg['linker']['bin_files']['extension'] + " #{cmdline_args}"
|
||||
cmd_str = if simulator.nil?
|
||||
executable
|
||||
else
|
||||
"#{simulator[:command]} #{simulator[:pre_support]} #{executable} #{simulator[:post_support]}"
|
||||
end
|
||||
output = execute(cmd_str, true)
|
||||
output = runtest(test_base, true, cmdline_args)
|
||||
|
||||
#compare to the expected pass/fail
|
||||
allgood = expected[:to_pass].inject(true) {|s,v| s && verify_match(/#{v}:PASS/, output) }
|
||||
|
||||
@@ -6029,6 +6029,8 @@ void putcharSpy(int c)
|
||||
putcharSpyBuffer[indexSpyBuffer++] = (char)c;
|
||||
} else
|
||||
putchar((char)c);
|
||||
#else
|
||||
(void)c;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -6047,6 +6049,9 @@ void flushSpy(void)
|
||||
|
||||
void testFailureCountIncrementsAndIsReturnedAtEnd(void)
|
||||
{
|
||||
#ifndef USING_OUTPUT_SPY
|
||||
TEST_IGNORE();
|
||||
#else
|
||||
UNITY_UINT savedFailures = Unity.TestFailures;
|
||||
Unity.CurrentTestFailed = 1;
|
||||
startPutcharSpy(); /* Suppress output */
|
||||
@@ -6067,6 +6072,7 @@ void testFailureCountIncrementsAndIsReturnedAtEnd(void)
|
||||
Unity.TestFailures--;
|
||||
endPutcharSpy();
|
||||
TEST_ASSERT_EQUAL(savedFailures + 1, failures);
|
||||
#endif
|
||||
}
|
||||
|
||||
void testCstringsEscapeSequence(void)
|
||||
|
||||
Reference in New Issue
Block a user