test_windows.cmd 943 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. @ECHO OFF
  2. REM
  3. REM Copyright (c) Contributors to the Open 3D Engine Project.
  4. REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
  5. REM
  6. REM SPDX-License-Identifier: Apache-2.0 OR MIT
  7. REM
  8. REM
  9. SETLOCAL EnableDelayedExpansion
  10. CALL %~dp0env_windows.cmd
  11. IF NOT EXIST %OUTPUT_DIRECTORY% (
  12. ECHO [ci_build] Error: $OUTPUT_DIRECTORY was not found
  13. GOTO :error
  14. )
  15. PUSHD %OUTPUT_DIRECTORY%
  16. REM Find the CTEST_RUN_FLAGS from cmake's cache variables, then replace the $<CONFIG> with the current configuration
  17. FOR /F "tokens=2 delims==" %%V IN ('cmake -N -LA . ^| findstr /I CTEST_RUN_FLAGS:STRING') do (
  18. SET CTEST_RUN_FLAGS=%%V
  19. )
  20. SET CTEST_RUN_FLAGS=%CTEST_RUN_FLAGS:$<CONFIG>=!CONFIGURATION!%
  21. REM Run ctest
  22. ECHO [ci_build] ctest !CTEST_RUN_FLAGS! !CTEST_OPTIONS!
  23. ctest !CTEST_RUN_FLAGS! !CTEST_OPTIONS!
  24. IF NOT %ERRORLEVEL%==0 GOTO :popd_error
  25. POPD
  26. EXIT /b 0
  27. :popd_error
  28. POPD
  29. :error
  30. EXIT /b 1