forked from Imagelibrary/rtems
@@ -14,7 +14,7 @@ _SUBDIRS += psxhdrs psx01 psx02 psx03 psx04 psx05 psx06 psx07 psx08 psx09 \
|
|||||||
psxspin01 psxspin02 psxsysconf \
|
psxspin01 psxspin02 psxsysconf \
|
||||||
psxtime psxtimer01 psxtimer02 psxualarm psxusleep psxfatal01 psxfatal02 \
|
psxtime psxtimer01 psxtimer02 psxualarm psxusleep psxfatal01 psxfatal02 \
|
||||||
psxintrcritical01 psxstack01 psxstack02 \
|
psxintrcritical01 psxstack01 psxstack02 \
|
||||||
psxeintr_join psxgetattrnp01
|
psxeintr_join psxgetattrnp01 psxclock01
|
||||||
if HAS_CPLUSPLUS
|
if HAS_CPLUSPLUS
|
||||||
_SUBDIRS += psxglobalcon01
|
_SUBDIRS += psxglobalcon01
|
||||||
_SUBDIRS += psxglobalcon02
|
_SUBDIRS += psxglobalcon02
|
||||||
|
|||||||
@@ -141,6 +141,7 @@ psxclassic01/Makefile
|
|||||||
psxcleanup/Makefile
|
psxcleanup/Makefile
|
||||||
psxcleanup01/Makefile
|
psxcleanup01/Makefile
|
||||||
psxclock/Makefile
|
psxclock/Makefile
|
||||||
|
psxclock01/Makefile
|
||||||
psxcond01/Makefile
|
psxcond01/Makefile
|
||||||
psxconfig01/Makefile
|
psxconfig01/Makefile
|
||||||
psxeintr_join/Makefile
|
psxeintr_join/Makefile
|
||||||
|
|||||||
21
testsuites/psxtests/psxclock01/Makefile.am
Normal file
21
testsuites/psxtests/psxclock01/Makefile.am
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
rtems_tests_PROGRAMS = psxclock01
|
||||||
|
psxclock01_SOURCES = init.c
|
||||||
|
|
||||||
|
dist_rtems_tests_DATA = psxclock01.scn
|
||||||
|
dist_rtems_tests_DATA += psxclock01.doc
|
||||||
|
|
||||||
|
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
|
||||||
|
include $(top_srcdir)/../automake/compile.am
|
||||||
|
include $(top_srcdir)/../automake/leaf.am
|
||||||
|
|
||||||
|
AM_CPPFLAGS += -I$(top_srcdir)/include
|
||||||
|
AM_CPPFLAGS += -I$(top_srcdir)/../support/include
|
||||||
|
|
||||||
|
LINK_OBJS = $(psxclock01_OBJECTS) $(psxclock01_LDADD)
|
||||||
|
LINK_LIBS = $(psxclock01_LDLIBS)
|
||||||
|
|
||||||
|
psxclock01$(EXEEXT): $(psxclock01_OBJECTS) $(psxclock01_DEPENDENCIES)
|
||||||
|
@rm -f psxclock01$(EXEEXT)
|
||||||
|
$(make-exe)
|
||||||
|
|
||||||
|
include $(top_srcdir)/../automake/local.am
|
||||||
50
testsuites/psxtests/psxclock01/init.c
Normal file
50
testsuites/psxtests/psxclock01/init.c
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2015 Gedare Bloom.
|
||||||
|
*
|
||||||
|
* The license and distribution terms for this file may be
|
||||||
|
* found in the file LICENSE in this distribution or at
|
||||||
|
* http://www.rtems.com/license/LICENSE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <tmacros.h>
|
||||||
|
#include "test_support.h"
|
||||||
|
|
||||||
|
const char rtems_test_name[] = "PSXCLOCK01";
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
|
/* forward declarations to avoid warnings */
|
||||||
|
void *POSIX_Init(void *argument);
|
||||||
|
|
||||||
|
void *POSIX_Init(void *argument)
|
||||||
|
{
|
||||||
|
clock_t start, end;
|
||||||
|
int diff = 0;
|
||||||
|
|
||||||
|
TEST_BEGIN();
|
||||||
|
|
||||||
|
start = clock();
|
||||||
|
end = 0;
|
||||||
|
if ( start >= 0 ) {
|
||||||
|
do {
|
||||||
|
end = clock();
|
||||||
|
diff = (int)(end - start)/CLOCKS_PER_SEC;
|
||||||
|
} while (diff < 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("Spun for %d second\n", diff);
|
||||||
|
|
||||||
|
TEST_END();
|
||||||
|
rtems_test_exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* configuration information */
|
||||||
|
|
||||||
|
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
|
||||||
|
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
|
||||||
|
#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
|
||||||
|
#define CONFIGURE_MAXIMUM_POSIX_THREADS 2
|
||||||
|
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
|
||||||
|
|
||||||
|
#define CONFIGURE_INIT
|
||||||
|
#include <rtems/confdefs.h>
|
||||||
|
/* end of file */
|
||||||
19
testsuites/psxtests/psxclock01/psxclock01.doc
Normal file
19
testsuites/psxtests/psxclock01/psxclock01.doc
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
# Copyright (c) 2015 Gedare Bloom
|
||||||
|
#
|
||||||
|
# The license and distribution terms for this file may be
|
||||||
|
# found in the file LICENSE in this distribution or at
|
||||||
|
# http://www.rtems.com/license/LICENSE.
|
||||||
|
#
|
||||||
|
|
||||||
|
This file describes the directives and concepts tested by this test set.
|
||||||
|
|
||||||
|
test set name: psxclock01
|
||||||
|
|
||||||
|
directives:
|
||||||
|
|
||||||
|
clock
|
||||||
|
|
||||||
|
concepts:
|
||||||
|
|
||||||
|
+ Reads clock() and converts to time in seconds.
|
||||||
|
|
||||||
3
testsuites/psxtests/psxclock01/psxclock01.scn
Normal file
3
testsuites/psxtests/psxclock01/psxclock01.scn
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
*** BEGIN OF TEST PSXCLOCK01 ***
|
||||||
|
Spun for 1 second
|
||||||
|
*** END OF TEST PSXCLOCK01 ***
|
||||||
Reference in New Issue
Block a user