From: asterix Date: Wed, 11 Jan 2012 18:14:39 +0000 (+0000) Subject: Add first version of rtask_test. X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=74faf5921f42900b64d60328706d0c524b89684f;p=bertos.git Add first version of rtask_test. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@5254 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/bertos/kern/rtask_test.c b/bertos/kern/rtask_test.c new file mode 100644 index 00000000..d903600b --- /dev/null +++ b/bertos/kern/rtask_test.c @@ -0,0 +1,88 @@ +/** + * \file + * + * + * \brief RTask test. + * + * + * \author Daniele Basile + * + * $test$: cp bertos/cfg/cfg_proc.h $cfgdir/ + * $test$: echo "#undef CONFIG_KERN" >> $cfgdir/cfg_proc.h + * $test$: echo "#define CONFIG_KERN 1" >> $cfgdir/cfg_proc.h + * $test$: cp bertos/cfg/cfg_signal.h $cfgdir/ + * $test$: echo "#undef CONFIG_KERN_SIGNALS" >> $cfgdir/cfg_signal.h + * $test$: echo "#define CONFIG_KERN_SIGNALS 1" >> $cfgdir/cfg_signal.h + * + */ + +#include + +#include + +#include +#include + +static bool test1(void *data) +{ + kprintf("Funziona!\n"); + return true; +} + +/** + * Run rtask test + */ +int rtask_testRun(void) +{ + RTask *task = rtask_add(test1, 100, NULL); + return (task != NULL ? 0 : -1); +} + +int rtask_testSetup(void) +{ + kdbg_init(); + + kprintf("Init Timer.."); + timer_init(); + kprintf("Done.\n"); + + kprintf("Init Process.."); + proc_init(); + kprintf("Done.\n"); + return 0; +} + +int rtask_testTearDown(void) +{ + kputs("TearDown rtask test.\n"); + return 0; +} + +TEST_MAIN(rtask);