]> rtime.felk.cvut.cz Git - omk.git/commitdiff
Added some testcases. Minor bugfixes for runtests.py.
authorMichal Sojka <sojkam1@fel.cvut.cz>
Sat, 20 Jan 2007 10:08:00 +0000 (10:08 +0000)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Sat, 20 Jan 2007 10:08:00 +0000 (10:08 +0000)
darcs-hash:20070120100823-f2ef6-7774b189fa77b3ae1d20f281e7af33e9cc50554e.gz

30 files changed:
tests/README.tests
tests/config/default/Makefile [new file with mode: 0644]
tests/config/default/Makefile.omk [new file with mode: 0644]
tests/config/default/config.omk-correct [new file with mode: 0644]
tests/config/default/runtest [new file with mode: 0755]
tests/config/default/subdir/Makefile [new file with mode: 0644]
tests/config/default/subdir/Makefile.omk [new file with mode: 0644]
tests/functions.sh
tests/headers/files/Makefile [new file with mode: 0644]
tests/headers/files/Makefile.omk [new file with mode: 0644]
tests/headers/files/ls-include.txt [new file with mode: 0644]
tests/headers/files/orte/orte_config_omk_win32.h [new file with mode: 0644]
tests/headers/files/periph/sci_channels.h [new file with mode: 0644]
tests/headers/files/periph/sci_regs.h [new file with mode: 0644]
tests/headers/files/rules [new file with mode: 0644]
tests/headers/files/runtest [new file with mode: 0755]
tests/headers/files/x.h [new file with mode: 0644]
tests/headers/generated/Makefile [new file with mode: 0644]
tests/headers/generated/Makefile.omk [new file with mode: 0644]
tests/headers/generated/config.omk-default [new file with mode: 0644]
tests/headers/generated/correct/global.h [new file with mode: 0644]
tests/headers/generated/correct/lincan_config.h [new file with mode: 0644]
tests/headers/generated/lincan/Makefile [new file with mode: 0644]
tests/headers/generated/lincan/Makefile.omk [new file with mode: 0644]
tests/headers/generated/lincan/configtest.c [new file with mode: 0644]
tests/headers/generated/runtest [new file with mode: 0755]
tests/runtests.py
tests/vxworks/Makefile [new file with mode: 0644]
tests/vxworks/Makefile.omk [new file with mode: 0644]
tests/vxworks/rules [new file with mode: 0644]

index 469f1e6438956f9c490f01409bec98410db0f48f..b2eb387afb58f4e5569a1af20dfd53c05436ec64 100644 (file)
@@ -21,7 +21,8 @@ files: Makefile.test, runtest.
 * Testcase Execution:
 
   Runtest is executed with OMK_RULES environment variable set to the
-  name of the actual rules tested.
+  name of the actual rules tested and OMK_TESTSROOT to the directory
+  containing the runtests.py script.
 
 * Testcase Output:
 
@@ -56,7 +57,7 @@ The rules file contains one line of one of the following forms:
 * snip:<snippet name> - this selects all the rules, which contain the
   given snippet.
 
-* python:<python exression> - The python expression is evaluated. The
+* python:<python expression> - The python expression is evaluated. The
   global namespace contains the following variables:
 
     - rules: the name of tested rules
