|
@@ -4,6 +4,7 @@
|
|
|
|
|
|
import os
|
|
|
import platform
|
|
|
+import subprocess
|
|
|
|
|
|
import lit.formats
|
|
|
import lit.util
|
|
@@ -24,45 +25,59 @@ if te is None:
|
|
|
if site_cfg and os.path.exists(site_cfg):
|
|
|
lit_config.load_config(config, site_cfg)
|
|
|
raise SystemExit
|
|
|
-
|
|
|
-# TAEF only runs on Windows
|
|
|
-if platform.system() != 'Windows':
|
|
|
+bin_dir = os.path.join(config.llvm_obj_root, config.llvm_build_mode, 'bin')
|
|
|
+skip_taef_exec = lit_config.params.get('skip_taef_exec', None)
|
|
|
+if skip_taef_exec or platform.system() != 'Windows':
|
|
|
config.unsupported = True
|
|
|
else:
|
|
|
- test_dll = os.path.join(config.llvm_obj_root, config.llvm_build_mode, 'bin', 'ExecHLSLTests.dll')
|
|
|
+ dxil_dll = os.path.join(bin_dir, 'dxil.dll')
|
|
|
+ if os.path.isfile(dxil_dll):
|
|
|
+ print(str.format("\nUsed {} as validator\n", dxil_dll))
|
|
|
+ else:
|
|
|
+ print(str.format("\nCannot find validator in {}\n", bin_dir))
|
|
|
+ dxexp = os.path.join(bin_dir, 'dxexp.exe')
|
|
|
+ result = subprocess.run([dxexp], capture_output=True)
|
|
|
+ no_experimental = "Experimental shader model feature failed"
|
|
|
+ out = lit.util.convert_string(result.stdout)
|
|
|
+ if no_experimental in out:
|
|
|
+ print("""Developer mode is not enabled in Windows settings, preventing the experimental shader models feature.
|
|
|
+Execution tests require DXIL.dll to sign shaders, or the experimental shader models feature to run unsigned shaders.""")
|
|
|
+ config.unsupported = True
|
|
|
+
|
|
|
+if config.unsupported == False:
|
|
|
+ test_dll = os.path.join(bin_dir, 'ExecHLSLTests.dll')
|
|
|
|
|
|
hlsl_data_dir = os.path.join(config.llvm_src_root, 'tools', 'clang', 'unittests', 'HLSLExec')
|
|
|
|
|
|
test_dir = os.path.join(config.llvm_obj_root, config.llvm_build_mode, 'test')
|
|
|
- param_hlsl_data_dir = str.format('/p:HlslDataDir={}', hlsl_data_dir)
|
|
|
+ param_hlsl_data_dir = str.format('/p:"HlslDataDir={}"', hlsl_data_dir)
|
|
|
|
|
|
- extra_params = ["/p:\"ExperimentalShaders=*\"", param_hlsl_data_dir]
|
|
|
+ extra_params = ['/p:"ExperimentalShaders=*\"', param_hlsl_data_dir]
|
|
|
|
|
|
verbose = lit_config.params.get('verbose', None)
|
|
|
if verbose == None:
|
|
|
- extra_params.append('/logOutput:LowWithConsoleBuffering')
|
|
|
-
|
|
|
- arch = getattr(config, 'taef_arch', None)
|
|
|
- arch_filter = str.format("@Architecture='{}'", arch)
|
|
|
- priority_filter = "@Priority<2"
|
|
|
- exec_future = lit_config.params.get('exec_future', None)
|
|
|
- if exec_future:
|
|
|
- priority_filter = "@Priority=2"
|
|
|
-
|
|
|
- select_filter = str.format("/select:\"{} AND {}\"", priority_filter, arch_filter)
|
|
|
- extra_params.append(select_filter)
|
|
|
+ extra_params.append('/logOutput:"LowWithConsoleBuffering"')
|
|
|
|
|
|
adapter = lit_config.params.get('adapter', None)
|
|
|
if adapter:
|
|
|
- extra_params.append(str.format("/p:Adapter={}", adapter))
|
|
|
+ extra_params.append(str.format('/p:"Adapter={}"', adapter))
|
|
|
|
|
|
agility_sdk = lit_config.params.get('agility_sdk', None)
|
|
|
if agility_sdk:
|
|
|
- extra_params.append("/p:D3D12SDKVersion=1")
|
|
|
+ extra_params.append('/p:"D3D12SDKVersion=1"')
|
|
|
|
|
|
# use ';' to split multiple params.
|
|
|
taef_extra_params = lit_config.params.get('taef_exec_extra_params', None)
|
|
|
if taef_extra_params:
|
|
|
- extra_params.extend(taef_extra_params.split(';'))
|
|
|
+ extra_params.extend(taef_extra_params.split(';'))
|
|
|
+
|
|
|
+ arch = getattr(config, 'taef_arch', None)
|
|
|
+ arch_filter = str.format("@Architecture='{}'", arch)
|
|
|
+ priority_filter = "@Priority<2"
|
|
|
+ exec_future = lit_config.params.get('exec_future', None)
|
|
|
+ if exec_future:
|
|
|
+ priority_filter = "@Priority=2"
|
|
|
+
|
|
|
+ select_filter = str.format("{} AND {}", priority_filter, arch_filter)
|
|
|
|
|
|
- config.test_format = lit.formats.TaefTest(config.te, test_dll, test_dir, extra_params)
|
|
|
+ config.test_format = lit.formats.TaefTest(config.te, test_dll, test_dir, select_filter, extra_params)
|