Skip to content

Commit b6c1914

Browse files
[Validation] Make Validation tests more robust (microsoft#7848)
This PR just addresses some final concerns in microsoft#7749 It also adds a missing REQUIRES line that should've been added to a test that merged into the repo while the previous PR was in development. --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 715dacc commit b6c1914

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

lib/DxcSupport/dxcapi.extval.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ class ExternalValidationCompiler : public IDxcCompiler2, public IDxcCompiler3 {
319319
template <typename T> CComPtr<T> cast() const {
320320
CComPtr<T> Result;
321321
if (Compiler)
322-
Compiler->QueryInterface(__uuidof(T), reinterpret_cast<void **>(&Result));
322+
Compiler.QueryInterface(&Result);
323323
assert(Result);
324324
return Result;
325325
}

tools/clang/test/CodeGenDXIL/hlsl/intrinsics/asuint-constant-eval.hlsl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// REQUIRES: dxil-1-9
12
// RUN: %dxc /T ps_6_9 -fcgl %s | FileCheck %s
23

34
// Compiling this HLSL would fail this assertion in IntExprEvaluator::Success:

tools/clang/unittests/HLSL/ValidationTest.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4274,8 +4274,8 @@ TEST_F(ValidationTest, UnitTestExtValidationSupport) {
42744274
VERIFY_ARE_EQUAL_STR(BogusPath.c_str(), "bogus");
42754275
VERIFY_IS_TRUE(ExtSupportBogus.dxilDllFailedToLoad());
42764276

4277-
// 3. Test with a valid path to this file in the environment variable
4278-
std::filesystem::path p = std::filesystem::absolute(__FILE__);
4277+
// 3. Test with a valid path to a file in the environment variable
4278+
std::filesystem::path p = hlsl_test::GetPathToHlslDataFile(L"lit.local.cfg");
42794279
SetEnvVarW(L"DXC_DXIL_DLL_PATH", p.wstring());
42804280

42814281
if (!ExtSupportValidNonDLLPath.IsEnabled()) {
@@ -4287,7 +4287,10 @@ TEST_F(ValidationTest, UnitTestExtValidationSupport) {
42874287
// validate that ExtSupportValidNonDLLPath was able to capture the environment
42884288
// variable's value, and that loading the valid non-dll path was unsuccessful
42894289
std::string ValidNonDLLPath = ExtSupportValidNonDLLPath.getDxilDllPath();
4290-
VERIFY_ARE_EQUAL_STR(ValidNonDLLPath.c_str(), __FILE__);
4290+
std::string FilePath;
4291+
Unicode::WideToUTF8String(
4292+
hlsl_test::GetPathToHlslDataFile(L"lit.local.cfg").c_str(), &FilePath);
4293+
VERIFY_ARE_EQUAL_STR(ValidNonDLLPath.c_str(), FilePath.c_str());
42914294
VERIFY_IS_TRUE(ExtSupportValidNonDLLPath.dxilDllFailedToLoad());
42924295

42934296
// 4. Test production of class IDs CLSID_DxcCompiler, CLSID_DxcLinker,

0 commit comments

Comments
 (0)