Skip to content

Enable running tests under LIT#4813

Merged
llvm-beanz merged 2 commits intomicrosoft:mainfrom
llvm-beanz:cbieneman/linux-lit-tests
Nov 30, 2022
Merged

Enable running tests under LIT#4813
llvm-beanz merged 2 commits intomicrosoft:mainfrom
llvm-beanz:cbieneman/linux-lit-tests

Conversation

@llvm-beanz
Copy link
Copy Markdown
Collaborator

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.

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-unit runs 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-unit works on both Linux and Windows, and check-clang-taef works on Windows as well.

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.
@AppVeyorBot
Copy link
Copy Markdown

@llvm-beanz llvm-beanz requested a review from hekota November 29, 2022 20:40
Copy link
Copy Markdown
Member

@hekota hekota left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@AppVeyorBot
Copy link
Copy Markdown

@llvm-beanz llvm-beanz merged commit 7d9567c into microsoft:main 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')
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants