typedef int (*obds_test_t) (void);
#define RUN_TEST_COMMON(name, func) \
static int obds_##func (void) \
{ \
obds_test_t test_func = (obds_test_t) func; \
record_test_result(name, test_func()); \
return 0; \
}
#define RUN_TEST(name, func) \
RUN_TEST_COMMON(name, func) \
static obds_test_t __obds_test_##func __attribute__ ((used)) __attribute__ ((section(".test_launch"))) = obds_##func;
#define RUN_TEST_EARLY(name, func) \
RUN_TEST_COMMON(name, func) \
static obds_test_t __obds_test_##func __attribute__ ((used)) __attribute__ ((section(".test_launch_early"))) = obds_##func;
#define RUN_TEST_LATE(name, func) \
RUN_TEST_COMMON(name, func) \
static obds_test_t __obds_test_##func __attribute__ ((used)) __attribute__ ((section(".test_launch_late"))) = obds_##func;
#define RUN_TEST_INTERACTIVE(name, func) RUN_TEST_LATE(name, func)
#define PROMPT_RUN_TEST(name) \
do { \
printf("\n---- Running < %s > test\n", name); \
if (!auto_run_enable) { \
if (!is_input_char('y')) \
return TEST_BYPASSED; \
} \
} while (0)
extern obds_test_t __test_launch_early_start[], __test_launch_early_end[];
extern obds_test_t __test_launch_start[], __test_launch_end[];
extern obds_test_t __test_launch_late_start[], __test_launch_late_end[];
static void run_tests(void)
{
obds_test_t *test_func;
for (test_func = __test_launch_early_start; test_func < __test_launch_early_end; test_func++)
(*test_func) ();
for (test_func = __test_launch_start; test_func < __test_launch_end; test_func++)
(*test_func) ();
for (test_func = __test_launch_late_start; test_func < __test_launch_late_end; test_func++)
(*test_func) ();
}
/*
* Copyright (C) 2010, Freescale Semiconductor, Inc. All Rights Reserved
* THIS SOURCE CODE IS CONFIDENTIAL AND PROPRIETARY AND MAY NOT
* BE USED OR DISTRIBUTED WITHOUT THE WRITTEN PERMISSION OF
* Freescale Semiconductor, Inc.
*/
OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(startup)
MEMORY
{
DDR (rwx) : ORIGIN = 0x75000000, LENGTH = 512M
}
SECTIONS
{
.vectors :
{
__vectors_start = .;
*o(.vectors)
__vectors_end = .;
}>DDR
/* OBDS tests to be run early */
.test_launch_early :
{
. = ALIGN (4);
__test_launch_early_start = .;
KEEP(*(.test_launch_early))
__test_launch_early_end = .;
}
/* most OBDS tests should be put in here */
.test_launch :
{
. = ALIGN (4);
__test_launch_start = .;
KEEP(*(.test_launch))
__test_launch_end = .;
}
/* OBDS tests to be run after most tests done */
.test_launch_late :
{
. = ALIGN (4);
__test_launch_late_start = .;
KEEP(*(.test_launch_late))
__test_launch_late_end = .;
}
.text :
{
. = ALIGN (4);
*(.text)
}
.data :
{ *(.data) }
.bss :
{
. = ALIGN (4);
__bss_start__ = .;
*(.shbss)
*(.bss .bss.* .gnu.linkonce.b.*)
*(COMMON)
__bss_end__ = .;
}
. += 10K;
top_of_stacks = .;
. = ALIGN (4);
. += 8;
free_memory_start = .;
_end = .;
__end = _end;
}
RUN_TEST("GPIO LED", gpio_led_test)
RUN_TEST("BT", bt_test)
RUN_TEST_INTERACTIVE("DISPLAY", ipu_display_test_main)
RUN_TEST_EARLY("UART", uart_test)