Skip to content

[Bazel] Remove redundant gtest_main from codegen_tests, codegen_globalisel_tests, mi_tests #135316

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 18, 2025

Conversation

HighW4y2H3ll
Copy link
Member

For codegen_tests, codegen_globalisel_tests and mi_tests, they already have their own main function defined, so there should be no need to add gtest_main dependency for the main function...

@llvmbot llvmbot added the bazel "Peripheral" support tier build system: utils/bazel label Apr 11, 2025
@HighW4y2H3ll
Copy link
Member Author

ping @rupprecht @keith @aaronmondal Could you double check on this? Because there seem to have two main functions with the gtest_main deps. Thx!

Copy link
Member

@keith keith left a comment

Choose a reason for hiding this comment

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

Lgtm. Seems like maybe these tests should toss the main and move initLLVM into a test setup function

@HighW4y2H3ll
Copy link
Member Author

Thx!! honestly... I'm not too sure how how these tests work with the CMakeLists builds... so just trying to be safe here, and hopefully not breaking things. :p

@HighW4y2H3ll HighW4y2H3ll merged commit ba273be into llvm:main Apr 18, 2025
11 checks passed
@HighW4y2H3ll HighW4y2H3ll deleted the fix-bazel-unittest branch April 18, 2025 17:48
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
…lisel_tests, mi_tests (llvm#135316)

For codegen_tests, codegen_globalisel_tests and mi_tests, they already
have their own `main` function defined, so there should be no need to
add `gtest_main` dependency for the main function...

- codegen_tests:
https://github.com/llvm/llvm-project/blob/main/llvm/unittests/CodeGen/TargetOptionsTest.cpp#L73
- codegen_globalisel_tests:
https://github.com/llvm/llvm-project/blob/main/llvm/unittests/CodeGen/GlobalISel/PatternMatchTest.cpp#L978
- mi_tests:
https://github.com/llvm/llvm-project/blob/main/llvm/unittests/MI/LiveIntervalTest.cpp#L933
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
…lisel_tests, mi_tests (llvm#135316)

For codegen_tests, codegen_globalisel_tests and mi_tests, they already
have their own `main` function defined, so there should be no need to
add `gtest_main` dependency for the main function...

- codegen_tests:
https://github.com/llvm/llvm-project/blob/main/llvm/unittests/CodeGen/TargetOptionsTest.cpp#L73
- codegen_globalisel_tests:
https://github.com/llvm/llvm-project/blob/main/llvm/unittests/CodeGen/GlobalISel/PatternMatchTest.cpp#L978
- mi_tests:
https://github.com/llvm/llvm-project/blob/main/llvm/unittests/MI/LiveIntervalTest.cpp#L933
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
…lisel_tests, mi_tests (llvm#135316)

For codegen_tests, codegen_globalisel_tests and mi_tests, they already
have their own `main` function defined, so there should be no need to
add `gtest_main` dependency for the main function...

- codegen_tests:
https://github.com/llvm/llvm-project/blob/main/llvm/unittests/CodeGen/TargetOptionsTest.cpp#L73
- codegen_globalisel_tests:
https://github.com/llvm/llvm-project/blob/main/llvm/unittests/CodeGen/GlobalISel/PatternMatchTest.cpp#L978
- mi_tests:
https://github.com/llvm/llvm-project/blob/main/llvm/unittests/MI/LiveIntervalTest.cpp#L933
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bazel "Peripheral" support tier build system: utils/bazel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants