Added simple test to check the infrastructure
authorMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 11 Jun 2009 16:24:07 +0000 (18:24 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 11 Jun 2009 16:24:07 +0000 (18:24 +0200)
.gitignore
canping
config.target
tests/lib.sh [new file with mode: 0644]
tests/t01-simple.sh [new file with mode: 0755]

index 34de623..b045105 100644 (file)
@@ -3,3 +3,5 @@
 /_compiled/
 /socketcan/
 /config.omk-default
 /_compiled/
 /socketcan/
 /config.omk-default
+*~
+/cscope.*
diff --git a/canping b/canping
index 3285bf9..c2d88b9 160000 (submodule)
--- a/canping
+++ b/canping
@@ -1 +1 @@
-Subproject commit 3285bf97a73fe54806e97cc320a61673f8395df2
+Subproject commit c2d88b9017e8a92eb34a3b6ceeccf66c9091c2e9
index e4fb44a..04e1c05 100644 (file)
@@ -2,3 +2,5 @@ CONFIG_OC_CANVCA_IFC=multi
 CONFIG_OC_CANVCA_IFC_lincan=y
 CONFIG_OC_CANVCA_IFC_socketcan=y
 CONFIG_OC_CANVCA_IFC_multi=y
 CONFIG_OC_CANVCA_IFC_lincan=y
 CONFIG_OC_CANVCA_IFC_socketcan=y
 CONFIG_OC_CANVCA_IFC_multi=y
+
+CFLAGS += -g
diff --git a/tests/lib.sh b/tests/lib.sh
new file mode 100644 (file)
index 0000000..4fc9fc2
--- /dev/null
@@ -0,0 +1,24 @@
+set -x
+set -e
+
+PATH=$PWD/../_compiled/bin/:$PATH
+
+rmmod_can() {
+    modprobe -r lincan
+}
+
+load_lincan_hw() {
+    rmmod_can
+    modprobe -C /dev/null lincan hw=pcican-q io=1 baudrate=1000,1000,1000,1000 processlocal=0
+    sleep 0.1
+}
+
+load_lincan_virtual() {
+    rmmod_can
+    modprobe -C /dev/null lincan hw=virtual io=0 baudrate=0
+    sleep 0.1
+}
+
+load_socketcan() {
+    rmmod_can
+}
diff --git a/tests/t01-simple.sh b/tests/t01-simple.sh
new file mode 100755 (executable)
index 0000000..103630d
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+. lib.sh
+
+load_lincan_hw
+
+PID_S=`vca_canping -s 1 -b -r -d /dev/can1`
+
+vca_canping -m 1 -r -v -t 1 -d /dev/can0 -w 5 -c 1000
+
+kill $PID_S
+#killall -9 vca_canping