Change the CTest working directory to tests/#457
Merged
IvanaGyro merged 11 commits intodev-masterfrom Aug 31, 2024
Merged
Conversation
The temporary filenames are generated randomly, which reduces the likelihood of conflicts when multiple testing tasks are running concurrently.
Including CTest explicitly suppresses the error that DartConfiguration.tcl is not found. References: - https://stackoverflow.com/questions/49676389/cmake-doesnt-create-the-dartconfiguration-tcl - https://cmake.org/pipermail/cmake/2015-January/059742.html
The `gtest_discover_tests()` command in CMake defaults to using relative paths based on the build directory when running the tests. This can cause issues if developers build multiple versions of the project, for example with different configuration flags, as the tests will fail to locate the test files correctly. To decouple the build process from the test execution, this commit sets the working directory for CTest to the tests/ subdirectory. By doing so, the relative paths used by the discovered tests will correctly resolve to the test files, regardless of the build directory structure or configuration used.
The correct property name should be `DISCOVERY_TIMEOUT`, and it seems that passing the value with the `PROPERTY` keyword doesn't take effects. The default timeout for finding the tests is 5 seconds. This should be long enough.
Fix `DenseUniTensorTest.arange_step_error`.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev-master #457 +/- ##
==============================================
+ Coverage 16.56% 16.60% +0.04%
==============================================
Files 221 221
Lines 48481 48488 +7
Branches 20264 20272 +8
==============================================
+ Hits 8030 8053 +23
+ Misses 36176 36141 -35
- Partials 4275 4294 +19 ☔ View full report in Codecov by Sentry. |
jeffry1829
approved these changes
Aug 31, 2024
This reverts commit 1be5056.
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.
The main change of this PR is to change the CTest working directory to
tests/, which resolves issue #452.broken tests before and after this PR:
the tests break by #451 (They are not fixed in this PR.):