summaryrefslogtreecommitdiffstats
path: root/testsuite/swi01
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-10-09 22:52:54 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-10-10 09:08:23 +0200
commite599318e912d8836c59d8b5202e3e31a6b8dcae9 (patch)
tree1172b8b830a1c3236e45c834c2b80e01325ea144 /testsuite/swi01
parentMove files to match FreeBSD layout (diff)
downloadrtems-libbsd-e599318e912d8836c59d8b5202e3e31a6b8dcae9.tar.bz2
Update files to match FreeBSD layout
Add compatibility with Newlib header files. Some FreeBSD header files are mapped by the translation script: o rtems/bsd/sys/_types.h o rtems/bsd/sys/errno.h o rtems/bsd/sys/lock.h o rtems/bsd/sys/param.h o rtems/bsd/sys/resource.h o rtems/bsd/sys/time.h o rtems/bsd/sys/timespec.h o rtems/bsd/sys/types.h o rtems/bsd/sys/unistd.h It is now possible to include <sys/socket.h> directly for example. Generate one Makefile which builds everything including tests.
Diffstat (limited to 'testsuite/swi01')
-rw-r--r--testsuite/swi01/Makefile27
-rw-r--r--testsuite/swi01/init.c2
-rw-r--r--testsuite/swi01/swi_test.c26
3 files changed, 14 insertions, 41 deletions
diff --git a/testsuite/swi01/Makefile b/testsuite/swi01/Makefile
deleted file mode 100644
index f5de48f4..00000000
--- a/testsuite/swi01/Makefile
+++ /dev/null
@@ -1,27 +0,0 @@
-include ../../config.inc
-
-APP=swi01
-PGM=${ARCH}/$(APP).exe
-
-# optional managers required
-MANAGERS=all
-
-# C source names
-C_FILES = init.c swi_test.c
-C_O_FILES = $(C_FILES:%.c=${ARCH}/%.o)
-
-AM_CPPFLAGS += -I $(INSTALL_BASE)/include
-LINK_LIBS += $(INSTALL_BASE)/libbsd.a ${REL_ARGS}
-CFLAGS += $(DEPFLAGS) $(GCCFLAGS) $(AM_CPPFLAGS) -Wno-unused -Wl,-Map,$(APP).map
-
-include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
-include $(RTEMS_CUSTOM)
-include $(PROJECT_ROOT)/make/leaf.cfg
-
-OBJS= $(C_O_FILES)
-CLEAN_ADDITIONS += $(APP).map
-
-all: ${ARCH} $(PGM)
-
-$(PGM): $(OBJS)
- -$(make-exe)
diff --git a/testsuite/swi01/init.c b/testsuite/swi01/init.c
index 9bc13dc6..57d77f80 100644
--- a/testsuite/swi01/init.c
+++ b/testsuite/swi01/init.c
@@ -34,7 +34,7 @@
#include <rtems.h>
-#include <freebsd/bsd.h>
+#include <rtems/bsd/bsd.h>
#include "swi_test.h"
diff --git a/testsuite/swi01/swi_test.c b/testsuite/swi01/swi_test.c
index 99ba94f4..093458e7 100644
--- a/testsuite/swi01/swi_test.c
+++ b/testsuite/swi01/swi_test.c
@@ -34,19 +34,19 @@
#include <stdio.h>
#include <unistd.h>
-#include <freebsd/machine/rtems-bsd-config.h>
+#include <machine/rtems-bsd-config.h>
-#include <freebsd/sys/types.h>
-#include <freebsd/sys/systm.h>
+#include <sys/types.h>
+#include <sys/systm.h>
-#include <freebsd/sys/param.h>
-#include <freebsd/sys/bus.h>
-#include <freebsd/sys/interrupt.h>
+#include <sys/param.h>
+#include <sys/bus.h>
+#include <sys/interrupt.h>
#define SWI_TEST_THREAD_PRIO (0)
// Time to wait for swi-test-handler
-#define SWI_SLEEP_TIME (100)
+#define SWI_SLEEP_TIME (1)
enum arg {
HANDLER_NOT_VISITED,
@@ -78,7 +78,7 @@ void swi_test_normal_handler()
swi_sched(test_ih, 0);
- usleep(SWI_SLEEP_TIME);
+ sleep(SWI_SLEEP_TIME);
assert(argument == HANDLER_VISITED);
}
@@ -98,7 +98,7 @@ void swi_test_exclusive_handler()
swi_sched(test_ih, 0);
- usleep(SWI_SLEEP_TIME);
+ sleep(SWI_SLEEP_TIME);
assert(argument == HANDLER_VISITED);
}
@@ -124,7 +124,7 @@ void swi_test_error_intr_entropy_set()
SWI_TEST_THREAD_PRIO, INTR_ENTROPY, &test_ih);
assert(retval == EINVAL);
- usleep(SWI_SLEEP_TIME);
+ sleep(SWI_SLEEP_TIME);
assert(argument == HANDLER_NOT_VISITED);
}
@@ -148,7 +148,7 @@ void swi_test_error_name_null()
SWI_TEST_THREAD_PRIO, 0, &test_ih);
assert(retval == EINVAL);
- usleep(SWI_SLEEP_TIME);
+ sleep(SWI_SLEEP_TIME);
assert(argument == HANDLER_NOT_VISITED);
}
@@ -166,7 +166,7 @@ void swi_test_error_handler_null()
SWI_TEST_THREAD_PRIO, 0, &test_ih);
assert(retval == EINVAL);
- usleep(SWI_SLEEP_TIME);
+ sleep(SWI_SLEEP_TIME);
assert(argument == HANDLER_NOT_VISITED);
}
@@ -189,7 +189,7 @@ void swi_test_error_has_allready_exclusive()
SWI_TEST_THREAD_PRIO, 0, &test_ih2);
assert(retval == EINVAL);
- usleep(SWI_SLEEP_TIME);
+ sleep(SWI_SLEEP_TIME);
assert(argument == HANDLER_NOT_VISITED);
}