hctlabverify.cmd 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. @echo off
  2. if "%1"=="/?" goto :showhelp
  3. if "%1"=="-?" goto :showhelp
  4. if "%1"=="-help" goto :showhelp
  5. if "%1"=="--help" goto :showhelp
  6. setlocal ENABLEDELAYEDEXPANSION
  7. set X86_DBG=1
  8. set X86_REL=1
  9. set X86_TST=1
  10. set X64_DBG=1
  11. set X64_REL=1
  12. set X64_TST=1
  13. set ANALYZE=-analyze
  14. set FV_FLAG=
  15. set CV_FLAG=
  16. if "%1"=="-short" (
  17. echo Building / testing fewer versions.
  18. set X86_DBG=0
  19. set X86_REL=1
  20. set X86_TST=0
  21. set X64_DBG=1
  22. set X64_REL=0
  23. set X64_TST=1
  24. set ANALYZE=
  25. shift /1
  26. )
  27. if "%1"=="-fv" (
  28. echo Fixed version flag set for lab verification.
  29. set FV_FLAG=-fv
  30. shift /1
  31. )
  32. if "%1"=="-cv" (
  33. echo Setting the CLANG_VENDOR value.
  34. set CV_FLAG=-cv %2
  35. shift /1
  36. shift /1
  37. )
  38. if "%HLSL_SRC_DIR%"=="" (
  39. echo Missing source directory.
  40. if exist %~dp0..\..\LLVMBuild.txt (
  41. set HLSL_SRC_DIR=%~dp0..\..
  42. echo Source directory deduced to be %~dp0..\..
  43. ) else (
  44. exit /b 1
  45. )
  46. )
  47. if "%1"=="-buildoutdir" (
  48. echo Build output directory set to %2
  49. set HLSL_BLD_DIR=%2
  50. shift /1
  51. shift /1
  52. )
  53. rem Create the solutions per architecture.
  54. call :verify_arch x86 %X86_TST% %X86_DBG% %X86_REL%
  55. if errorlevel 1 (
  56. echo Failed to verify for x86.
  57. exit /b 1
  58. )
  59. call :verify_arch x64 %X64_TST% %X64_DBG% %X64_REL%
  60. if errorlevel 1 (
  61. echo Failed to verify for x64.
  62. exit /b 1
  63. )
  64. rem Don't run tests for arm
  65. rem Disable until the work goes in to pick up tablegen for x86/x64.
  66. rem call :verify_arch arm 0
  67. if errorlevel 1 (
  68. echo Failed to verify for arm.
  69. exit /b 1
  70. )
  71. endlocal
  72. exit /b 0
  73. :showhelp
  74. echo Runs the verification steps for a lab configuration.
  75. echo.
  76. echo Usage:
  77. echo hctlabverify [-short] [-fv] [-buildOutDir dir]
  78. echo.
  79. echo Options:
  80. echo -short builds fewer components
  81. echo -fv fixes version information
  82. echo -buildOutDir sets the base output directory
  83. echo.
  84. goto :eof
  85. :verify_arch
  86. rem Performs a per-architecture build and test.
  87. rem 1 - architecture
  88. rem 2 - '1' to run tests, 0 otherwise
  89. rem 3 - '1' to build debug, 0 to skip
  90. rem 4 - '1' to build release, 0 to skip
  91. setlocal
  92. set HLSL_BLD_DIR=%HLSL_BLD_DIR%\%1
  93. mkdir %HLSL_BLD_DIR%
  94. rem Build the solution.
  95. call %HLSL_SRC_DIR%\utils\hct\hctbuild.cmd -s %FV_FLAG% %CV_FLAG% -%1
  96. if errorlevel 1 (
  97. echo Failed to create solution for architecture %1
  98. exit /b 1
  99. )
  100. rem Build debug.
  101. if "%3"=="1" (
  102. call %HLSL_SRC_DIR%\utils\hct\hctbuild.cmd -b -%1
  103. if errorlevel 1 (
  104. echo Failed to build for architecture %1
  105. exit /b 1
  106. )
  107. )
  108. rem Build retail.
  109. if "%4"=="1" (
  110. call %HLSL_SRC_DIR%\utils\hct\hctbuild.cmd -b %ANALYZE% -rel -%1
  111. if errorlevel 1 (
  112. echo Failed to build for architecture %1 in release
  113. exit /b 1
  114. )
  115. )
  116. rem Run tests.
  117. if "%2"=="1" (
  118. rem Pick Debug if available, retail otherwise.
  119. if "%3"=="1" (
  120. call %HLSL_SRC_DIR%\utils\hct\hcttest.cmd
  121. ) else (
  122. call %HLSL_SRC_DIR%\utils\hct\hcttest.cmd -rel
  123. )
  124. ) else (
  125. echo Skipping tests.
  126. )
  127. endlocal
  128. exit /b 0