1 /* -------------------------------- Arctic Core ------------------------------
2 * Arctic Core - the open source AUTOSAR platform http://arccore.com
4 * Copyright (C) 2009 ArcCore AB <contact@arccore.com>
6 * This source code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published by the
8 * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * -------------------------------- Arctic Core ------------------------------*/
16 * Contains mostly macros for the test-system. Most macro's have the same
17 * name as in embUnit, to make it easier to use.
24 #include "test_framework.h"
27 typedef void (*test_func_t)( void );
30 #define TEST_INIT() printf("Test init\n");
\r
31 #define TEST_FAIL(_text) test_fail((_text), __FILE__, __LINE__, __FUNCTION__ )
\r
32 #define TEST_OK() test_ok();
33 #define TEST_ASSERT(_cond) if(!(_cond)) { TEST_FAIL(#_cond); }
34 /* Start to run a test */
35 #define TEST_RUN() printf("Running test %d\n",test_nr);
36 /* Indicate that a test is done */
38 #define TEST_START(_str,_nr) testStart(_str,_nr)
39 #define TEST_NEXT(_str,_next_nr) testEnd(); testStart(_str,_next_nr);
42 extern int test_suite;
\r
45 #define TASK_ID_ILL 99
47 #define ALARM_ID_ILL 99
48 #define SCHTBL_ID_ILL 99
49 #define COUNTER_ID_ILL 99
53 #define SECTION_USER
\r
55 #define SECTION_SUP __attribute__ ((section(".text_app_sup")))
\r
56 #define SECTION_USER __attribute__ ((section(".text_app_user")))
\r
59 #define SECTION_BSS_SUPER __attribute__ ((aligned (16),section(".bss")))
\r
60 #define SECTION_BSS_USER __attribute__ ((aligned (16),section(".bss")))
\r
62 #define OS_STR__(x) #x
63 #define OS_STRSTR__(x) OS_STR__(x)
65 #define DECLARE_TEST_BTASK(_nr, _task1, _task2, _task3 ) \
66 __attribute__ ((section (".test_btask"))) const test_func_t btask_sup_matrix_ ## _nr[3] = { _task1, _task2, _task3 }
68 #define DECLARE_TEST_ETASK(_nr, _task1, _task2, _task3 ) \
69 __attribute__ ((section (".test_etask"))) const test_func_t etask_sup_matrix_ ## _nr[3] = { _task1, _task2, _task3 }
71 #define DECLARE_TASKS(_nr) \
\r
72 void etask_sup_l_##_nr( void ); \
\r
73 void etask_sup_m_##_nr( void ); \
\r
74 void etask_sup_h_##_nr( void ); \
\r
75 void btask_sup_l_##_nr( void ); \
\r
76 void btask_sup_m_##_nr( void ); \
\r
77 void btask_sup_h_##_nr( void );
\r
84 // Test master processes
\r
86 void etask_master( void );
\r
87 void etask_sup_l( void ) SECTION_SUP;
\r
88 void etask_sup_m( void ) SECTION_SUP;
\r
89 void etask_sup_h( void ) SECTION_SUP;
\r
91 void btask_sup_l( void ) SECTION_SUP;
\r
92 void btask_sup_m( void ) SECTION_SUP;
\r
93 void btask_sup_h( void ) SECTION_SUP;
\r
102 #endif /* OS_TEST_H_ */
\r