test_linux.sh 865 B

1234567891011121314151617181920212223242526272829
  1. #!/usr/bin/env bash
  2. #
  3. # Copyright (c) Contributors to the Open 3D Engine Project.
  4. # For complete copyright and license terms please see the LICENSE at the root of this distribution.
  5. #
  6. # SPDX-License-Identifier: Apache-2.0 OR MIT
  7. #
  8. #
  9. set -o errexit # exit on the first failure encountered
  10. BASEDIR=$(dirname "$0")
  11. source $BASEDIR/env_linux.sh
  12. if [[ ! -d $OUTPUT_DIRECTORY ]]; then
  13. echo [ci_build] Error: $OUTPUT_DIRECTORY was not found
  14. exit 1
  15. fi
  16. pushd $OUTPUT_DIRECTORY
  17. # Find the CTEST_RUN_FLAGS from cmake's cache variables, then replace the $<CONFIG> with the current configuration
  18. IFS='=' read -ra CTEST_RUN_FLAGS <<< $(cmake -N -LA . | grep "CTEST_RUN_FLAGS:STRING")
  19. CTEST_RUN_FLAGS=${CTEST_RUN_FLAGS[1]/$<CONFIG>/${CONFIGURATION}}
  20. # Run ctest
  21. echo [ci_build] ctest ${CTEST_RUN_FLAGS} ${CTEST_OPTIONS}
  22. ctest ${CTEST_RUN_FLAGS} ${CTEST_OPTIONS}
  23. popd