Skip to content

Commit b42bbdd

Browse files
authored
Add -enable-lit option to hcttest (microsoft#4869)
This patch attempts to translate HCTTest options to LIT build targets. Since HCTTest and lit break up tests differently the mapping isn't quite the same, but it should be close enough. Before we can migrate our automation builds to using lit we need to separate out the exec tests so that they can be disabled on the ADO bots.
1 parent 2c3d965 commit b42bbdd

File tree

1 file changed

+38
-1
lines changed

1 file changed

+38
-1
lines changed

utils/hct/hcttest.cmd

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ set TEST_DXILCONV_FILTER=
2323
set TEST_EXEC_FUTURE=0
2424
set TEST_EXTRAS=0
2525
set TEST_EXEC_REQUIRED=0
26+
set TEST_USE_LIT=0
2627
set TEST_CLANG_FILTER=
2728
set TEST_EXEC_FILTER=ExecutionTest::*
2829
set LOG_FILTER=/logOutput:LowWithConsoleBuffering
@@ -143,6 +144,8 @@ if "%1"=="-clean" (
143144
set TEST_EXTRAS=1
144145
) else if "%1"=="-ninja" (
145146
set GENERATOR_NINJA=1
147+
) else if "%1"=="-enable-lit" (
148+
set TEST_USE_LIT=1
146149
) else if "%1"=="-rel" (
147150
set BUILD_CONFIG=Release
148151
) else if /i "%1"=="-Release" (
@@ -252,11 +255,45 @@ if "%TEST_CLEAN%"=="1" (
252255
)
253256
)
254257

258+
if "%TEST_USE_LIT%"=="1" (
259+
rem LIT does not separate exect tests from other taef tests.
260+
if "%TEST_EXEC%"=="1" (
261+
set TEST_CLANG=1
262+
)
263+
if "%TEST_SPIRV%"=="1" (
264+
set TEST_CLANG=1
265+
)
266+
if "%TEST_ALL%"=="1" (
267+
rem check all includes clang, dxilconv, and exec
268+
cmake --build %HLSL_BLD_DIR% --config %BUILD_CONFIG% --target check-all
269+
set RES_CLANG=!ERRORLEVEL!
270+
set RES_DXILCONV=%RES_CLANG%
271+
set RES_EXEC=%RES_CLANG%
272+
) else (
273+
if "%TEST_DXILCONV%"=="1" (
274+
cmake --build %HLSL_BLD_DIR% --config %BUILD_CONFIG% --target check-dxilconv
275+
set RES_DXILCONV=!ERRORLEVEL!
276+
)
277+
if "%TEST_CLANG%"=="1" (
278+
cmake --build %HLSL_BLD_DIR% --config %BUILD_CONFIG% --target check-clang
279+
set RES_CLANG=!ERRORLEVEL!
280+
set RES_EXEC=%RES_CLANG%
281+
)
282+
)
283+
set TEST_CLANG=0
284+
set TEST_DXILCONV=0
285+
set TEST_SPIRV=0
286+
set TEST_EXEC=0
287+
)
288+
255289
if not exist %TEST_DIR% (mkdir %TEST_DIR%)
256290

257291
echo Copying binaries to test to %TEST_DIR%:
258292
if "%CUSTOM_BIN_SET%"=="" (
259-
call %HCT_DIR%\hctcopy.cmd %BIN_DIR% %TEST_DIR% dxa.exe dxc.exe dxexp.exe dxopt.exe dxr.exe dxv.exe clang-hlsl-tests.dll dxcompiler.dll d3dcompiler_dxc_bridge.dll dxl.exe dxc_batch.exe dxlib_sample.dll
293+
if not "%TEST_USE_LIT%"=="1" (
294+
call %HCT_DIR%\hctcopy.cmd %BIN_DIR% %TEST_DIR% clang-hlsl-tests.dll
295+
)
296+
call %HCT_DIR%\hctcopy.cmd %BIN_DIR% %TEST_DIR% dxa.exe dxc.exe dxexp.exe dxopt.exe dxr.exe dxv.exe dxcompiler.dll d3dcompiler_dxc_bridge.dll dxl.exe dxc_batch.exe dxlib_sample.dll
260297
if errorlevel 1 exit /b 1
261298
if "%TEST_DXILCONV%"=="1" (
262299
call %HCT_DIR%\hctcopy.cmd %BIN_DIR% %TEST_DIR% dxbc2dxil.exe dxilconv-tests.dll opt.exe

0 commit comments

Comments
 (0)