summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHanoh Haim <hhaim@cisco.com>2015-12-28 11:50:38 +0200
committerHanoh Haim <hhaim@cisco.com>2015-12-28 11:50:38 +0200
commit5dc902232f12e98c9e0138f285c84e466ea6b518 (patch)
tree2ae195ed510c12dca047cfe1b44d9b4d78a2c30d
parentc6e339496ef514eb672376ee22f6b23bbdd1ea13 (diff)
add bcov utility for coverity
-rw-r--r--linux_dpdk/bcov32
1 files changed, 32 insertions, 0 deletions
diff --git a/linux_dpdk/bcov b/linux_dpdk/bcov
new file mode 100644
index 00000000..7eb76fa7
--- /dev/null
+++ b/linux_dpdk/bcov
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+# if no variable of $PYTHON is define - we try to find it
+function find_python {
+ # two candidates - machine python and cisco linux python
+ MACHINE_PYTHON=python
+ CEL_PYTHON=/router/bin/python
+
+ # try the machine python
+ PYTHON=$MACHINE_PYTHON
+
+ PCHECK=`$PYTHON -c "import sys; ver = sys.version_info[0] * 10 + sys.version_info[1];sys.exit(ver < 27)"`
+ if [ $? -ne 0 ]; then
+ PYTHON=$CEL_PYTHON
+ PCHECK=`$PYTHON -c "import sys; ver = sys.version_info[0] * 10 + sys.version_info[1];sys.exit(ver < 27)"`
+
+ if [ $? -ne 0 ]; then
+ echo "*** $PYTHON - python version is too old, 2.7 at least is required"
+ exit -1
+ fi
+
+ fi
+
+}
+
+if [ -z "$PYTHON" ]; then
+ find_python
+fi
+
+$PYTHON cov.py $@
+
+