From: E. Scott Daniels Date: Thu, 13 Aug 2020 16:48:38 +0000 (-0400) Subject: Add rebuild to unit test script if no lib found X-Git-Tag: 2.3.1~3 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=cfe644eb560546f5f39d4a3823225b66180a9e9a;p=ric-plt%2Fxapp-frame-cpp.git Add rebuild to unit test script if no lib found The sonar jenkins jobs do not force a build which is now a problem for the unit tests as some of them require the framework library to be found. This change adds a build step to the unit test script if the library is missing which will allow the sonar jobs to run. Issue-ID: RIC-634 Signed-off-by: E. Scott Daniels Change-Id: I34e9a9bf5c6db1a868e390cdfa855e24c0b3b410 --- diff --git a/test/unit_test.sh b/test/unit_test.sh index c845553..a4f9d0a 100755 --- a/test/unit_test.sh +++ b/test/unit_test.sh @@ -92,7 +92,17 @@ done echo "## INFO ##" echo "build dir=$build_dir" -find $build_dir -name "libricxfcpp.*" +if ! find $build_dir | grep "libricxfcpp.*" # find returns good even if none; must grep to see error +then + echo "building first..." + ( + cd $build_dir + make package + ) + + echo "build finished" + find $build_dir -name "libricxfcpp.*" +fi echo "## INFO ##" export LD_LIBRARY_PATH=$build_dir:/usr/local/lib:$LD_LIBRARY_PATH