Skip to content

Commit

Permalink
scripts: add shell option --disable_gperf and install tests in builde…
Browse files Browse the repository at this point in the history
…r/bin (#188)
  • Loading branch information
Wu Tao authored and qinzuoyan committed Oct 17, 2018
1 parent ee7e730 commit 3a8035c
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 10 deletions.
2 changes: 1 addition & 1 deletion rdsn
Submodule rdsn updated 137 files
11 changes: 10 additions & 1 deletion run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ function usage_build()
echo " -w|--warning_all open all warnings when building, default no"
echo " --enable_gcov generate gcov code coverage report, default no"
echo " -v|--verbose build in verbose mode, default no"
echo " --disable_gperf build without gperftools, this flag is mainly used"
echo " to enable valgrind memcheck, default no"
}
function run_build()
{
Expand Down Expand Up @@ -132,6 +134,10 @@ function run_build()
-v|--verbose)
RUN_VERBOSE=YES
;;
--disable_gperf)
DISABLE_GPERF=YES
shift
;;
*)
echo "ERROR: unknown option \"$key\""
echo
Expand Down Expand Up @@ -183,6 +189,9 @@ function run_build()
if [ "$ENABLE_GCOV" == "YES" ]; then
OPT="$OPT --enable_gcov"
fi
if [ "$DISABLE_GPERF" == "YES" ]; then
OPT="$OPT --disable_gperf"
fi
./run.sh build $OPT --notest
if [ $? -ne 0 ]; then
echo "ERROR: build rdsn failed"
Expand Down Expand Up @@ -266,7 +275,7 @@ function run_build()
C_COMPILER="$C_COMPILER" CXX_COMPILER="$CXX_COMPILER" BUILD_TYPE="$BUILD_TYPE" \
CLEAR="$CLEAR" PART_CLEAR="$PART_CLEAR" JOB_NUM="$JOB_NUM" \
BOOST_DIR="$BOOST_DIR" WARNING_ALL="$WARNING_ALL" ENABLE_GCOV="$ENABLE_GCOV" \
RUN_VERBOSE="$RUN_VERBOSE" TEST_MODULE="$TEST_MODULE" ./build.sh
RUN_VERBOSE="$RUN_VERBOSE" TEST_MODULE="$TEST_MODULE" DISABLE_GPERF="$DISABLE_GPERF" ./build.sh
if [ $? -ne 0 ]; then
echo "ERROR: build pegasus failed"
exit 1
Expand Down
2 changes: 1 addition & 1 deletion src/base/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ set(MY_BOOST_PACKAGES system filesystem)

set(MY_BINPLACES "config.ini")

dsn_add_executable()
dsn_add_test()
9 changes: 9 additions & 0 deletions src/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,15 @@ else
echo "ENABLE_GCOV=NO"
fi

# valgrind can not work together with gpertools
# you may want to use this option when you want to run valgrind
if [ "$DISABLE_GPERF" == "YES" ]
echo "DISABLE_GPERF=YES"
CMAKE_OPTIONS="$CMAKE_OPTIONS -DENABLE_GPERF=Off"
then
echo "DISABLE_GPERF=NO"
fi

# You can specify customized boost by defining BOOST_DIR.
# Install boost like this:
# wget http://downloads.sourceforge.net/project/boost/boost/1.54.0/boost_1_54_0.zip?r=&ts=1442891144&use_mirror=jaist
Expand Down
2 changes: 1 addition & 1 deletion src/geo/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ add_definitions(-Wno-attributes)

set(MY_BINPLACES "config.ini")

dsn_add_executable()
dsn_add_test()
2 changes: 1 addition & 1 deletion src/redis_protocol/proxy_ut/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ set(MY_BINPLACES "config.ini" "run.sh")
add_compile_options("-Wno-dangling-else")
add_definitions(-Wno-attributes)

dsn_add_executable()
dsn_add_test()
2 changes: 1 addition & 1 deletion src/server/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ set(MY_BOOST_PACKAGES system filesystem regex)

set(MY_BINPLACES config.ini run.sh)

dsn_add_executable()
dsn_add_test()
1 change: 1 addition & 0 deletions src/test/bench_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ set(MY_BOOST_PACKAGES system filesystem)
set(MY_BINPLACES "config.ini")

dsn_add_executable()
dsn_install_executable()
2 changes: 1 addition & 1 deletion src/test/function_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ set(MY_PROJ_LIB_PATH "../..")

set(MY_BINPLACES "config.ini" "run.sh")

dsn_add_executable()
dsn_add_test()
2 changes: 1 addition & 1 deletion src/test/kill_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ if (UNIX)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
endif()

dsn_add_executable()
dsn_add_test()
2 changes: 1 addition & 1 deletion src/test/pressure_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ if (UNIX)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
endif()

dsn_add_executable()
dsn_add_test()
2 changes: 1 addition & 1 deletion src/test/upgrade_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ if (UNIX)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
endif()

dsn_add_executable()
dsn_add_test()

0 comments on commit 3a8035c

Please sign in to comment.