Modify tldk jenkins job to enable unit tests 94/4694/2
authorroot <root@gklab-246-006.igk.intel.com>
Mon, 16 Jan 2017 08:13:54 +0000 (09:13 +0100)
committerKarol Latecki <karolx.latecki@intel.com>
Mon, 16 Jan 2017 16:29:05 +0000 (17:29 +0100)
Modify TLDK jenkins job to clone and build googletest and run unit tests.

Change-Id: I20b8bce8c715a492ac77d73f07a2b26f56f4d057
Signed-off-by: Karol Latecki <karolx.latecki@intel.com>
jjb/tldk/gtest-build.sh [new file with mode: 0755]
jjb/tldk/include-raw-build.sh [changed mode: 0644->0755]
jjb/tldk/tldk.yaml

diff --git a/jjb/tldk/gtest-build.sh b/jjb/tldk/gtest-build.sh
new file mode 100755 (executable)
index 0000000..764e280
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/bash
+set -e -o pipefail
+echo $WORKSPACE
+git clone https://github.com/google/googletest.git $WORKSPACE/googletest
+cmake $WORKSPACE/googletest/CMakeLists.txt
+make -C $WORKSPACE/googletest
+echo GTEST_DIR=$WORKSPACE/googletest/googletest > gtest-env.prop
+echo GMOCK_DIR=$WORKSPACE/googletest/googlemock >> gtest-env.prop
+
+echo "*******************************************************************"
+echo "* GTEST BUILD SUCCESSFULLY COMPLETED"
+echo "*******************************************************************"
+
old mode 100644 (file)
new mode 100755 (executable)
index f4ba63b..a1b0a8e
@@ -28,8 +28,16 @@ fi
 echo "sha1sum of this script: ${0}"
 sha1sum $0
 
+# Make TLDK
 make
 
 echo "*******************************************************************"
 echo "* TLDK BUILD SUCCESSFULLY COMPLETED"
 echo "*******************************************************************"
+
+# Run unit tests application
+$WORKSPACE/x86_64-native-linuxapp-gcc/app/gtest-rfc --lcores=0 -n 2
+
+echo "*******************************************************************"
+echo "* TLDK UNIT TESTS SUCCESSFUL"
+echo "*******************************************************************"
index 1b96105..f235704 100644 (file)
             branch: '{branch}'
 
     builders:
+        - shell:
+            !include-raw-escape: gtest-build.sh
+        - inject:
+            properties-file: gtest-env.prop
         - shell:
             !include-raw-escape: include-raw-build.sh
 
                 notbuilt: true
 
     builders:
+        - shell:
+            !include-raw-escape: gtest-build.sh
+        - inject:
+            properties-file: gtest-env.prop
         - shell:
             !include-raw-escape: include-raw-build.sh
 
             branch: '{branch}'
 
     builders:
+        - shell:
+            !include-raw-escape: gtest-build.sh
+        - inject:
+            properties-file: gtest-env.prop
         - shell:
             !include-raw-escape: include-raw-build.sh