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 <daniels@research.att.com>
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 @@
 
 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