HLSLTestOptions.cpp 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //===- unittests/HLSL/HLSLTestOptions.cpp ----- Test Options Init -------===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is distributed under the University of Illinois Open Source
  6. // License. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. //
  10. // This file defines and initializes command line options that can be passed to
  11. // HLSL gtests.
  12. //
  13. //===----------------------------------------------------------------------===//
  14. #include "HLSLTestOptions.h"
  15. #include "dxc/Test/WEXAdapter.h"
  16. #include "dxc/Support/WinAdapter.h"
  17. namespace clang {
  18. namespace hlsl {
  19. namespace testOptions {
  20. #define ARG_DEFINE(argname) std::string argname = "";
  21. ARG_LIST(ARG_DEFINE)
  22. } // namespace testOptions
  23. } // namespace hlsl
  24. } // namespace clang
  25. namespace WEX {
  26. namespace TestExecution {
  27. namespace RuntimeParameters {
  28. HRESULT TryGetValue(const wchar_t *param, WEX::Common::String &retStr) {
  29. #define RETURN_ARG(argname) \
  30. if (wcscmp(param, L## #argname) == 0) { \
  31. if (!clang::hlsl::testOptions::argname.empty()) { \
  32. retStr.assign(CA2W(clang::hlsl::testOptions::argname.c_str()).m_psz); \
  33. return S_OK; \
  34. } else \
  35. return E_FAIL; \
  36. }
  37. ARG_LIST(RETURN_ARG)
  38. return E_NOTIMPL;
  39. }
  40. } // namespace RuntimeParameters
  41. } // namespace TestExecution
  42. } // namespace WEX