From 6ea34785c848c3c61026c19e9681f6efc048c3f7 Mon Sep 17 00:00:00 2001 From: nsubiron Date: Sun, 21 Oct 2018 15:12:43 +0200 Subject: [PATCH] Add support for .gtest file --- .gitignore | 3 ++- Util/BuildTools/Check.sh | 13 ++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index d025fb378..b5fa9e66f 100644 --- a/.gitignore +++ b/.gitignore @@ -11,9 +11,9 @@ Install *.egg-info *.kdev4 *.log +*.o *.pb.cc *.pb.h -*.o *.pid *.pri *.pro @@ -27,6 +27,7 @@ Install *CodeLitePreProcessor.txt .codelite .gdb_history +.gtest .tags* .vs __pycache__ diff --git a/Util/BuildTools/Check.sh b/Util/BuildTools/Check.sh index c31b8420a..a5c930c04 100755 --- a/Util/BuildTools/Check.sh +++ b/Util/BuildTools/Check.sh @@ -20,12 +20,19 @@ Or choose one or more of the following [--libcarla-release] [--libcarla-debug] [--python-api-2] [--python-api-3] [--benchmark] + +You can also set the command-line arguments passed to GTest on a ".gtest" +config file in the Carla project main folder. E.g. + + # Contents of ${CARLA_ROOT_FOLDER}/.gtest + gtest_shuffle + gtest_filter=misc* END ) GDB= XML_OUTPUT=false -GTEST_ARGS= +GTEST_ARGS=`sed -e 's/#.*$//g' ${CARLA_ROOT_FOLDER}/.gtest | sed -e '/^[[:space:]]*$/!s/^/--/g' | sed -e ':a;N;$!ba;s/\n/ /g'` LIBCARLA_RELEASE=false LIBCARLA_DEBUG=false PYTHON_API_2=false @@ -98,6 +105,8 @@ if ${LIBCARLA_DEBUG} ; then log "Running LibCarla unit tests debug." + echo "Running: ${GDB} libcarla_test_debug ${GTEST_ARGS} ${EXTRA_ARGS}" + LD_LIBRARY_PATH=${LIBCARLA_INSTALL_SERVER_FOLDER}/lib ${GDB} ${LIBCARLA_INSTALL_SERVER_FOLDER}/test/libcarla_test_debug ${GTEST_ARGS} ${EXTRA_ARGS} fi @@ -112,6 +121,8 @@ if ${LIBCARLA_RELEASE} ; then log "Running LibCarla unit tests release." + echo "Running: ${GDB} libcarla_test_release ${GTEST_ARGS} ${EXTRA_ARGS}" + LD_LIBRARY_PATH=${LIBCARLA_INSTALL_SERVER_FOLDER}/lib ${GDB} ${LIBCARLA_INSTALL_SERVER_FOLDER}/test/libcarla_test_release ${GTEST_ARGS} ${EXTRA_ARGS} fi