test_driver.sh.in 515 B

1234567891011121314151617181920212223242526
  1. #! /bin/bash
  2. # Arguments:
  3. # 1. Test path/file (relative to "tests" folder)
  4. # 2. Optional server to run (relative to "tests" folder)
  5. BUILD_FOLDER=@CMAKE_BINARY_DIR@
  6. # start optional server provided in $2
  7. if [[ $2 ]] ; then
  8. echo "SERVER: $BUILD_FOLDER/$2 & sleep 0.2"
  9. "$BUILD_FOLDER/$2" &
  10. sleep 0.2
  11. fi
  12. # execute test provided in $1 with backend provided in $2
  13. echo "CLIENT: $BUILD_FOLDER/$1"
  14. "$BUILD_FOLDER/$1"
  15. EXIT_CODE=$?
  16. # kill qml background server process
  17. [[ $2 ]] && kill $!
  18. exit $EXIT_CODE