summaryrefslogtreecommitdiffstats
path: root/testsuites/libtests
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-12-04 09:38:27 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-12-05 07:47:06 +0100
commite870941bb0f2f300e8fd252c7e30ecaabbe50841 (patch)
treee250a92e371ecae1798098fa1367872f721ddca4 /testsuites/libtests
parentbeagle bsp: disable watchdog on am335x (diff)
downloadrtems-e870941bb0f2f300e8fd252c7e30ecaabbe50841.tar.bz2
libmisc: More useful default configuration
The dummy.c was a de-facto default configuration. Rename it to default-configuration.c. Use unlimited objects and the stack checker. This makes it easier for new RTEMS users which will likely use this file if they just work with the usual main() function as the application entry point. Provide proper arguments for main() using the BSP command line. Add spare user extensions and drivers. Do not initialize the network by default. Delete bspinit.c.
Diffstat (limited to 'testsuites/libtests')
-rw-r--r--testsuites/libtests/Makefile.am1
-rw-r--r--testsuites/libtests/configure.ac1
-rw-r--r--testsuites/libtests/defaultconfig01/Makefile.am19
-rw-r--r--testsuites/libtests/defaultconfig01/defaultconfig01.doc11
-rw-r--r--testsuites/libtests/defaultconfig01/defaultconfig01.scn2
-rw-r--r--testsuites/libtests/defaultconfig01/init.c59
6 files changed, 93 insertions, 0 deletions
diff --git a/testsuites/libtests/Makefile.am b/testsuites/libtests/Makefile.am
index 4f22ac825e..ed773c4e06 100644
--- a/testsuites/libtests/Makefile.am
+++ b/testsuites/libtests/Makefile.am
@@ -1,6 +1,7 @@
ACLOCAL_AMFLAGS = -I ../aclocal
_SUBDIRS = POSIX
+_SUBDIRS += defaultconfig01
_SUBDIRS += pwdgrp02
_SUBDIRS += shell01
_SUBDIRS += pwdgrp01
diff --git a/testsuites/libtests/configure.ac b/testsuites/libtests/configure.ac
index 53a017b19d..39e518fed6 100644
--- a/testsuites/libtests/configure.ac
+++ b/testsuites/libtests/configure.ac
@@ -67,6 +67,7 @@ AM_CONDITIONAL(DLTESTS,[test x"$TEST_LIBDL" = x"yes"])
# Explicitly list all Makefiles here
AC_CONFIG_FILES([Makefile
+defaultconfig01/Makefile
pwdgrp02/Makefile
shell01/Makefile
pwdgrp01/Makefile
diff --git a/testsuites/libtests/defaultconfig01/Makefile.am b/testsuites/libtests/defaultconfig01/Makefile.am
new file mode 100644
index 0000000000..ffa894abc2
--- /dev/null
+++ b/testsuites/libtests/defaultconfig01/Makefile.am
@@ -0,0 +1,19 @@
+rtems_tests_PROGRAMS = defaultconfig01
+defaultconfig01_SOURCES = init.c
+
+dist_rtems_tests_DATA = defaultconfig01.scn defaultconfig01.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)/../support/include
+
+LINK_OBJS = $(defaultconfig01_OBJECTS)
+LINK_LIBS = $(defaultconfig01_LDLIBS)
+
+defaultconfig01$(EXEEXT): $(defaultconfig01_OBJECTS) $(defaultconfig01_DEPENDENCIES)
+ @rm -f defaultconfig01$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/libtests/defaultconfig01/defaultconfig01.doc b/testsuites/libtests/defaultconfig01/defaultconfig01.doc
new file mode 100644
index 0000000000..532245350a
--- /dev/null
+++ b/testsuites/libtests/defaultconfig01/defaultconfig01.doc
@@ -0,0 +1,11 @@
+This file describes the directives and concepts tested by this test set.
+
+test set name: defaultconfig01
+
+directives:
+
+ - main()
+
+concepts:
+
+ - Make sure the default configuration works.
diff --git a/testsuites/libtests/defaultconfig01/defaultconfig01.scn b/testsuites/libtests/defaultconfig01/defaultconfig01.scn
new file mode 100644
index 0000000000..6f140ea53a
--- /dev/null
+++ b/testsuites/libtests/defaultconfig01/defaultconfig01.scn
@@ -0,0 +1,2 @@
+*** BEGIN OF TEST DEFAULTCONFIG 1 ***
+*** END OF TEST DEFAULTCONFIG 1 ***
diff --git a/testsuites/libtests/defaultconfig01/init.c b/testsuites/libtests/defaultconfig01/init.c
new file mode 100644
index 0000000000..21c326dcbd
--- /dev/null
+++ b/testsuites/libtests/defaultconfig01/init.c
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2014 embedded brains GmbH. All rights reserved.
+ *
+ * embedded brains GmbH
+ * Dornierstr. 4
+ * 82178 Puchheim
+ * Germany
+ * <rtems@embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+ #include "config.h"
+#endif
+
+#include <stdio.h>
+
+#include <bsp.h>
+
+#include "tmacros.h"
+
+const char rtems_test_name[] = "DEFAULTCONFIG 1";
+
+static void install_bsp_extension(void)
+{
+#ifdef BSP_INITIAL_EXTENSION
+ static const rtems_extensions_table bsp_ext = BSP_INITIAL_EXTENSION;
+
+ rtems_status_code sc;
+ rtems_id id;
+
+ sc = rtems_extension_create(
+ rtems_build_name('B', 'S', 'P', ' '),
+ &bsp_ext,
+ &id
+ );
+ rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+#endif
+}
+
+int main(int argc, char **argv)
+{
+ int i;
+
+ TEST_BEGIN();
+
+ install_bsp_extension();
+
+ for (i = 0; i < argc; ++i) {
+ printf("argv[%i] = %s\n", i, argv[i]);
+ }
+
+ TEST_END();
+
+ return 0;
+}