X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Fapp_test%2Frebuild.ksh;h=bf95b6d0c4accd2645abbd0e1f0a14f6e1a744e4;hb=3d7285ec4c96724b64968f46c2075b77e8d08543;hp=04367ef713bbc1ba96fc70da04c6c00fc45cd0c2;hpb=a41c6f5f26b3a44009f4aff3df3f83b9a79ace01;p=ric-plt%2Flib%2Frmr.git diff --git a/test/app_test/rebuild.ksh b/test/app_test/rebuild.ksh index 04367ef..bf95b6d 100644 --- a/test/app_test/rebuild.ksh +++ b/test/app_test/rebuild.ksh @@ -1,5 +1,5 @@ #!/usr/bin/env ksh -# :vi ts=4 sw=4 noet : +# vim: ts=4 sw=4 noet : #================================================================================== # Copyright (c) 2019 Nokia # Copyright (c) 2018-2019 AT&T Intellectual Property. @@ -20,27 +20,43 @@ # --------------------------------------------------------------------------------- # Mnemonic: rebuild.ksh -# Abstract: This is a simple script that will cause RMr to be rebuilt. It +# Abstract: This is a simple script that will cause RMr to be rebuilt. It # may be invoked by any of the run_* scripts in this directory. # +# NOTE: +# The build path is echod onto stdout so that the caller is able +# to reference build items for compile/linking. All other communication +# should be directed to stderr. +# # Date: 24 April 2019 # Author: E. Scott Daniels # --------------------------------------------------------------------------------- -build_path=../../.build +parent=${PWD%/*} # allow us to step up gracefully +gparent=${parent%/*} +build_path=${gparent}/.build # where we'll build +echo "$(date) build starts" >&2 ( set -e mkdir -p $build_path - cd ${build_path%/*} # cd barfs on ../../.build, so we do this - cd ${build_path##*/} - cmake .. + cd $gparent + if [[ $1 != "nopull" ]] # pull by default, but for local dev testing this needs to be avoided + then + git pull # get the up to date code so if run from an old image it's a good test + fi + cd $build_path + cmake .. -DDEV_PKG=1 make package -) +) >/tmp/PID$$.log if (( $? != 0 )) then - echo "build failed" + cat /tmp/PID$$>log + echo "$(date) build failed" >&2 exit 1 fi +echo "$(date) build completed" >&2 +echo "$build_path" +