Skip to contentSkip to conversation

testsuite: add clock test

PATCH New Jan Kiszka 1 participant 1 message Apr 30, 2007

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 testsuite: add clock test

Hi,

here comes a new testsuite tool to add the required [1] clock validation against unsynchronised TSCs on SMP boxes. It can also be used to detect certain classes of broken clocks (TSCs...) on UP and to measure the drift against the Linux clock (gettimeofday). The latter is interesting to check the potential impact of new tsc-to-ns conversion functions and
- once we provide such a feature - the synchronisation of Xenomai's time base with Linux (or other clocks).

Feedback welcome!

Once everyone is fine with it, I would like to apply it to trunk. IMO we should also add this test to the xeno_test script (if someone feels like providing an add-on patch, don't hesitate).

Jan

[1] https://mail.gna.org/public/xenomai-core/2007-04/msg00022.html

---
 configure.in                        |    1 
 src/testsuite/Makefile.am           |    2 
 src/testsuite/clocktest/Makefile.am |   26 ++++
 src/testsuite/clocktest/clocktest.c |  230 ++++++++++++++++++++++++++++++++++++
 src/testsuite/clocktest/runinfo.in  |    1 
 5 files changed, 259 insertions(+), 1 deletion(-)
configure.in +1 -0
Index: xenomai/configure.in
===================================================================
@@ -641,6 +641,7 @@ AC_CONFIG_FILES([ \
        	src/testsuite/cyclic/Makefile \
        	src/testsuite/switchtest/Makefile \
 	src/testsuite/irqbench/Makefile \
+	src/testsuite/clocktest/Makefile \
 	src/utils/Makefile \
 	src/utils/can/Makefile \
        	include/Makefile \
src/testsuite/Makefile.am +1 -1
Index: xenomai/src/testsuite/Makefile.am
===================================================================
@@ -1 +1 @@
-SUBDIRS = latency switchbench cyclic switchtest irqbench
+SUBDIRS = latency switchbench cyclic switchtest irqbench clocktest
src/testsuite/clocktest/Makefile.am new file +26 -0
Index: xenomai/src/testsuite/clocktest/Makefile.am
===================================================================
@@ -0,0 +1,26 @@
+testdir = $(exec_prefix)/share/xenomai/testsuite/clocktest
+
+bin_PROGRAMS = clocktest
+
+clocktest_SOURCES = clocktest.c
+
+clocktest_CPPFLAGS = -I$(top_srcdir)/include/posix $(XENO_USER_CFLAGS) -I$(top_srcdir)/include
+
+clocktest_LDFLAGS = $(XENO_POSIX_WRAPPERS) $(XENO_USER_LDFLAGS)
+
+clocktest_LDADD = \
+	../../skins/posix/libpthread_rt.la -lpthread -lrt
+
+install-data-local:
+	$(mkinstalldirs) $(DESTDIR)$(testdir)
+	@sed -e's,@exec_prefix\@,$(exec_prefix),g' $(srcdir)/runinfo.in > $(DESTDIR)$(testdir)/.runinfo
+	@echo "\$${DESTDIR}$(exec_prefix)/bin/xeno-load \`dirname \$$0\` \$$*" > $(DESTDIR)$(testdir)/run
+	@chmod +x $(DESTDIR)$(testdir)/run
+
+uninstall-local:
+	$(RM) $(DESTDIR)$(testdir)/.runinfo $(DESTDIR)$(testdir)/run
+
+run: all
+	@$(top_srcdir)/scripts/xeno-load --verbose
+
+EXTRA_DIST = runinfo.in
src/testsuite/clocktest/clocktest.c new file +230 -0

230 lines not on this page · raw message

src/testsuite/clocktest/runinfo.in new file +1 -0
Index: xenomai/src/testsuite/clocktest/runinfo.in
===================================================================
@@ -0,0 +1 @@
+clocktest:posix:!@exec_prefix@/bin/clocktest;popall:control_c