add: valgrind usage in testing
This commit is contained in:
parent
3acea7fc2f
commit
d5f4820196
1 changed files with 8 additions and 7 deletions
|
@ -4,6 +4,11 @@ source_dir=$PWD
|
|||
working_dir=$PWD/testing_tmp
|
||||
working_bak=$PWD/testing_bak
|
||||
|
||||
alias valgrind_emgauwa="valgrind --leak-check=full \
|
||||
--show-leak-kinds=all \
|
||||
--track-origins=yes \
|
||||
--log-file=$working_dir/valgrind.log"
|
||||
|
||||
rm -rf $working_dir
|
||||
mkdir -p $working_dir
|
||||
cd $working_dir
|
||||
|
@ -24,7 +29,7 @@ popd > /dev/null
|
|||
cp $1 $working_dir/core
|
||||
cp $source_dir/core.testing.ini $working_dir/core.ini
|
||||
|
||||
$working_dir/core start >$working_dir/core.log 2>&1 &
|
||||
valgrind_emgauwa $working_dir/core start >$working_dir/core.log 2>&1 &
|
||||
core_id=$!
|
||||
|
||||
sleep 2;
|
||||
|
@ -35,12 +40,8 @@ test_result=$?
|
|||
kill $core_id
|
||||
kill $controller_id
|
||||
|
||||
if [ $test_result -gt 0 ]
|
||||
then
|
||||
rm -rf $working_bak
|
||||
mv $working_dir $working_bak
|
||||
fi
|
||||
|
||||
rm -rf $working_bak
|
||||
mv $working_dir $working_bak
|
||||
rm -rf $working_dir
|
||||
|
||||
exit $test_result
|
||||
|
|
Loading…
Reference in a new issue