Browse Source

Unittest lose(down + freies Feld)

main
Jannis 2 years ago
parent
commit
853c69ee60
  1. 18
      build/test/cache/test_test.c
  2. BIN
      build/test/out/c/test_test.o
  3. BIN
      build/test/out/c/test_test_runner.o
  4. BIN
      build/test/out/test_test.out
  5. 18
      build/test/preprocess/files/test_test.c
  6. 2
      build/test/results/test_Spiellogik.pass
  7. 12
      build/test/results/test_test.pass
  8. 30
      build/test/runners/test_test_runner.c

18
build/test/cache/test_test.c

@ -21,3 +21,21 @@ void tearDown(void){
} }
void test_test1(void){
int result = probe(2);
UnityAssertEqualNumber((UNITY_INT)((2)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(19), UNITY_DISPLAY_STYLE_INT);
}

BIN
build/test/out/c/test_test.o

BIN
build/test/out/c/test_test_runner.o

BIN
build/test/out/test_test.out

18
build/test/preprocess/files/test_test.c

@ -21,3 +21,21 @@ void tearDown(void){
} }
void test_test1(void){
int result = probe(2);
UnityAssertEqualNumber((UNITY_INT)((2)), (UNITY_INT)((result)), (
((void *)0)
), (UNITY_UINT)(19), UNITY_DISPLAY_STYLE_INT);
}

2
build/test/results/test_Spiellogik.pass

@ -23,4 +23,4 @@
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.0033078729993576417
:time: 0.0022634060005657375

12
build/test/results/test_test.pass

@ -2,13 +2,17 @@
:source: :source:
:path: test :path: test
:file: test_test.c :file: test_test.c
:successes: []
:successes:
- :test: test_test1
:line: 15
:message: ''
:unity_test_time: 0
:failures: [] :failures: []
:ignores: [] :ignores: []
:counts: :counts:
:total: 0
:passed: 0
:total: 1
:passed: 1
:failed: 0 :failed: 0
:ignored: 0 :ignored: 0
:stdout: [] :stdout: []
:time: 0.0013589549998869188
:time: 0.0015701629999966826

30
build/test/runners/test_test_runner.c

@ -10,6 +10,7 @@ char* GlobalOrderError;
/*=======External Functions This Runner Calls=====*/ /*=======External Functions This Runner Calls=====*/
extern void setUp(void); extern void setUp(void);
extern void tearDown(void); extern void tearDown(void);
extern void test_test1(void);
/*=======Mock Management=====*/ /*=======Mock Management=====*/
@ -42,10 +43,39 @@ void verifyTest(void)
CMock_Verify(); CMock_Verify();
} }
/*=======Test Runner Used To Run Each Test=====*/
static void run_test(UnityTestFunction func, const char* name, UNITY_LINE_TYPE line_num)
{
Unity.CurrentTestName = name;
Unity.CurrentTestLineNumber = line_num;
#ifdef UNITY_USE_COMMAND_LINE_ARGS
if (!UnityTestMatches())
return;
#endif
Unity.NumberOfTests++;
UNITY_CLR_DETAILS();
UNITY_EXEC_TIME_START();
CMock_Init();
if (TEST_PROTECT())
{
setUp();
func();
}
if (TEST_PROTECT())
{
tearDown();
CMock_Verify();
}
CMock_Destroy();
UNITY_EXEC_TIME_STOP();
UnityConcludeTest();
}
/*=======MAIN=====*/ /*=======MAIN=====*/
int main(void) int main(void)
{ {
UnityBegin("test_test.c"); UnityBegin("test_test.c");
run_test(test_test1, "test_test1", 15);
return UnityEnd(); return UnityEnd();
} }
Loading…
Cancel
Save