diff options
author | Joel Sherrill <joel@rtems.org> | 2018-10-25 14:17:33 -0500 |
---|---|---|
committer | Joel Sherrill <joel@rtems.org> | 2018-10-25 14:17:33 -0500 |
commit | 6a0e43493925318caef11dbf4c5b12a4b3ddcb7d (patch) | |
tree | b174a8de0ea25f0d4a69d315d2f2a0c47a3051c8 | |
parent | sim-scripts/erc32-tsim.in: New file (diff) | |
download | rtems-testing-6a0e43493925318caef11dbf4c5b12a4b3ddcb7d.tar.bz2 |
rtems-test-template: Update
-rwxr-xr-x | rtems-test-template/mktest | 57 | ||||
-rw-r--r-- | rtems-test-template/psxtest/init.c | 13 | ||||
-rw-r--r-- | rtems-test-template/psxtest_with_thread/init.c | 4 | ||||
-rw-r--r-- | rtems-test-template/psxtmtest_blocking/init.c | 5 | ||||
-rw-r--r-- | rtems-test-template/psxtmtest_init_destroy/init.c | 10 | ||||
-rw-r--r-- | rtems-test-template/psxtmtest_single/init.c | 10 | ||||
-rw-r--r-- | rtems-test-template/psxtmtest_unblocking_nopreempt/init.c | 12 | ||||
-rw-r--r-- | rtems-test-template/psxtmtest_unblocking_preempt/init.c | 12 | ||||
-rw-r--r-- | rtems-test-template/smptest/init.c | 13 | ||||
-rw-r--r-- | rtems-test-template/spfatal/testcase.h | 2 | ||||
-rw-r--r-- | rtems-test-template/sptest/init.c | 11 | ||||
-rw-r--r-- | rtems-test-template/sptest_operation_from_tsr/init.c | 10 | ||||
-rw-r--r-- | rtems-test-template/sptest_with_task/init.c | 11 | ||||
-rw-r--r-- | rtems-test-template/tmtest/init.c | 4 |
14 files changed, 94 insertions, 80 deletions
diff --git a/rtems-test-template/mktest b/rtems-test-template/mktest index 136838e..4bd157e 100755 --- a/rtems-test-template/mktest +++ b/rtems-test-template/mktest @@ -23,31 +23,45 @@ check_status() usage() { - echo "$progname -s SOURCE -d DEST -D description -n NUMBER [-v]" - echo " OR" - echo "$progname -c -d DEST" + echo "Usage: $progname arguments" cat <<EOF +where arguments are the following + + -t template_dir - (required) Directory with test templates + -s source_template - (required) Specific template to use + -d DEST - (required) Output directory for test + -D description - (required) test description string + -n NUMBER - (required) test number + [-v] - (optional) enable verbose mode + +Example: + +.../mktest -t .../rtems-testing/rtems-test-template \\ + -s psxtmtest_unblocking_preempt \\ + -d psxtmEXAMPLE01 \\ + -n 01 \\ + -n "Example 01" + The first form is to generate a new test. -The second form is to add the new test to CVS. EOF exit 1 } -addToCVS=no source= dest= desc= +templateDir=NOT_SET testNum= verbose=no -while getopts cd:D:s:n:v OPT +while getopts d:D:s:t:n:v OPT do case "$OPT" in - c) addToCVS=`toggle ${addToCVS}` ;; d) dest=$OPTARG ;; D) desc=$OPTARG ;; s) source=$OPTARG ;; n) testNum=$OPTARG ;; + t) templateDir=$OPTARG ;; v) verbose=`toggle ${verbose}` ;; *) usage ;; esac @@ -59,30 +73,18 @@ check_status $? No destination provided test -r configure.ac check_status $? Not in test suite directory - -if [ ${addToCVS} == yes ] ; then - test -d ${dest} - check_status $? "Cannot add ${dest} -- does not exist" - - cvs add ${dest} - cd ${dest} - for f in `ls -1 .cvsignore Makefile.am *.doc *.scn *.[ch] 2>/dev/null` - do - cvs add -kkv ${f} - done - exit 0 -fi +test "${templateDir}" != "NOT_SET" +check_status $? No test template directory provided +test -d "${templateDir}" +check_status $? ${templateDir} is not a directory test "X${source}" != "X" check_status $? No source provided -test -d "${source}" +test -d "${templateDir}/${source}" check_status $? Source directory not present test "X${testNum}" != "X" check_status $? No test number provided -test ! -d ${dest}/CVS -check_status $? "Are you sure about ${dest}? Already a CVS directory in it" - let $((shiftcount = $OPTIND - 1)) shift #shiftcount @@ -99,7 +101,7 @@ mkdir ${dest} check_status $? "Unable to make ${dest}" # all the source code we know about -for s in ${source}/* +for s in ${templateDir}/${source}/* do if [ -r ${s} -a ! -d ${s} ] ; then b=`basename ${s}` @@ -114,11 +116,6 @@ do fi done -cat <<EOF >${dest}/.cvsignore -Makefile -Makefile.in -EOF - cat <<EOF You need to add the test to the Makefile.am and configure.ac by hand before you can build. diff --git a/rtems-test-template/psxtest/init.c b/rtems-test-template/psxtest/init.c index a6e16e5..a67796c 100644 --- a/rtems-test-template/psxtest/init.c +++ b/rtems-test-template/psxtest/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2013. + * COPYRIGHT (c) 1989-2018. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -7,9 +7,10 @@ * http://www.rtems.com/license/LICENSE. */ -#include <tmacros.h> #include "test_support.h" +const char rtems_test_name[] = "@UPPER@"; + /* forward declarations to avoid warnings */ void *POSIX_Init(void *argument); @@ -17,11 +18,11 @@ void *POSIX_Init( rtems_task_argument argument ) { - puts( "\n\n*** POSIX TEST @UPPER@ ***" ); + TEST_BEGIN(); /* XXX test code goes here */ - puts( "*** END OF POSIX TEST @UPPER@ ***" ); + TEST_END(); rtems_test_exit(0); } @@ -31,10 +32,12 @@ void *POSIX_Init( #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER -#define CONFIGURE_MAXIMUM_POSIX_THREADS 2 +#define CONFIGURE_MAXIMUM_POSIX_THREADS 1 #define CONFIGURE_POSIX_INIT_THREAD_TABLE +#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION + #define CONFIGURE_INIT #include <rtems/confdefs.h> /* end of file */ diff --git a/rtems-test-template/psxtest_with_thread/init.c b/rtems-test-template/psxtest_with_thread/init.c index 5367891..62126a1 100644 --- a/rtems-test-template/psxtest_with_thread/init.c +++ b/rtems-test-template/psxtest_with_thread/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2013. + * COPYRIGHT (c) 1989-2018. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -49,6 +49,8 @@ void *POSIX_Init( #define CONFIGURE_POSIX_INIT_THREAD_TABLE +#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION + #define CONFIGURE_INIT #include <rtems/confdefs.h> /* end of file */ diff --git a/rtems-test-template/psxtmtest_blocking/init.c b/rtems-test-template/psxtmtest_blocking/init.c index d18c54b..ff8ec9d 100644 --- a/rtems-test-template/psxtmtest_blocking/init.c +++ b/rtems-test-template/psxtmtest_blocking/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2013. + * COPYRIGHT (c) 1989-2018. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -12,8 +12,7 @@ #endif #include <timesys.h> -#include <tmacros.h> -#include <rtems/timerdrv.h> +#include <rtems/btimer.h> #include "test_support.h" #include <pthread.h> diff --git a/rtems-test-template/psxtmtest_init_destroy/init.c b/rtems-test-template/psxtmtest_init_destroy/init.c index 384c1f4..66d98d1 100644 --- a/rtems-test-template/psxtmtest_init_destroy/init.c +++ b/rtems-test-template/psxtmtest_init_destroy/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2013. + * COPYRIGHT (c) 1989-2018. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -12,9 +12,11 @@ #endif #include <timesys.h> -#include <rtems/timerdrv.h> +#include <rtems/btimer.h> #include "test_support.h" +const char rtems_test_name[] = "@UPPER@";"" + /* forward declarations to avoid warnings */ void *POSIX_Init(void *argument); void benchmark_NAME_OF_CREATE_OPERATION(void); @@ -67,14 +69,14 @@ void *POSIX_Init( ) { - puts( "\n\n*** POSIX TIME TEST @UPPER@ ***" ); + TEST_BEGIN(); /* XXX any required initialization goes here */ benchmark_NAME_OF_CREATE_OPERATION(); benchmark_NAME_OF_DELETE_OPERATION(); - puts( "*** END OF POSIX TIME TEST @UPPER@ ***" ); + TEST_END(); rtems_test_exit(0); } diff --git a/rtems-test-template/psxtmtest_single/init.c b/rtems-test-template/psxtmtest_single/init.c index 8ee5ba3..e303b6b 100644 --- a/rtems-test-template/psxtmtest_single/init.c +++ b/rtems-test-template/psxtmtest_single/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2013. + * COPYRIGHT (c) 1989-2018. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -12,9 +12,11 @@ #endif #include <timesys.h> -#include <rtems/timerdrv.h> +#include <rtems/btimer.h> #include "test_support.h" +const char rtems_test_name[] = "@UPPER@";"" + /* forward declarations to avoid warnings */ void *POSIX_Init(void *argument); void benchmark_NAME_OF_OPERATION(void); @@ -45,13 +47,13 @@ void *POSIX_Init( ) { - puts( "\n\n*** POSIX TIME TEST @UPPER@ ***" ); + TEST_BEGIN(); /* XXX any required initialization goes here */ benchmark_NAME_OF_OPERATION(); - puts( "*** END OF POSIX TIME TEST @UPPER@ ***" ); + TEST_END(); rtems_test_exit(0); } diff --git a/rtems-test-template/psxtmtest_unblocking_nopreempt/init.c b/rtems-test-template/psxtmtest_unblocking_nopreempt/init.c index 4069772..d74bbfc 100644 --- a/rtems-test-template/psxtmtest_unblocking_nopreempt/init.c +++ b/rtems-test-template/psxtmtest_unblocking_nopreempt/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2013. + * COPYRIGHT (c) 1989-2018. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -11,13 +11,13 @@ #include "config.h" #endif -#include <coverhd.h> -#include <tmacros.h> #include <timesys.h> #include "test_support.h" #include <pthread.h> #include <sched.h> -#include <rtems/timerdrv.h> +#include <rtems/btimer.h> + +const char rtems_test_name[] = "@UPPER@";"" /* forward declarations to avoid warnings */ void *POSIX_Init(void *argument); @@ -44,7 +44,7 @@ void *POSIX_Init( pthread_t threadId; long end_time; - puts( "\n\n*** POSIX TIME TEST @UPPER@ ***" ); + TEST_BEGIN(); status = pthread_create( &threadId, NULL, Blocker, NULL ); rtems_test_assert( status == 0 ); @@ -82,7 +82,7 @@ void *POSIX_Init( 0 ); - puts( "*** END OF POSIX TIME TEST @UPPER@ ***" ); + TEST_END(); rtems_test_exit( 0 ); return NULL; diff --git a/rtems-test-template/psxtmtest_unblocking_preempt/init.c b/rtems-test-template/psxtmtest_unblocking_preempt/init.c index 8951cdb..90256bf 100644 --- a/rtems-test-template/psxtmtest_unblocking_preempt/init.c +++ b/rtems-test-template/psxtmtest_unblocking_preempt/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2013. + * COPYRIGHT (c) 1989-2018. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -11,13 +11,13 @@ #include "config.h" #endif -#include <coverhd.h> -#include <tmacros.h> #include <timesys.h> #include "test_support.h" #include <pthread.h> #include <sched.h> -#include <rtems/timerdrv.h> +#include <rtems/btimer.h> + +const char rtems_test_name[] = "@UPPER@";"" /* forward declarations to avoid warnings */ void *POSIX_Init(void *argument); @@ -46,7 +46,7 @@ void *Low( 0 ); - puts( "*** END OF POSIX TIME TEST @UPPER@ ***" ); + TEST_END(); rtems_test_exit( 0 ); return NULL; } @@ -82,7 +82,7 @@ void *POSIX_Init( pthread_attr_t attr; struct sched_param param; - puts( "\n\n*** POSIX TIME TEST @UPPER@ ***" ); + TEST_BEGIN(); /* * Deliberately create the XXX BEFORE the threads. This way the diff --git a/rtems-test-template/smptest/init.c b/rtems-test-template/smptest/init.c index dd02dd2..5e0f502 100644 --- a/rtems-test-template/smptest/init.c +++ b/rtems-test-template/smptest/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2013. + * COPYRIGHT (c) 1989-2018. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -7,9 +7,10 @@ * http://www.rtems.com/license/LICENSE. */ -#include <tmacros.h> #include "test_support.h" +const char rtems_test_name[] = "@UPPER@"; + /* forward declarations to avoid warnings */ rtems_task Init(rtems_task_argument argument); rtems_task Test_task(rtems_task_argument argument); @@ -31,7 +32,7 @@ rtems_task Init( rtems_id id; rtems_status_code status; - puts( "\n\n*** TEST @UPPER@ ***" ); + TEST_BEGIN(); for ( i=0; i<_SMP_Processor_count-1; i++ ) { ch = '1' + i; @@ -55,7 +56,7 @@ rtems_task Init( /* XXX something goes here */ - puts( "*** END OF TEST @UPPER@ ***" ); + TEST_END(); rtems_test_exit(0); } @@ -64,14 +65,14 @@ rtems_task Init( #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER -#define CONFIGURE_SMP_APPLICATION #define CONFIGURE_SMP_MAXIMUM_PROCESSORS 2 #define CONFIGURE_MAXIMUM_TASKS \ (1 + CONFIGURE_SMP_MAXIMUM_PROCESSORS) #define CONFIGURE_RTEMS_INIT_TASKS_TABLE -#define CONFIGURE_INIT +#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION +#define CONFIGURE_INIT #include <rtems/confdefs.h> /* end of file */ diff --git a/rtems-test-template/spfatal/testcase.h b/rtems-test-template/spfatal/testcase.h index e089b3a..5a9fb74 100644 --- a/rtems-test-template/spfatal/testcase.h +++ b/rtems-test-template/spfatal/testcase.h @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2013. + * COPYRIGHT (c) 1989-2018. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be diff --git a/rtems-test-template/sptest/init.c b/rtems-test-template/sptest/init.c index c494314..2fe6bf8 100644 --- a/rtems-test-template/sptest/init.c +++ b/rtems-test-template/sptest/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2013. + * COPYRIGHT (c) 1989-2018. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -10,6 +10,8 @@ #include <tmacros.h> #include "test_support.h" +const char rtems_test_name[] = "@UPPER@"; + /* forward declarations to avoid warnings */ rtems_task Init(rtems_task_argument argument); @@ -17,11 +19,11 @@ rtems_task Init( rtems_task_argument argument ) { - puts( "\n\n*** TEST @UPPER@ ***" ); + TEST_BEGIN(); /* XXX test code goes here */ - puts( "*** END OF TEST @UPPER@ ***" ); + TEST_END(); rtems_test_exit(0); } @@ -34,7 +36,8 @@ rtems_task Init( #define CONFIGURE_MAXIMUM_TASKS 1 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE -#define CONFIGURE_INIT +#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION +#define CONFIGURE_INIT #include <rtems/confdefs.h> /* end of file */ diff --git a/rtems-test-template/sptest_operation_from_tsr/init.c b/rtems-test-template/sptest_operation_from_tsr/init.c index 91195b6..af4dc3b 100644 --- a/rtems-test-template/sptest_operation_from_tsr/init.c +++ b/rtems-test-template/sptest_operation_from_tsr/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2013. + * COPYRIGHT (c) 1989-2018. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -9,6 +9,8 @@ #include <tmacros.h> +const char rtems_test_name[] = "@UPPER@"; + /* forward declarations to avoid warnings */ rtems_task Init(rtems_task_argument argument); rtems_timer_service_routine test_operation_from_isr( @@ -35,7 +37,7 @@ rtems_task Init( rtems_status_code status; rtems_id timer; - puts( "\n\n*** TEST @UPPER@ ***" ); + TEST_BEGIN(); /* * Timer used in multiple ways @@ -72,7 +74,7 @@ rtems_task Init( /* XXX also may be able to confirm operation actually was performed */ puts( "Operation from ISR successfully processed" ); - puts( "*** END OF TEST @UPPER@ ***" ); + TEST_END(); rtems_test_exit( 0 ); } @@ -86,6 +88,8 @@ rtems_task Init( #define CONFIGURE_MAXIMUM_TASKS 1 #define CONFIGURE_MAXIMUM_TIMERS 1 +#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION + #define CONFIGURE_INIT #include <rtems/confdefs.h> /* end of file */ diff --git a/rtems-test-template/sptest_with_task/init.c b/rtems-test-template/sptest_with_task/init.c index 2482462..bc0d904 100644 --- a/rtems-test-template/sptest_with_task/init.c +++ b/rtems-test-template/sptest_with_task/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2013. + * COPYRIGHT (c) 1989-2018. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -10,6 +10,8 @@ #include <tmacros.h> #include "test_support.h" +const char rtems_test_name[] = "@UPPER@"; + /* forward declarations to avoid warnings */ rtems_task Init(rtems_task_argument argument); rtems_task Test_task(rtems_task_argument argument); @@ -28,7 +30,7 @@ rtems_task Init( rtems_status_code status; rtems_id task_id; - puts( "\n\n*** TEST @UPPER@ ***" ); + TEST_BEGIN(); status = rtems_task_create( rtems_build_name( 'T', 'E', 'S', 'T' ), @@ -43,7 +45,7 @@ rtems_task Init( status = rtems_task_start( task_id, Test_task, 0 ); directive_failed( status, "rtems_task_start" ); - puts( "*** END OF TEST @UPPER@ ***" ); + TEST_END(); rtems_test_exit(0); } @@ -55,7 +57,8 @@ rtems_task Init( #define CONFIGURE_MAXIMUM_TASKS 2 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE -#define CONFIGURE_INIT +#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION +#define CONFIGURE_INIT #include <rtems/confdefs.h> /* end of file */ diff --git a/rtems-test-template/tmtest/init.c b/rtems-test-template/tmtest/init.c index a0cd42d..f82356c 100644 --- a/rtems-test-template/tmtest/init.c +++ b/rtems-test-template/tmtest/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2013. + * COPYRIGHT (c) 1989-2018. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -7,8 +7,6 @@ * http://www.rtems.com/license/LICENSE. */ -#include <coverhd.h> -#include <tmacros.h> #include <timesys.h> #include "test_support.h" |