Fix UST tests if lttng-ust is not available
[lttng-tools.git] / tests / ust-nevents / run
index 9fbc8d80536b7c867c3372f0e75deeff6091c453..301b70d970bf1f3c057f99999dedefaa7e169a9b 100755 (executable)
 # along with this library; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
 
-TESTDIR=$(dirname $0)/..
+CURDIR=$(dirname $0)/
+TESTDIR=$CURDIR/..
 NR_ITER=100
 SESSION_NAME="ust-nevents"
 EVENT_NAME="ust_gen_nevents:tptest"
-TRACE_PATH=$(mktemp -d)
 
 source $TESTDIR/utils.sh
 
@@ -27,6 +27,13 @@ echo -e "\n-----------------------------------"
 echo -e "UST tracer - Generate $NR_ITER events"
 echo -e "-------------------------------------"
 
+if [ ! -e "$CURDIR/gen-nevents" ]; then
+       echo -e "No UST nevents binary detected. Passing."
+       exit 0
+fi
+
+TRACE_PATH=$(mktemp -d)
+
 # MUST set TESTDIR before calling those functions
 
 create_lttng_session $SESSION_NAME $TRACE_PATH
@@ -35,7 +42,7 @@ enable_ust_lttng_event $SESSION_NAME $EVENT_NAME
 start_tracing $SESSION_NAME
 
 # Start test
-./$(dirname $0)/gen-nevents $NR_ITER
+./$CURDIR/gen-nevents $NR_ITER
 
 stop_tracing $SESSION_NAME
 destroy_lttng_session $SESSION_NAME
This page took 0.03118 seconds and 4 git commands to generate.