From 86e11e0e111fab60b9517056ac049bfac6e3bd25 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 16 Jan 2019 13:31:42 -0500 Subject: Feature/external compiler reporting (#776) * Added support for converting SlangResult to string in PlatformUtil. * * Added reportExternalCompilerError * Made external compilers use this * Made DiagnosticSink accept UnownedStringSlice * Made emitXXX compiler functions return SlangError * Use smart pointers to handle life of Com interfaces * * Make SlangResult compatible with HRESULT for some common cases. * Make PlatformUtil::appendResult return SlangResult * Compile check SLANG_RESULT. * Add tests for checking diagnostics from external compilers. * * Make external compiler tests only run on windows for now. * Added 'windows' and 'unix' categories * Added categories based on what backends are available. Will make more tests run on linux and handle case where dxcompiler is not available on appveyor. * * Added spSessionCheckPassThroughSupport * Use to determine whats available for categories for tests * Add support for outputting source filename/s when using pass through. --- tools/slang-test/slang-test-main.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'tools') diff --git a/tools/slang-test/slang-test-main.cpp b/tools/slang-test/slang-test-main.cpp index 1f6b4cdb0..9039dbf2b 100644 --- a/tools/slang-test/slang-test-main.cpp +++ b/tools/slang-test/slang-test-main.cpp @@ -1791,6 +1791,36 @@ SlangResult innerMain(int argc, char** argv) auto vulkanTestCategory = categorySet.add("vulkan", fullTestCategory); auto unitTestCatagory = categorySet.add("unit-test", fullTestCategory); auto compatibilityIssueCatagory = categorySet.add("compatibility-issue", fullTestCategory); + +#if SLANG_WINDOWS_FAMILY + auto windowsCatagory = categorySet.add("windows", fullTestCategory); +#endif + +#if SLANG_UNIX_FAMILY + auto unixCatagory = categorySet.add("unix", fullTestCategory); +#endif + + TestCategory* fxcCategory = nullptr; + TestCategory* dxcCategory = nullptr; + TestCategory* glslangCategory = nullptr; + + // Might be better if we had an API on slang so we could get what 'pass-through's are available + // This works whilst these targets imply the pass-through/backends + { + SlangSession* session = context.getSession(); + if (SLANG_SUCCEEDED(spSessionCheckPassThroughSupport(session, SLANG_PASS_THROUGH_FXC))) + { + fxcCategory = categorySet.add("fxc", fullTestCategory); + } + if (SLANG_SUCCEEDED(spSessionCheckPassThroughSupport(session, SLANG_PASS_THROUGH_GLSLANG))) + { + glslangCategory = categorySet.add("glslang", fullTestCategory); + } + if (SLANG_SUCCEEDED(spSessionCheckPassThroughSupport(session, SLANG_PASS_THROUGH_DXC))) + { + dxcCategory = categorySet.add("dxc", fullTestCategory); + } + } // An un-categorized test will always belong to the `full` category categorySet.defaultCategory = fullTestCategory; -- cgit v1.2.3