diff --git a/tests/config/default/Makefile b/tests/config/default/Makefile
new file mode 100644 (file)
index 0000000..f595272
--- /dev/null
@@ -0,0 +1,14 @@
+# Generic directory or leaf node makefile for OCERA make framework
+
+ifndef MAKERULES_DIR
+MAKERULES_DIR := $(shell ( old_pwd="" ;  while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" == `pwd`  ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) )
+endif
+
+ifeq ($(MAKERULES_DIR),)
+all : default
+.DEFAULT::
+       @echo -e "\nThe Makefile.rules has not been found in this or partent directory\n"
+else   
+include $(MAKERULES_DIR)/Makefile.rules
+endif
+
diff --git a/tests/config/default/Makefile.omk b/tests/config/default/Makefile.omk
new file mode 100644 (file)
index 0000000..371902e
--- /dev/null
@@ -0,0 +1,4 @@
+default_CONFIG = CONFIG_OC_LINCAN=y CONFIG_OC_LINCANRTL=n CONFIG_OC_LINCANVME=n
+default_CONFIG += CONFIG_OC_LINCAN_PORTIO_ONLY=n CONFIG_OC_LINCAN_MEMIO_ONLY=n
+
+SUBDIRS=subdir
\ No newline at end of file
diff --git a/tests/config/default/config.omk-correct b/tests/config/default/config.omk-correct
new file mode 100644 (file)
index 0000000..0a2a2d3
--- /dev/null
@@ -0,0 +1,12 @@
+# Start of OMK config file
+# This file should not be altered manually
+# Overrides should be stored in file config.omk
+
+# Config for subdir
+CONFIG_SUBDIR=y
+# Config for 
+CONFIG_OC_LINCAN=y
+CONFIG_OC_LINCANRTL=n
+CONFIG_OC_LINCANVME=n
+CONFIG_OC_LINCAN_PORTIO_ONLY=n
+CONFIG_OC_LINCAN_MEMIO_ONLY=n
diff --git a/tests/config/default/runtest b/tests/config/default/runtest
new file mode 100755 (executable)
index 0000000..0e64e40
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh
+make default-config || exit 2
+echo "Default config differs" > _error
+diff -u config.omk-correct config.omk-default || exit 1
\ No newline at end of file
diff --git a/tests/config/default/subdir/Makefile b/tests/config/default/subdir/Makefile
new file mode 100644 (file)
index 0000000..f595272
--- /dev/null
@@ -0,0 +1,14 @@
+# Generic directory or leaf node makefile for OCERA make framework
+
+ifndef MAKERULES_DIR
+MAKERULES_DIR := $(shell ( old_pwd="" ;  while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" == `pwd`  ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) )
+endif
+
+ifeq ($(MAKERULES_DIR),)
+all : default
+.DEFAULT::
+       @echo -e "\nThe Makefile.rules has not been found in this or partent directory\n"
+else   
+include $(MAKERULES_DIR)/Makefile.rules
+endif
+
diff --git a/tests/config/default/subdir/Makefile.omk b/tests/config/default/subdir/Makefile.omk
new file mode 100644 (file)
index 0000000..7234cad
--- /dev/null
@@ -0,0 +1 @@
+default_CONFIG = CONFIG_SUBDIR=y
index 3d7da511fd3cebca06c8c41df387270637fe1020..dc4b7a8aa152a6995be1ed3abbe17ac1a6c829d0 100644 (file)
@@ -1,2 +1,11 @@
 # -*-sh-*-
 
+function error() {
+    echo $1 > _error
+    exit 1
+}
+
+function canttest() {
+    echo $1 > _error
+    exit 2
+}
diff --git a/tests/headers/files/Makefile b/tests/headers/files/Makefile
new file mode 100644 (file)
index 0000000..f595272
--- /dev/null
@@ -0,0 +1,14 @@
+# Generic directory or leaf node makefile for OCERA make framework
+
+ifndef MAKERULES_DIR
+MAKERULES_DIR := $(shell ( old_pwd="" ;  while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" == `pwd`  ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) )
+endif
+
+ifeq ($(MAKERULES_DIR),)
+all : default
+.DEFAULT::
+       @echo -e "\nThe Makefile.rules has not been found in this or partent directory\n"
+else   
+include $(MAKERULES_DIR)/Makefile.rules
+endif
+
diff --git a/tests/headers/files/Makefile.omk b/tests/headers/files/Makefile.omk
new file mode 100644 (file)
index 0000000..91b2dc5
--- /dev/null
@@ -0,0 +1,4 @@
+include_HEADERS = x.h periph/sci_regs.h
+nobase_include_HEADERS = periph/sci_channels.h
+renamed_include_HEADERS = x.h->y.h
+renamed_include_HEADERS += orte/orte_config_omk_win32.h->orte/orte_config.h
diff --git a/tests/headers/files/ls-include.txt b/tests/headers/files/ls-include.txt
new file mode 100644 (file)
index 0000000..776116d
--- /dev/null
@@ -0,0 +1,12 @@
+.:
+orte
+periph
+sci_regs.h
+x.h
+y.h
+
+./orte:
+orte_config.h
+
+./periph:
+sci_channels.h
diff --git a/tests/headers/files/orte/orte_config_omk_win32.h b/tests/headers/files/orte/orte_config_omk_win32.h
new file mode 100644 (file)
index 0000000..adb5b31
--- /dev/null
@@ -0,0 +1,243 @@
+/* orte/include/orte/orte_config.h.  Generated by configure.  */
+/* orte/include/orte/orte_config.h.in.  Generated from configure.in by autoheader.  */
+
+/* Define to enable JORTE's compilation */
+/* #undef CONFIG_JORTE */
+
+/* Define if is target CYGWIN */
+/* #undef CONFIG_ORTE_CYGWIN */
+
+/* Define if linux kernel is found */
+/* #undef CONFIG_ORTE_KERNEL */
+
+/* Define if is target MINGW */
+#define CONFIG_ORTE_MINGW 1
+
+/* Define to enable ORTE's RT support */
+/* #undef CONFIG_ORTE_RT */
+
+/* Define if kernel is RTAI patched */
+/* #undef CONFIG_ORTE_RTAI */
+
+/* Define if kernel is RTLinux patched */
+/* #undef CONFIG_ORTE_RTL */
+
+/* Define if onetd stack is found */
+/* #undef CONFIG_ORTE_RTL_ONETD */
+
+/* Define if wIP stack is found */
+/* #undef CONFIG_ORTE_RTL_WIP */
+
+/* Define if is target a unix system */
+/* #undef CONFIG_ORTE_UNIX */
+
+/* Define if is target windows */
+#define CONFIG_ORTE_WIN 1
+
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+/* #undef HAVE_ARPA_INET_H */
+
+/* Define to 1 if you have the <asm/byteorder.h> header file. */
+/* #undef HAVE_ASM_BYTEORDER_H */
+
+/* Define to 1 if you have the <byteswap.h> header file. */
+/* #undef HAVE_BYTESWAP_H */
+
+/* Define to 1 if you have the <ctype.h> header file. */
+#define HAVE_CTYPE_H 1
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+/* #undef HAVE_DLFCN_H */
+
+/* Define to 1 if you have the <errno.h> header file. */
+#define HAVE_ERRNO_H 1
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#define HAVE_FCNTL_H 1
+
+/* Define to 1 if you have the `gethostbyname' function. */
+/* #undef HAVE_GETHOSTBYNAME */
+
+/* Define to 1 if you have the <getopt.h> header file. */
+#define HAVE_GETOPT_H 1
+
+/* Define to 1 if you have the `getopt_long' function. */
+/* #undef HAVE_GETOPT_LONG */
+
+/* Define for ORTE getopt_long self implemetation */
+#define HAVE_GETPOT_LONG_ORTE 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the `c_r' library (-lc_r). */
+/* #undef HAVE_LIBC_R */
+
+/* Define to 1 if you have the `nsl' library (-lnsl). */
+/* #undef HAVE_LIBNSL */
+
+/* Define to 1 if you have the `popt' library (-lpopt). */
+/* #undef HAVE_LIBPOPT */
+
+/* Define to 1 if you have the `pthread' library (-lpthread). */
+/* #undef HAVE_LIBPTHREAD */
+
+/* Define to 1 if you have the `socket' library (-lsocket). */
+/* #undef HAVE_LIBSOCKET */
+
+/* Define to 1 if you have the `ws2_32' library (-lws2_32). */
+#define HAVE_LIBWS2_32 1
+
+/* Define to 1 if you have the <linux/ctype.h> header file. */
+/* #undef HAVE_LINUX_CTYPE_H */
+
+/* Define to 1 if you have the <linux/if.h> header file. */
+/* #undef HAVE_LINUX_IF_H */
+
+/* Define to 1 if you have the <linux/in.h> header file. */
+/* #undef HAVE_LINUX_IN_H */
+
+/* Define to 1 if you have the <linux/module.h> header file. */
+/* #undef HAVE_LINUX_MODULE_H */
+
+/* Define to 1 if you have the <linux/socket.h> header file. */
+/* #undef HAVE_LINUX_SOCKET_H */
+
+/* Define to 1 if you have the <linux/string.h> header file. */
+/* #undef HAVE_LINUX_STRING_H */
+
+/* Define to 1 if you have the <linux/time.h> header file. */
+/* #undef HAVE_LINUX_TIME_H */
+
+/* Define to 1 if you have the <linux/types.h> header file. */
+/* #undef HAVE_LINUX_TYPES_H */
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the <netdb.h> header file. */
+/* #undef HAVE_NETDB_H */
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+/* #undef HAVE_NETINET_IN_H */
+
+/* Define to 1 if you have the <net/if.h> header file. */
+/* #undef HAVE_NET_IF_H */
+
+/* Define to 1 if you have the <nictab.h> header file. */
+/* #undef HAVE_NICTAB_H */
+
+/* Define to 1 if you have the <nic.h> header file. */
+/* #undef HAVE_NIC_H */
+
+/* Define to 1 if you have the <onetd.h> header file. */
+/* #undef HAVE_ONETD_H */
+
+/* Define to 1 if you have the <pthread.h> header file. */
+/* #undef HAVE_PTHREAD_H */
+
+/* Define to 1 if you have the <rtl.h> header file. */
+/* #undef HAVE_RTL_H */
+
+/* Define to 1 if you have the <rtl_malloc.h> header file. */
+/* #undef HAVE_RTL_MALLOC_H */
+
+/* Define to 1 if you have the <rtnet.h> header file. */
+/* #undef HAVE_RTNET_H */
+
+/* Define to 1 if you have the <signal.h> header file. */
+#define HAVE_SIGNAL_H 1
+
+/* Define to 1 if you have the <stdarg.h> header file. */
+#define HAVE_STDARG_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdio.h> header file. */
+#define HAVE_STDIO_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+/* #undef HAVE_SYS_IOCTL_H */
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+/* #undef HAVE_SYS_SOCKET_H */
+
+/* Define to 1 if you have the <sys/sockio.h> header file. */
+/* #undef HAVE_SYS_SOCKIO_H */
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#define HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <time.h> header file. */
+/* #undef HAVE_TIME_H */
+
+/* Define to 1 if you have the <udp.h> header file. */
+/* #undef HAVE_UDP_H */
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to 1 if you have the <w32api/windows.h> header file. */
+/* #undef HAVE_W32API_WINDOWS_H */
+
+/* Define to 1 if you have the <windows.h> header file. */
+#define HAVE_WINDOWS_H 1
+
+/* Define to 1 if you have the <winsock2.h> header file. */
+#define HAVE_WINSOCK2_H 1
+
+/* Define to 1 if you have the <ws2tcpip.h> header file. */
+#define HAVE_WS2TCPIP_H 1
+
+/* Define to the address where bug reports for this package should be sent. */
+#define ORTE_PACKAGE_BUGREPORT "petr.smolik@wo.cz"
+
+/* Define to the full name of this package. */
+#define ORTE_PACKAGE_NAME "orte"
+
+/* Define to the full name and version of this package. */
+#define ORTE_PACKAGE_STRING "orte 0.3.1"
+
+/* Define to the one symbol short name of this package. */
+#define ORTE_PACKAGE_TARNAME "orte"
+
+/* Define to the version of this package. */
+#define ORTE_PACKAGE_VERSION "0.3.1"
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define to 1 if your processor stores words with the most significant byte
+   first (like Motorola and SPARC, unlike Intel and VAX). */
+/* #undef WORDS_BIGENDIAN */
+
+
+#ifndef _GNU_SOURCE
+  #define _GNU_SOURCE
+#endif
+
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+   calls it, or to nothing if 'inline' is not supported under any name.  */
+#ifndef __cplusplus
+/* #undef inline */
+#endif
diff --git a/tests/headers/files/periph/sci_channels.h b/tests/headers/files/periph/sci_channels.h
new file mode 100644 (file)
index 0000000..5101480
--- /dev/null
@@ -0,0 +1,37 @@
+/*******************************************************************
+  Components for embedded applications builded for
+  laboratory and medical instruments firmware
+
+  sci_channels.h - UART communication for H2638 microcontroller
+
+   (C) 2005 by Michal Sojka <wentasah@centrum.cz>
+
+ The COLAMI components can be used and copied according to next
+ license alternatives
+   - MPL - Mozilla Public License
+   - GPL - GNU Public License
+
+ *******************************************************************/
+#ifndef _SCI_PORTS_H
+#define _SCI_PORTS_H
+
+#include <periph/sci_rs232.h>
+#include <system_def.h>
+
+extern sci_info_t sci_rs232_chan0, sci_rs232_chan1, sci_rs232_chan2;
+
+extern sci_info_t *sci_rs232_chan_array[];
+
+#ifndef SCI_RS232_CHAN_DEFAULT
+#define SCI_RS232_CHAN_DEFAULT 0
+#endif
+
+/** 
+ * This variable selects the default channel for use by IO functions
+ * (prtinf etc.). You can change the value of this variable in your
+ * application or by defining SCI_RS232_CHAN_DEFAULT symbol (probably
+ * in system_def.h).
+ */
+extern int sci_rs232_chan_default;
+
+#endif
diff --git a/tests/headers/files/periph/sci_regs.h b/tests/headers/files/periph/sci_regs.h
new file mode 100644 (file)
index 0000000..9b436b4
--- /dev/null
@@ -0,0 +1,33 @@
+/*******************************************************************
+  Components for embedded applications builded for
+  laboratory and medical instruments firmware
+
+  sci_regs.h - UART communication for H2638 microcontroller
+
+   (C) 2005 by Michal Sojka <wentasah@centrum.cz>
+   (C) 2005 by Petr Kovacik <kovacp1@fel.cvut.cz>
+
+ The COLAMI components can be used and copied according to next
+ license alternatives
+   - MPL - Mozilla Public License
+   - GPL - GNU Public License
+
+ *******************************************************************/
+
+#ifndef _SCI_REGS_H
+#define _SCI_REGS_H
+
+#include <types.h>
+
+struct sci_regs {
+    volatile __u8  rs232_smr;
+    volatile __u8  rs232_brr;
+    volatile __u8  rs232_scr;
+    volatile __u8  rs232_tdr;
+    volatile __u8  rs232_ssr;
+    volatile __u8  rs232_rdr;
+    volatile __u8  rs232_scmr;
+};
+
+  
+#endif /* _SCI_REGS_H */
diff --git a/tests/headers/files/rules b/tests/headers/files/rules
new file mode 100644 (file)
index 0000000..cfb1354
--- /dev/null
@@ -0,0 +1 @@
+snip:include
diff --git a/tests/headers/files/runtest b/tests/headers/files/runtest
new file mode 100755 (executable)
index 0000000..13d64e2
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+. $OMK_TESTSROOT/functions.sh
+
+touch config.omk-default
+make || exit 2
+
+(cd _compiled/include || exit 2; ls -R -1) > ls-include.test || canttest "Can't find include directory"
+
+diff -u ls-include.txt ls-include.test || error "Include files are produced incorrectly"
diff --git a/tests/headers/files/x.h b/tests/headers/files/x.h
new file mode 100644 (file)
index 0000000..032ca32
--- /dev/null
@@ -0,0 +1 @@
+// Hello
\ No newline at end of file
diff --git a/tests/headers/generated/Makefile b/tests/headers/generated/Makefile
new file mode 100644 (file)
index 0000000..f595272
--- /dev/null
@@ -0,0 +1,14 @@
+# Generic directory or leaf node makefile for OCERA make framework
+
+ifndef MAKERULES_DIR
+MAKERULES_DIR := $(shell ( old_pwd="" ;  while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" == `pwd`  ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) )
+endif
+
+ifeq ($(MAKERULES_DIR),)
+all : default
+.DEFAULT::
+       @echo -e "\nThe Makefile.rules has not been found in this or partent directory\n"
+else   
+include $(MAKERULES_DIR)/Makefile.rules
+endif
+
diff --git a/tests/headers/generated/Makefile.omk b/tests/headers/generated/Makefile.omk
new file mode 100644 (file)
index 0000000..14ec3b1
--- /dev/null
@@ -0,0 +1,9 @@
+SUBDIRS=lincan
+
+default_CONFIG = CONFIG_TEST_NUM=123 CONFIG_TEST_STR="Hello"
+
+
+config_include_HEADERS = global.h
+
+global_DEFINES = CONFIG_OC_LINCAN CONFIG_OC_LINCANRTL  \
+                 CONFIG_TEST_NUM CONFIG_TEST_STR
diff --git a/tests/headers/generated/config.omk-default b/tests/headers/generated/config.omk-default
new file mode 100644 (file)
index 0000000..14a1f20
--- /dev/null
@@ -0,0 +1,43 @@
+# Start of OMK config file
+# This file should not be altered manually
+# Overrides should be stored in file config.omk
+
+# Config for lincan
+CONFIG_OC_LINCAN=y
+CONFIG_OC_LINCANRTL=n
+CONFIG_OC_LINCANVME=n
+CONFIG_OC_LINCAN_PORTIO_ONLY=n
+CONFIG_OC_LINCAN_MEMIO_ONLY=n
+CONFIG_OC_LINCAN_DETAILED_ERRORS=y
+CONFIG_OC_LINCAN_CARD_pip=y
+CONFIG_OC_LINCAN_CARD_pccan=y
+CONFIG_OC_LINCAN_CARD_smartcan=y
+CONFIG_OC_LINCAN_CARD_nsi=y
+CONFIG_OC_LINCAN_CARD_cc_can104=y
+CONFIG_OC_LINCAN_CARD_ems_cpcpci=y
+CONFIG_OC_LINCAN_CARD_pc_i03=y
+CONFIG_OC_LINCAN_CARD_pcm3680=y
+CONFIG_OC_LINCAN_CARD_aim104=y
+CONFIG_OC_LINCAN_CARD_m437=y
+CONFIG_OC_LINCAN_CARD_pcccan=y
+CONFIG_OC_LINCAN_CARD_ssv=y
+CONFIG_OC_LINCAN_CARD_bfadcan=y
+CONFIG_OC_LINCAN_CARD_gensja1000io=y
+CONFIG_OC_LINCAN_CARD_pikronisa=y
+CONFIG_OC_LINCAN_CARD_eb8245=y
+CONFIG_OC_LINCAN_CARD_kv_pcican=y
+CONFIG_OC_LINCAN_CARD_msmcan=y
+CONFIG_OC_LINCAN_CARD_oscar=y
+CONFIG_OC_LINCAN_CARD_adlink7841=y
+CONFIG_OC_LINCAN_CARD_unican=y
+CONFIG_OC_LINCAN_CARD_virtual=y
+CONFIG_OC_LINCAN_CARD_template=y
+CONFIG_OC_LINCAN_CARD_hms30c7202_can=n
+CONFIG_OC_LINCAN_CARD_ns_dev_can=n
+CONFIG_OC_LINCAN_CARD_ipci165=n
+CONFIG_OC_LINCAN_CARD_pimx1=n
+CONFIG_OC_LINCAN_CARD_tscan1=n
+CONFIG_OC_LINCAN_CARD_nsi_canpci=n
+# Config for 
+CONFIG_TEST_NUM=123
+CONFIG_TEST_STR=Hello
diff --git a/tests/headers/generated/correct/global.h b/tests/headers/generated/correct/global.h
new file mode 100644 (file)
index 0000000..bc98500
--- /dev/null
@@ -0,0 +1,7 @@
+/* Automatically generated from */
+#ifndef  _global_H 
+#define  _global_H 
+#define CONFIG_OC_LINCAN 1
+#define CONFIG_TEST_NUM 123
+#define CONFIG_TEST_STR Hello
+#endif /* _global_H */
diff --git a/tests/headers/generated/correct/lincan_config.h b/tests/headers/generated/correct/lincan_config.h
new file mode 100644 (file)
index 0000000..2ca8eac
--- /dev/null
@@ -0,0 +1,29 @@
+/* Automatically generated from */
+#ifndef _LOCAL_CONFIG_H
+#define _LOCAL_CONFIG_H
+#define CONFIG_OC_LINCAN 1
+#define CONFIG_OC_LINCAN_DETAILED_ERRORS 1
+#define CONFIG_OC_LINCAN_CARD_pip 1
+#define CONFIG_OC_LINCAN_CARD_pccan 1
+#define CONFIG_OC_LINCAN_CARD_smartcan 1
+#define CONFIG_OC_LINCAN_CARD_nsi 1
+#define CONFIG_OC_LINCAN_CARD_cc_can104 1
+#define CONFIG_OC_LINCAN_CARD_ems_cpcpci 1
+#define CONFIG_OC_LINCAN_CARD_pc_i03 1
+#define CONFIG_OC_LINCAN_CARD_pcm3680 1
+#define CONFIG_OC_LINCAN_CARD_aim104 1
+#define CONFIG_OC_LINCAN_CARD_m437 1
+#define CONFIG_OC_LINCAN_CARD_pcccan 1
+#define CONFIG_OC_LINCAN_CARD_ssv 1
+#define CONFIG_OC_LINCAN_CARD_bfadcan 1
+#define CONFIG_OC_LINCAN_CARD_gensja1000io 1
+#define CONFIG_OC_LINCAN_CARD_pikronisa 1
+#define CONFIG_OC_LINCAN_CARD_eb8245 1
+#define CONFIG_OC_LINCAN_CARD_kv_pcican 1
+#define CONFIG_OC_LINCAN_CARD_msmcan 1
+#define CONFIG_OC_LINCAN_CARD_oscar 1
+#define CONFIG_OC_LINCAN_CARD_adlink7841 1
+#define CONFIG_OC_LINCAN_CARD_unican 1
+#define CONFIG_OC_LINCAN_CARD_virtual 1
+#define CONFIG_OC_LINCAN_CARD_template 1
+#endif /*_LOCAL_CONFIG_H*/
diff --git a/tests/headers/generated/lincan/Makefile b/tests/headers/generated/lincan/Makefile
new file mode 100644 (file)
index 0000000..f595272
--- /dev/null
@@ -0,0 +1,14 @@
+# Generic directory or leaf node makefile for OCERA make framework
+
+ifndef MAKERULES_DIR
+MAKERULES_DIR := $(shell ( old_pwd="" ;  while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" == `pwd`  ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) )
+endif
+
+ifeq ($(MAKERULES_DIR),)
+all : default
+.DEFAULT::
+       @echo -e "\nThe Makefile.rules has not been found in this or partent directory\n"
+else   
+include $(MAKERULES_DIR)/Makefile.rules
+endif
+
diff --git a/tests/headers/generated/lincan/Makefile.omk b/tests/headers/generated/lincan/Makefile.omk
new file mode 100644 (file)
index 0000000..2affd3b
--- /dev/null
@@ -0,0 +1,18 @@
+lincan_cards_NAMES = pip pccan smartcan nsi cc_can104 ems_cpcpci \
+               pc_i03 pcm3680 aim104 m437 pcccan ssv bfadcan gensja1000io pikronisa eb8245 \
+               kv_pcican msmcan oscar adlink7841 unican virtual template
+
+lincan_morecards_NAMES = hms30c7202_can ns_dev_can ipci165 pimx1 tscan1 nsi_canpci
+
+default_CONFIG = CONFIG_OC_LINCAN=y CONFIG_OC_LINCANRTL=n CONFIG_OC_LINCANVME=n
+default_CONFIG += CONFIG_OC_LINCAN_PORTIO_ONLY=n CONFIG_OC_LINCAN_MEMIO_ONLY=n
+default_CONFIG += CONFIG_OC_LINCAN_DETAILED_ERRORS=y
+default_CONFIG += $(foreach n, $(lincan_cards_NAMES), CONFIG_OC_LINCAN_CARD_$(n)=y)
+default_CONFIG += $(foreach n, $(lincan_morecards_NAMES), CONFIG_OC_LINCAN_CARD_$(n)=n)
+
+
+LOCAL_CONFIG_H = lincan_config.h
+
+# Local config is not generated if nothing is compiled
+bin_PROGRAMS = configtest
+configtest_SOURCES = configtest.c
diff --git a/tests/headers/generated/lincan/configtest.c b/tests/headers/generated/lincan/configtest.c
new file mode 100644 (file)
index 0000000..5c5d3b9
--- /dev/null
@@ -0,0 +1,2 @@
+#include "lincan_config.h"
+void main(void) {}
diff --git a/tests/headers/generated/runtest b/tests/headers/generated/runtest
new file mode 100755 (executable)
index 0000000..037e3e1
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+. $OMK_TESTSROOT/functions.sh
+
+make default-config || canttest
+make include-pass || error "Can't run make include-pass"
+
+GC=./_compiled/include/global.h
+test -f "$GC" || canttest "Can't find the produced global config"
+
+grep -Fv "/* config file:" $GC | diff -u correct/global.h - || error "Global config differs"
+
+make CC=true || cannot "Can't run make to produce local config"
+LC=$(find _build -wholename '*/lincan/lincan_config.h')
+test -f "$LC" || canttest "Can't find the produced local config"
+grep -Fv "/* config file:" $LC | diff -u correct/lincan_config.h - || error "Local config differs"
+
index 4228ad24fab284e94523f1ce60c34ae4c2cd0495..276114e4b5bfec1c7a916b5bb7fba57bf297d87f 100755 (executable)
@@ -7,6 +7,7 @@ import re
 import shutil
 import subprocess
 import time
+from xml.sax.saxutils import escape
 
 sys.path.append("..")
 import rulesdef
@@ -30,7 +31,7 @@ class Results(dict):
 </head>
 <body>
 <h2>Summary</h2>TODO
-        """
+        """ % self.__dict__
         s+="""
 <h2>Chart</h2>
 <table cellpadding='2' border='1'>
@@ -90,7 +91,7 @@ class ResultEntry:
         else:
             if self.exitcode == 1:   color=' bgcolor="red"'
             elif self.exitcode == 2: color=' bgcolor="yellow"'
-            else: color=' bgcolor="silver"'
+            else: color=' bgcolor="gray"'
         if self.stdout: stdoutlink="<a href='#stdout-%(tcname)s-%(rules)s'>stdout</a>" % self.__dict__
         else: stdoutlink=''
         if self.stderr: stderrlink="<a href='#stderr-%(tcname)s-%(rules)s'>stderr</a>" % self.__dict__
@@ -109,7 +110,7 @@ class ResultEntry:
             'tcname' : self.rules,
             'rules' : self.rules,
             'exitcode' : self.exitcode,
-            'message' : self.message,
+            'message' : escape(self.message),
             'time' : self.time,
             'stdoutlink' : stdoutlink,
             'stderrlink' : stderrlink,
@@ -119,8 +120,8 @@ class ResultEntry:
         vals = {
             'tcname':self.tcname,
             'rules':self.rules,
-            'stdout':self.stdout,
-            'stderr':self.stderr
+            'stdout':escape(self.stdout),
+            'stderr':escape(self.stderr)
             }
         s=""
         if self.stdout: s+="""
@@ -194,9 +195,11 @@ class TestCase:
             os.environ['OMK_RULES'] = rules
             filesBefore = self._getFileSet()
             self._copyRules(rules)
-            self._doRun(resultEntry)
-            filesAfter = self._getFileSet()
-            self._clean(filesBefore, filesAfter)
+            try:
+                self._doRun(resultEntry)
+            finally:
+                filesAfter = self._getFileSet()
+                self._clean(filesBefore, filesAfter)
         print
 
     def _getFileSet(self):
@@ -242,6 +245,7 @@ class TestCase:
 
 testsRoot = os.path.dirname(os.path.abspath(__file__))
 if not os.path.exists(os.path.join(testsRoot, "runtests.py")): raise "Can't find tests root directory!"
+os.environ['OMK_TESTSROOT'] = testsRoot
 
 results = Results()
 
diff --git a/tests/vxworks/Makefile b/tests/vxworks/Makefile
new file mode 100644 (file)
index 0000000..f595272
--- /dev/null
@@ -0,0 +1,14 @@
+# Generic directory or leaf node makefile for OCERA make framework
+
+ifndef MAKERULES_DIR
+MAKERULES_DIR := $(shell ( old_pwd="" ;  while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" == `pwd`  ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) )
+endif
+
+ifeq ($(MAKERULES_DIR),)
+all : default
+.DEFAULT::
+       @echo -e "\nThe Makefile.rules has not been found in this or partent directory\n"
+else   
+include $(MAKERULES_DIR)/Makefile.rules
+endif
+
diff --git a/tests/vxworks/Makefile.omk b/tests/vxworks/Makefile.omk
new file mode 100644 (file)
index 0000000..fd1cf10
--- /dev/null
@@ -0,0 +1 @@
+SUBDIRS = fibo-rtp fibo-rtplib #orte
diff --git a/tests/vxworks/rules b/tests/vxworks/rules
new file mode 100644 (file)
index 0000000..afbf2b5
--- /dev/null
@@ -0,0 +1 @@
+vxworks
\ No newline at end of file