Add linker flag and test script for google-perftools
This commit is contained in:
parent
109b5616d3
commit
d51d0aa5d5
2 changed files with 15 additions and 2 deletions
|
|
@ -20,13 +20,14 @@ EOF
|
|||
}
|
||||
|
||||
function run_tests {
|
||||
local profile=
|
||||
local mode=normal
|
||||
local args=()
|
||||
local target=$1
|
||||
local cmd="out/Debug/${target}"
|
||||
shift
|
||||
|
||||
while getopts "df:ghv" option; do
|
||||
while getopts "df:ghpv" option; do
|
||||
case ${option} in
|
||||
h)
|
||||
usage
|
||||
|
|
@ -38,6 +39,9 @@ function run_tests {
|
|||
g)
|
||||
mode=valgrind
|
||||
;;
|
||||
p)
|
||||
profile=true
|
||||
;;
|
||||
f)
|
||||
args+=("--only=${OPTARG}")
|
||||
;;
|
||||
|
|
@ -50,6 +54,10 @@ function run_tests {
|
|||
BUILDTYPE=Debug make $target
|
||||
args=${args:-""}
|
||||
|
||||
if [[ -n $profile ]]; then
|
||||
export CPUPROFILE=/tmp/${target}-$(date '+%s').prof
|
||||
fi
|
||||
|
||||
case ${mode} in
|
||||
valgrind)
|
||||
valgrind \
|
||||
|
|
@ -74,4 +82,8 @@ function run_tests {
|
|||
time $cmd "${args[@]}"
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ -n $profile ]]; then
|
||||
pprof $cmd $CPUPROFILE
|
||||
fi
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,6 +65,8 @@
|
|||
'-std=c++0x',
|
||||
],
|
||||
|
||||
'libraries': ['-weak-lprofiler'],
|
||||
|
||||
'xcode_settings': {
|
||||
'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
|
||||
'ALWAYS_SEARCH_USER_PATHS': 'NO',
|
||||
|
|
@ -76,4 +78,3 @@
|
|||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue