diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-10-12 10:00:10 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-10-12 10:53:16 +0200 |
commit | ee537ea3dd964d4de3565a36b4857af31fb5a3f4 (patch) | |
tree | ad8b328a58469ca0632e3e61cd94f37c9d97cc25 /testsuites/ada/sptests/spname01 | |
parent | ada-tests: Use _SUBDIRS instead of SUBDIRS (diff) | |
download | rtems-ee537ea3dd964d4de3565a36b4857af31fb5a3f4.tar.bz2 |
ada-tests: Move to testsuites/ada
This solves a build dependency issue, e.g. building tests before
librtemsbsp.a exists.
Close #3079.
Diffstat (limited to 'testsuites/ada/sptests/spname01')
-rw-r--r-- | testsuites/ada/sptests/spname01/Makefile.am | 18 | ||||
-rw-r--r-- | testsuites/ada/sptests/spname01/ada_spname01.scn | 3 | ||||
-rw-r--r-- | testsuites/ada/sptests/spname01/config.h | 31 | ||||
-rw-r--r-- | testsuites/ada/sptests/spname01/spname01.adb | 28 | ||||
-rw-r--r-- | testsuites/ada/sptests/spname01/sptest.adb | 62 | ||||
-rw-r--r-- | testsuites/ada/sptests/spname01/sptest.ads | 25 |
6 files changed, 167 insertions, 0 deletions
diff --git a/testsuites/ada/sptests/spname01/Makefile.am b/testsuites/ada/sptests/spname01/Makefile.am new file mode 100644 index 0000000000..fccab37289 --- /dev/null +++ b/testsuites/ada/sptests/spname01/Makefile.am @@ -0,0 +1,18 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +noinst_PROGRAMS = ada_spname01 +ada_spname01_SOURCES = spname01.adb config.h sptest.adb sptest.ads + +ada_spname01$(EXEEXT): spname01.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +init.$(OBJEXT): ../../support/init.c + $(COMPILE.c) -I$(srcdir) -c $< + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_spname01.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/sptests/spname01/ada_spname01.scn b/testsuites/ada/sptests/spname01/ada_spname01.scn new file mode 100644 index 0000000000..825cd14437 --- /dev/null +++ b/testsuites/ada/sptests/spname01/ada_spname01.scn @@ -0,0 +1,3 @@ +*** Ada Task Name TEST *** +TBD +*** END OF Ada Task Name TEST *** diff --git a/testsuites/ada/sptests/spname01/config.h b/testsuites/ada/sptests/spname01/config.h new file mode 100644 index 0000000000..2be186cc2a --- /dev/null +++ b/testsuites/ada/sptests/spname01/config.h @@ -0,0 +1,31 @@ +/* config.h + * + * This include file defines the Configuration Table for this test. + * + * COPYRIGHT (c) 1989-2008. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may in + * the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + + +/* configuration information */ + +#define CONFIGURE_APPLICATION + +/* NOTICE: the clock driver is explicitly disabled */ +#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#define CONFIGURE_MAXIMUM_TASKS 1 + +#include <rtems/confdefs.h> + +/* end of include file */ diff --git a/testsuites/ada/sptests/spname01/spname01.adb b/testsuites/ada/sptests/spname01/spname01.adb new file mode 100644 index 0000000000..863e64f24e --- /dev/null +++ b/testsuites/ada/sptests/spname01/spname01.adb @@ -0,0 +1,28 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test Hello of the Sample Test Suite. +-- +-- DEPENDENCIES: +-- +-- +-- +-- COPYRIGHT (c) 1989-2009. +-- On-Line Applications Research Corporation (OAR). +-- +-- The license and distribution terms for this file may in +-- the file LICENSE in this distribution or at +-- http://www.rtems.org/license/LICENSE. +-- + +procedure SPNAME01 is +begin + + loop + delay 120.0; + end loop; + +end SPNAME01; + diff --git a/testsuites/ada/sptests/spname01/sptest.adb b/testsuites/ada/sptests/spname01/sptest.adb new file mode 100644 index 0000000000..5dd78d8e4a --- /dev/null +++ b/testsuites/ada/sptests/spname01/sptest.adb @@ -0,0 +1,62 @@ +-- +-- SPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of the Ada Task Name test of the RTEMS +-- Ada Single Processor Test Suite. +-- +-- DEPENDENCIES: +-- +-- +-- +-- COPYRIGHT (c) 1989-2009. +-- On-Line Applications Research Corporation (OAR). +-- +-- The license and distribution terms for this file may in +-- the file LICENSE in this distribution or at +-- http://www.rtems.org/license/LICENSE. +-- + +with RTEMS; +with TEST_SUPPORT; +with TEXT_IO; +with System; use System; -- for Null Pointer comparison + +package body SPTEST is + + task body AdaTask is + Status : RTEMS.Status_Codes; + Pointer : RTEMS.Address; + StringName : String(1 .. 120) := (1 .. 120 => '*' ); + NewName : constant String := "Josiah"; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** Ada Task Name TEST ***" ); + + RTEMS.Object_Get_Name( RTEMS.Self, StringName, Pointer ); + if Pointer = RTEMS.Null_Address then + TEXT_IO.PUT_LINE( "Object_Get_Name_Failed" ); + else + TEXT_IO.PUT_LINE( "My name is (" & StringName & ")" ); + end if; + + TEXT_IO.PUT_LINE( "Setting name to (Josiah)" ); + RTEMS.Object_Set_Name( RTEMS.Self, NewName, Status ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "Object_Set_Name" ); + + RTEMS.Object_Get_Name( RTEMS.Self, StringName, Pointer ); + if Pointer = RTEMS.Null_Address then + TEXT_IO.PUT_LINE( "Object_Get_Name_Failed" ); + else + TEXT_IO.PUT_LINE( "My name is (" & StringName & ")" ); + end if; + + TEXT_IO.PUT_LINE( "*** END OF Ada Task Name TEST ***" ); + + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end AdaTask; + +end SPTEST; diff --git a/testsuites/ada/sptests/spname01/sptest.ads b/testsuites/ada/sptests/spname01/sptest.ads new file mode 100644 index 0000000000..5e4f682221 --- /dev/null +++ b/testsuites/ada/sptests/spname01/sptest.ads @@ -0,0 +1,25 @@ +-- +-- SPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for the Hello World Test of the RTEMS +-- Sample Test Suite. +-- +-- DEPENDENCIES: +-- +-- +-- +-- COPYRIGHT (c) 1989-2009. +-- On-Line Applications Research Corporation (OAR). +-- +-- The license and distribution terms for this file may in +-- the file LICENSE in this distribution or at +-- http://www.rtems.org/license/LICENSE. +-- + +package SPTEST is + + task AdaTask; + +end SPTEST; |