unit_test.sh 475 B

12345678910111213141516171819202122
  1. #!/bin/bash
  2. cd `dirname $0`
  3. echo '-------build unit test----------'
  4. MAKE=make
  5. if command -v python > /dev/null ; then
  6. MAKE="make -j $(python -c 'import multiprocessing as mp; print(int(mp.cpu_count()))')"
  7. fi
  8. echo $MAKE
  9. UT_BUILD_DIR=ut_build
  10. rm -rf $UT_BUILD_DIR
  11. mkdir $UT_BUILD_DIR
  12. cd $UT_BUILD_DIR
  13. cmake -DBUILD_FUNCTION_TESTS=OFF -DBUILD_UNIT_TESTS=ON -DENABLE_COVERAGE=ON ..
  14. $MAKE core_ut httpserver_for_ut
  15. echo '------- run unit test -----------'
  16. ctest --verbose