Update test harness to use matching build system 49/299549/2
authorDavid Steele <david.steele@samsung.com>
Wed, 4 Oct 2023 16:34:08 +0000 (17:34 +0100)
committerDavid Steele <david.steele@samsung.com>
Thu, 5 Oct 2023 16:08:19 +0000 (17:08 +0100)
Change-Id: Ie78bf75496f7fb097afe487ad3a9650d9765ccf3

automated-tests/build.sh
automated-tests/coverage.sh

index 7e812e1..a56cd87 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 
 
-TEMP=`getopt -o r --long rebuild \
+TEMP=`getopt -o rn --long rebuild,no-gen \
      -n 'genmake' -- "$@"`
 
 if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
@@ -10,10 +10,12 @@ if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
 eval set -- "$TEMP"
 
 opt_rebuild=false
+opt_generate=true
 
 while true ; do
     case "$1" in
         -r|--rebuild) opt_rebuild=true ; shift ;;
+        -n|--no-gen)  opt_generate=false ; shift ;;
         --) shift ; break ;;
         *) shift ;;   # Ignore
     esac
@@ -26,7 +28,17 @@ fi
 
 function build
 {
-    (cd build ; cmake .. -DMODULE=$1 ; make -j7 )
+    if [ $opt_generate == true -o $opt_rebuild == false ] ; then
+        (cd src/$1; ../../scripts/tcheadgen.sh tct-$1-core.h)
+        if [ $? -ne 0 ]; then echo "Aborting..."; exit 1; fi
+    fi
+    BUILDSYSTEM="Unix Makefiles"
+    BUILDCMD=make
+    if [ -e ../build/tizen/build.ninja ] ; then
+        BUILDSYSTEM="Ninja"
+        BUILDCMD=ninja
+    fi
+    (cd build ; cmake .. -DMODULE=$1 -G "$BUILDSYSTEM" ; $BUILDCMD -j7 )
 }
 
 if [ -n "$1" ] ; then
index 11c534d..d9589ce 100755 (executable)
@@ -6,18 +6,16 @@ if [ $1 == -n ] ; then
 fi
 
 BUILD_DIR_NAME=tizen
-function MakeCovData()
-{
-    (  cd ../build/$BUILD_DIR_NAME ; make cov_data )
-}
-
-MakeCovData
-if [[ $? -ne 0 ]]
-then
-    BUILD_DIR_NAME=tizen-cmake
-    MakeCovData
+
+BUILDSYSTEM=make
+
+if [ -e ../build/tizen/build.ninja ] ; then
+    BUILDSYSTEM=ninja
 fi
 
+(  cd ../build/$BUILD_DIR_NAME ; $BUILDSYSTEM cov_data )
+
+
 # From lcov version 1.10 onwards, branch coverage is off by default and earlier versions do not support the rc option
 LCOV_OPTS=`if [ \`printf "\\\`lcov --version | cut -d' ' -f4\\\`\n1.10\n" | sort -V | head -n 1\` = 1.10 ] ; then echo "--rc lcov_branch_coverage=1" ; fi`