Ver código fonte

[enable lit] Keep same name for ClangHLSLTests when enable lit (#5167)

* [enable lit] Keep same name for ClangHLSLTests when enable lit

This is for enable lit by default.
It will make sure with/without lit enabled, ClangHLSLTests output dll with same name.

Use ClangHLSLTests because LIT needs GoogleTest binaries to be named that way for test discovery.
Xiang Li 2 anos atrás
pai
commit
14063a661c

+ 1 - 1
appveyor.yml

@@ -51,7 +51,7 @@ test_script:
 - sh: ./bin/dxc -T ps_6_0 -Fo passthru-ps.dxil ../tools/clang/test/CodeGenSPIRV/passthru-ps.hlsl2spv
 - sh: ./bin/dxc -T ps_6_0 -Fo passthru-ps.dxil ../tools/clang/test/CodeGenSPIRV/passthru-ps.hlsl2spv
 - sh: ./bin/dxc -T ps_6_0 -Fo passthru-ps.spv ../tools/clang/test/CodeGenSPIRV/passthru-ps.hlsl2spv -spirv
 - sh: ./bin/dxc -T ps_6_0 -Fo passthru-ps.spv ../tools/clang/test/CodeGenSPIRV/passthru-ps.hlsl2spv -spirv
 - sh: ./bin/clang-spirv-tests --spirv-test-root ../tools/clang/test/CodeGenSPIRV/
 - sh: ./bin/clang-spirv-tests --spirv-test-root ../tools/clang/test/CodeGenSPIRV/
-- sh: ./bin/clang-hlsl-tests --HlslDataDir $PWD/../tools/clang/test/HLSL/
+- sh: ./bin/ClangHLSLTests --HlslDataDir $PWD/../tools/clang/test/HLSL/
 
 
 after_test:
 after_test:
 # Collect artifacts for Windows
 # Collect artifacts for Windows

+ 0 - 1
tools/clang/unittests/HLSL/CMakeLists.txt

@@ -114,7 +114,6 @@ include_directories(${CLANG_BINARY_DIR}/lib/Sema)
 add_dependencies(ClangHLSLTests dxcompiler)
 add_dependencies(ClangHLSLTests dxcompiler)
 
 
 if (NOT CLANG_INCLUDE_TESTS)
 if (NOT CLANG_INCLUDE_TESTS)
-  set_target_properties(ClangHLSLTests PROPERTIES OUTPUT_NAME clang-hlsl-tests)
   set_output_directory(ClangHLSLTests
   set_output_directory(ClangHLSLTests
     ${LLVM_RUNTIME_OUTPUT_INTDIR} ${LLVM_LIBRARY_OUTPUT_INTDIR})
     ${LLVM_RUNTIME_OUTPUT_INTDIR} ${LLVM_LIBRARY_OUTPUT_INTDIR})
   if (NOT WIN32)
   if (NOT WIN32)

+ 1 - 2
tools/clang/unittests/HLSLExec/CMakeLists.txt

@@ -6,7 +6,7 @@ find_package(D3D12 REQUIRED) # Used for ExecutionTest.cpp.
 add_clang_library(ExecHLSLTests SHARED
 add_clang_library(ExecHLSLTests SHARED
   ExecutionTest.cpp
   ExecutionTest.cpp
   ShaderOpTest.cpp
   ShaderOpTest.cpp
-  exec-hlsl-tests.rc
+  ExecHLSLTests.rc
   )
   )
 
 
 add_dependencies(ClangUnitTests ExecHLSLTests)
 add_dependencies(ClangUnitTests ExecHLSLTests)
@@ -28,7 +28,6 @@ include_directories(${LLVM_MAIN_INCLUDE_DIR}/dxc/Test)
 add_dependencies(ExecHLSLTests dxcompiler)
 add_dependencies(ExecHLSLTests dxcompiler)
 
 
 if (NOT CLANG_INCLUDE_TESTS)
 if (NOT CLANG_INCLUDE_TESTS)
-  set_target_properties(ExecHLSLTests PROPERTIES OUTPUT_NAME exec-hlsl-tests)
   set_output_directory(ExecHLSLTests
   set_output_directory(ExecHLSLTests
     ${LLVM_RUNTIME_OUTPUT_INTDIR} ${LLVM_LIBRARY_OUTPUT_INTDIR})
     ${LLVM_RUNTIME_OUTPUT_INTDIR} ${LLVM_LIBRARY_OUTPUT_INTDIR})
 endif()
 endif()

+ 0 - 0
tools/clang/unittests/HLSLExec/exec-hlsl-tests.rc → tools/clang/unittests/HLSLExec/ExecHLSLTests.rc


+ 1 - 1
tools/clang/unittests/HLSLHost/HLSLHost.cpp

@@ -235,7 +235,7 @@ private:
 
 
   HRESULT LoadTestDll() {
   HRESULT LoadTestDll() {
     if (m_TestDLL == NULL) {
     if (m_TestDLL == NULL) {
-      m_TestDLL = LoadLibrary("clang-hlsl-tests.dll");
+      m_TestDLL = LoadLibrary("ClangHLSLTests.dll");
       m_pRunOpTestFn = (RunOpTestFn)GetProcAddress(m_TestDLL, "RunOpTest");
       m_pRunOpTestFn = (RunOpTestFn)GetProcAddress(m_TestDLL, "RunOpTest");
       m_pInitOpTestFn = (InitOpTestFn)GetProcAddress(m_TestDLL, "InitializeOpTests");
       m_pInitOpTestFn = (InitOpTestFn)GetProcAddress(m_TestDLL, "InitializeOpTests");
       HRESULT hrInit = m_pInitOpTestFn(this, RendererLog);
       HRESULT hrInit = m_pInitOpTestFn(this, RendererLog);

+ 2 - 2
utils/appveyor/appveyor_test.ps1

@@ -13,7 +13,7 @@ function ConvertTo-AppveyorTest([System.Xml.XmlNode] $endTest) {
     New-Object PSObject -Property @{
     New-Object PSObject -Property @{
         testName = $endTest.Title
         testName = $endTest.Title
         testFramework = "TAEF"
         testFramework = "TAEF"
-        fileName = "clang-hlsl-tests.dll"
+        fileName = "ClangHLSLTests.dll"
         outcome = ConvertTo-AppveyorTestOutcome($endTest.Result)
         outcome = ConvertTo-AppveyorTestOutcome($endTest.Result)
         durationMilliseconds = ""
         durationMilliseconds = ""
         ErrorMessage = ""
         ErrorMessage = ""
@@ -39,7 +39,7 @@ function Invoke-AppveyorTestsRestMethod($appveyorTests) {
 }
 }
 
 
 function Invoke-TE($logfile) {
 function Invoke-TE($logfile) {
-    $testdll = "$env:HLSL_BLD_DIR\Release\bin\clang-hlsl-tests.dll"
+    $testdll = "$env:HLSL_BLD_DIR\Release\bin\ClangHLSLTests.dll"
     $p = Start-Process "te.exe" -Args "$testdll /logOutput:Low /logFile:$logfile /enableWttLogging /p:HlslDataDir=%HLSL_SRC_DIR%\tools\clang\test\HLSL /labMode /miniDumpOnCrash" -Wait -NoNewWindow -PassThru
     $p = Start-Process "te.exe" -Args "$testdll /logOutput:Low /logFile:$logfile /enableWttLogging /p:HlslDataDir=%HLSL_SRC_DIR%\tools\clang\test\HLSL /labMode /miniDumpOnCrash" -Wait -NoNewWindow -PassThru
     return $p.ExitCode
     return $p.ExitCode
 }
 }

+ 7 - 7
utils/hct/VerifierHelper.py

@@ -1,10 +1,10 @@
 # Copyright (C) Microsoft Corporation. All rights reserved.
 # Copyright (C) Microsoft Corporation. All rights reserved.
 # This file is distributed under the University of Illinois Open Source License. See LICENSE.TXT for details.
 # This file is distributed under the University of Illinois Open Source License. See LICENSE.TXT for details.
 r"""VerifierHelper.py - help with test content used with:
 r"""VerifierHelper.py - help with test content used with:
-    clang-hlsl-tests /name:VerifierTest.*
+    ClangHLSLTests /name:VerifierTest.*
 
 
     This script will produce an HLSL file with expected-error and expected-warning
     This script will produce an HLSL file with expected-error and expected-warning
-    statements corresponding to actual errors/warnings produced from clang-hlsl-tests.
+    statements corresponding to actual errors/warnings produced from ClangHLSLTests.
     The new file will be located in %TEMP%, named after the original file, but with
     The new file will be located in %TEMP%, named after the original file, but with
     the added extension '.result'.
     the added extension '.result'.
     This can then be compared with the original file (such as varmods-syntax.hlsl)
     This can then be compared with the original file (such as varmods-syntax.hlsl)
@@ -20,14 +20,14 @@ r"""VerifierHelper.py - help with test content used with:
     a line containing only: "/*verify-ast", and insert a stripped subtree between this marker
     a line containing only: "/*verify-ast", and insert a stripped subtree between this marker
     and a line containing only: "*/".  This relies on clang.exe in the build directory.
     and a line containing only: "*/".  This relies on clang.exe in the build directory.
 
 
-    This tool expects clang.exe and clang-hlsl-tests.dll to be in %HLSL_BLD_DIR%\bin\Debug.
+    This tool expects clang.exe and ClangHLSLTests.dll to be in %HLSL_BLD_DIR%\bin\Debug.
 
 
 Usage:
 Usage:
-    VerifierHelper.py clang <testname>  - run test through clang-hlsl-tests and show differences
+    VerifierHelper.py clang <testname>  - run test through ClangHLSLTests and show differences
     VerifierHelper.py fxc <testname>    - run test through fxc and show differences
     VerifierHelper.py fxc <testname>    - run test through fxc and show differences
     VerifierHelper.py ast <testname>    - run test through ast-dump and show differences
     VerifierHelper.py ast <testname>    - run test through ast-dump and show differences
-    VerifierHelper.py all <testname>    - run test through clang-hlsl-tests, ast-dump, and fxc, then show differences
-<testname> - name of verifier test as passed to "te clang-hlsl-tests.dll /name:VerifierTest::<testname>":
+    VerifierHelper.py all <testname>    - run test through ClangHLSLTests, ast-dump, and fxc, then show differences
+<testname> - name of verifier test as passed to "te ClangHLSLTests.dll /name:VerifierTest::<testname>":
     Example: RunVarmodsSyntax
     Example: RunVarmodsSyntax
     Can also specify * to run all tests
     Can also specify * to run all tests
 
 
@@ -745,7 +745,7 @@ def PrintUsage():
 def RunVerifierTest(test, HlslDataDir=HlslDataDir):
 def RunVerifierTest(test, HlslDataDir=HlslDataDir):
     import codecs
     import codecs
     temp_filename = os.path.expandvars(r'${TEMP}\VerifierHelper_temp.txt')
     temp_filename = os.path.expandvars(r'${TEMP}\VerifierHelper_temp.txt')
-    cmd = ('te %s\\clang-hlsl-tests.dll /p:"HlslDataDir=%s" /name:VerifierTest::%s > %s' %
+    cmd = ('te %s\\ClangHLSLTests.dll /p:"HlslDataDir=%s" /name:VerifierTest::%s > %s' %
            (HlslBinDir, HlslDataDir, test, temp_filename))
            (HlslBinDir, HlslDataDir, test, temp_filename))
     print(cmd)
     print(cmd)
     os.system(cmd)      # TAEF test
     os.system(cmd)      # TAEF test

+ 1 - 1
utils/hct/hctdeploytest.cmd

@@ -40,7 +40,7 @@ echo =========================================================================
 echo Provided there were no errors above, the test can now be run from
 echo Provided there were no errors above, the test can now be run from
 echo the target directory with:
 echo the target directory with:
 echo.
 echo.
-echo taef\amd64\te test\clang-hlsl-tests.dll /p:"HlslDataDir=HLSL" [options]
+echo taef\amd64\te test\ClangHLSLTests.dll /p:"HlslDataDir=HLSL" [options]
 echo.
 echo.
 echo You may need to deploy VS runtime libraries in order to run the unit tests.
 echo You may need to deploy VS runtime libraries in order to run the unit tests.
 echo Debug versions of these will be required for the Debug build configuration.
 echo Debug versions of these will be required for the Debug build configuration.

+ 6 - 6
utils/hct/hcttest.cmd

@@ -304,7 +304,7 @@ if not exist %TEST_DIR% (mkdir %TEST_DIR%)
 echo Copying binaries to test to %TEST_DIR%:
 echo Copying binaries to test to %TEST_DIR%:
 if "%CUSTOM_BIN_SET%"=="" (
 if "%CUSTOM_BIN_SET%"=="" (
   if not "%TEST_USE_LIT%"=="1" (
   if not "%TEST_USE_LIT%"=="1" (
-    call %HCT_DIR%\hctcopy.cmd %BIN_DIR% %TEST_DIR% clang-hlsl-tests.dll exec-hlsl-tests.dll
+    call %HCT_DIR%\hctcopy.cmd %BIN_DIR% %TEST_DIR% ClangHLSLTests.dll ExecHLSLTests.dll
   )
   )
   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
   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
   if errorlevel 1 exit /b 1
   if errorlevel 1 exit /b 1
@@ -368,7 +368,7 @@ if "%TEST_CLANG%"=="1" (
     set SELECT_FILTER= /select:"@Name='%TEST_CLANG_FILTER%' AND @Architecture='%TEST_ARCH%'"
     set SELECT_FILTER= /select:"@Name='%TEST_CLANG_FILTER%' AND @Architecture='%TEST_ARCH%'"
   )
   )
 
 
-  call :runte clang-hlsl-tests.dll /p:"HlslDataDir=%HLSL_SRC_DIR%\tools\clang\test\HLSL" !SELECT_FILTER! %ADDITIONAL_OPTS%
+  call :runte ClangHLSLTests.dll /p:"HlslDataDir=%HLSL_SRC_DIR%\tools\clang\test\HLSL" !SELECT_FILTER! %ADDITIONAL_OPTS%
   set RES_CLANG=!ERRORLEVEL!
   set RES_CLANG=!ERRORLEVEL!
 )
 )
 
 
@@ -385,7 +385,7 @@ if "%TEST_EXEC%"=="1" (
 set EXEC_COMMON_ARGS=/p:"HlslDataDir=%HLSL_SRC_DIR%\tools\clang\unittests\HLSLExec" /p:"ExperimentalShaders=*" %TEST_ADAPTER% %USE_AGILITY_SDK%
 set EXEC_COMMON_ARGS=/p:"HlslDataDir=%HLSL_SRC_DIR%\tools\clang\unittests\HLSLExec" /p:"ExperimentalShaders=*" %TEST_ADAPTER% %USE_AGILITY_SDK%
 if "%TEST_EXEC%"=="1" (
 if "%TEST_EXEC%"=="1" (
   echo Sniffing for D3D12 configuration ...
   echo Sniffing for D3D12 configuration ...
-  call :runte exec-hlsl-tests.dll /select:"@Name='ExecutionTest::BasicTriangleTest' AND @Architecture='%TEST_ARCH%'" %EXEC_COMMON_ARGS%
+  call :runte ExecHLSLTests.dll /select:"@Name='ExecutionTest::BasicTriangleTest' AND @Architecture='%TEST_ARCH%'" %EXEC_COMMON_ARGS%
   set RES_EXEC=!ERRORLEVEL!
   set RES_EXEC=!ERRORLEVEL!
   if errorlevel 1 (
   if errorlevel 1 (
     if not "%TEST_EXEC_REQUIRED%"=="1" (
     if not "%TEST_EXEC_REQUIRED%"=="1" (
@@ -404,7 +404,7 @@ if "%TEST_EXEC%"=="1" (
   ) else (
   ) else (
     set SELECT_FILTER= /select:"@Name='%TEST_EXEC_FILTER%' AND @Priority<2 AND @Architecture='%TEST_ARCH%'"
     set SELECT_FILTER= /select:"@Name='%TEST_EXEC_FILTER%' AND @Priority<2 AND @Architecture='%TEST_ARCH%'"
   )
   )
-  call :runte exec-hlsl-tests.dll !SELECT_FILTER! %EXEC_COMMON_ARGS% %ADDITIONAL_OPTS%
+  call :runte ExecHLSLTests.dll !SELECT_FILTER! %EXEC_COMMON_ARGS% %ADDITIONAL_OPTS%
   set RES_EXEC=!ERRORLEVEL!
   set RES_EXEC=!ERRORLEVEL!
 )
 )
 
 
@@ -433,7 +433,7 @@ if exist "%HCT_EXTRAS%\hcttest-after.cmd" (
 )
 )
 
 
 if "%TEST_MANUAL_FILE_CHECK%"=="1" (
 if "%TEST_MANUAL_FILE_CHECK%"=="1" (
-  call :runte clang-hlsl-tests.dll /p:"HlslDataDir=%HLSL_SRC_DIR%\tools\clang\test\HLSL" /name:CompilerTest::ManualFileCheckTest /runIgnoredTests /p:"InputPath=%MANUAL_FILE_CHECK_PATH%"
+  call :runte ClangHLSLTests.dll /p:"HlslDataDir=%HLSL_SRC_DIR%\tools\clang\test\HLSL" /name:CompilerTest::ManualFileCheckTest /runIgnoredTests /p:"InputPath=%MANUAL_FILE_CHECK_PATH%"
   set RES_EXEC=!ERRORLEVEL!
   set RES_EXEC=!ERRORLEVEL!
 )
 )
 
 
@@ -519,7 +519,7 @@ echo.
 echo Delete test directory and do not copy binaries or run tests:
 echo Delete test directory and do not copy binaries or run tests:
 echo   hcttest clean
 echo   hcttest clean
 echo.
 echo.
-call :showtesample clang-hlsl-tests.dll /p:"HlslDataDir=%HLSL_SRC_DIR%\tools\clang\test\HLSL"
+call :showtesample ClangHLSLTests.dll /p:"HlslDataDir=%HLSL_SRC_DIR%\tools\clang\test\HLSL"
 
 
 goto :eof
 goto :eof
 
 

+ 1 - 1
utils/lit/lit/formats/taef.py

@@ -59,7 +59,7 @@ class TaefTest(TestFormat):
           localConfig: TestingConfig instance"""
           localConfig: TestingConfig instance"""
 
 
         # TE:F:\repos\DxcGitHub\hlsl.bin\TAEF\x64\te.exe
         # TE:F:\repos\DxcGitHub\hlsl.bin\TAEF\x64\te.exe
-        # test dll : F:\repos\DxcGitHub\hlsl.bin\Debug\test\clang-hlsl-tests.dll
+        # test dll : F:\repos\DxcGitHub\hlsl.bin\Debug\test\ClangHLSLTests.dll
         # /list
         # /list
 
 
         if litConfig.debug:
         if litConfig.debug: