Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions include/dxc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ include(HCT)

add_hlsl_hctgen(HLSLIntrinsicOp OUTPUT HlslIntrinsicOp.h)

set(HLSL_TEST_DATA_DIR ${LLVM_SOURCE_DIR}/tools/clang/test/HLSL/)

configure_file(
${LLVM_MAIN_INCLUDE_DIR}/dxc/Test/TestConfig.h.in
${LLVM_INCLUDE_DIR}/dxc/Test/TestConfig.h
)

add_subdirectory(DXIL)
add_subdirectory(DxilContainer)
add_subdirectory(HLSL)
Expand Down
4 changes: 3 additions & 1 deletion include/dxc/Test/HlslTestUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "WEXAdapter.h"
#endif
#include "dxc/Support/Unicode.h"
#include "dxc/Test/TestConfig.h"
#include "dxc/DXIL/DxilConstants.h" // DenormMode

using namespace std;
Expand Down Expand Up @@ -212,7 +213,8 @@ inline std::wstring GetPathToHlslDataFile(const wchar_t* relative, LPCWSTR param
if (FAILED(WEX::TestExecution::RuntimeParameters::TryGetValue(paramName, HlslDataDirValue)))
return std::wstring();
} else {
ASSERT_HRESULT_SUCCEEDED(WEX::TestExecution::RuntimeParameters::TryGetValue(HLSLDATAFILEPARAM, HlslDataDirValue));
if (FAILED(WEX::TestExecution::RuntimeParameters::TryGetValue(HLSLDATAFILEPARAM, HlslDataDirValue)))
HlslDataDirValue = DEFAULT_TEST_DIR;
}

wchar_t envPath[MAX_PATH];
Expand Down
1 change: 1 addition & 0 deletions include/dxc/Test/TestConfig.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#define DEFAULT_TEST_DIR L"@HLSL_TEST_DATA_DIR@"
2 changes: 2 additions & 0 deletions include/dxc/Test/WEXAdapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ namespace WEX {
namespace Common {
class String : public std::wstring {
public:
String() = default;
String(const wchar_t *S) : std::wstring(S) {}
size_t GetLength() { return length(); }
bool IsEmpty() { return empty(); }
int CompareNoCase(std::wstring str) const {
Expand Down