• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* This Test File Is Used To Verify Many Combinations Of Using the Generate Test Runner Script */
2 
3 #include <stdio.h>
4 #include "unity.h"
5 #include "Defs.h"
6 
7 TEST_FILE("some_file.c")
8 
9 /* Notes about prefixes:
10    test     - normal default prefix. these are "always run" tests for this procedure
11    spec     - normal default prefix. required to run default setup/teardown calls.
12 */
13 
14 /* Support for Meta Test Rig */
15 #define TEST_CASE(a)
16 
17 /* Include Passthroughs for Linking Tests */
putcharSpy(int c)18 void putcharSpy(int c) { (void)putchar(c);}
flushSpy(void)19 void flushSpy(void) {}
20 
21 /* Global Variables Used During These Tests */
22 int CounterSetup = 0;
23 int CounterTeardown = 0;
24 int CounterSuiteSetup = 0;
25 
setUp(void)26 void setUp(void)
27 {
28     CounterSetup = 1;
29 }
30 
tearDown(void)31 void tearDown(void)
32 {
33     CounterTeardown = 1;
34 }
35 
custom_setup(void)36 void custom_setup(void)
37 {
38     CounterSetup = 2;
39 }
40 
custom_teardown(void)41 void custom_teardown(void)
42 {
43     CounterTeardown = 2;
44 }
45 
test_ThisTestAlwaysPasses(void)46 void test_ThisTestAlwaysPasses(void)
47 {
48     TEST_PASS();
49 }
50 
test_ThisTestAlwaysFails(void)51 void test_ThisTestAlwaysFails(void)
52 {
53     TEST_FAIL_MESSAGE("This Test Should Fail");
54 }
55 
test_ThisTestAlwaysIgnored(void)56 void test_ThisTestAlwaysIgnored(void)
57 {
58     TEST_IGNORE_MESSAGE("This Test Should Be Ignored");
59 }
60 
spec_ThisTestPassesWhenNormalSetupRan(void)61 void spec_ThisTestPassesWhenNormalSetupRan(void)
62 {
63     TEST_ASSERT_EQUAL_MESSAGE(1, CounterSetup, "Normal Setup Wasn't Run");
64 }
65 
spec_ThisTestPassesWhenNormalTeardownRan(void)66 void spec_ThisTestPassesWhenNormalTeardownRan(void)
67 {
68     TEST_ASSERT_EQUAL_MESSAGE(1, CounterTeardown, "Normal Teardown Wasn't Run");
69 }
70 
71