Enable running tests under LIT#4813
Merged
llvm-beanz merged 2 commits intomicrosoft:mainfrom Nov 30, 2022
Merged
Conversation
If `CLANG_INCLUDE_TESTS=On`, the googletest unit tests are built as part of the clang unit test suite. This allows them to run via lit using the `check-clang-unit` target.
pow2clk
reviewed
Nov 30, 2022
| te = os.path.join(config.llvm_obj_root, "TAEF", config.arch, 'te.exe') | ||
|
|
||
| test_dll = os.path.join(config.llvm_obj_root, config.build_mode, 'bin', 'clang-hlsl-tests.dll') | ||
| test_dll = os.path.join(config.llvm_obj_root, config.build_mode, 'bin', 'ClangHLSLTests.dll') |
Collaborator
There was a problem hiding this comment.
Out of belated curiosity, why the rename?
It looks like the previous DLL is still referenced by HLSLHost.cpp and a few powershell and cmd files. Less important, but possibly worth it for consistency, the gtest executable equivalent is named clang-hlsl-tests to keep with the previous naming convention.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If
CLANG_INCLUDE_TESTS=On, the googletest unit tests are built as part of the clang unit test suite. This allows them to run via lit using thecheck-clang-unittarget.This change requires renaming the test binaries to match LLVM conventions. This binary renaming only occurs if
CLANG_INCLUDE_TESTS=On, so existing workflows are unimpacted. To keep things consistent all the test targets are renamed to match LLVM conventions regardless of whether or not the option is enabled.With this workflow enabled
check-clang-unitruns all the HLSL & SPIR-V googletest tests and a handful of Clang unit tests that I had previously fixed. Additionally due to lit's more aggressive parallelization, the tests run almost 2x as fast despite running more tests. Win-win-win.check-clang-unitworks on both Linux and Windows, andcheck-clang-taefworks on Windows as well.