X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fkern%2Fproc_test%2Fcoop_test.c;fp=bertos%2Fkern%2Fproc_test%2Fcoop_test.c;h=c8ec86a9ae7678216b0acb15827058e7a7725702;hb=d63d14e5bcf9973047715fe87bf6aaeecb65dd4a;hp=0000000000000000000000000000000000000000;hpb=bc0d169d26c9e9bc9977c2ff82b39b63f6c42d0a;p=bertos.git diff --git a/bertos/kern/proc_test/coop_test.c b/bertos/kern/proc_test/coop_test.c new file mode 100644 index 00000000..c8ec86a9 --- /dev/null +++ b/bertos/kern/proc_test/coop_test.c @@ -0,0 +1,60 @@ +/** + * \file + * + * + * + * \brief Test kernel preemption. + * + * This testcase spawns TASKS parallel threads that runs for TIME seconds. They + * continuously spin updating a global counter (one counter for each thread). + * + * At exit each thread checks if the others have been che chance to update + * their own counter. If not, it means the preemption didn't occur and the + * testcase returns an error message. + * + * Otherwise, if all the threads have been able to update their own counter it + * means preemption successfully occurs, since there is no active sleep inside + * each thread's implementation. + * + * \author Andrea Righi + * + * $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_monitor.h $cfgdir/ + * $test$: sed -i "s/CONFIG_KERN_MONITOR 0/CONFIG_KERN_MONITOR 1/" $cfgdir/cfg_monitor.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 + * + * notest: all + */ + +#include "../proc_test.c"