Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2/catch_test_case_info.cpp
diff options
context:
space:
mode:
authorMartin Hořeňovský2020-05-25 09:45:24 +0200
committerMartin Hořeňovský2020-05-31 15:20:24 +0200
commit1d1ccf8f3c0c9e121b16afd4fafb850d14ef9fb0 (patch)
tree0a292cf929c75743993d42453312e08888ef7c0a /src/catch2/catch_test_case_info.cpp
parent41bbaa6d573a598fe0796fd0e391ed57eae62e30 (diff)
downloadcatch3-1d1ccf8f3c0c9e121b16afd4fafb850d14ef9fb0.tar.gz
Replace all uses of std::unique_ptr with Catch::Detail::unique_ptr
Doing some benchmarking with ClangBuildAnalyzer suggests that compiling Catch2's `SelfTest` spends 10% of the time instantiating `std::unique_ptr` for some interface types required for registering and running tests. The lesser compilation overhead of `Catch::Detail::unique_ptr` should significantly reduce that time. The compiled implementation was also changed to use the custom impl, to avoid having to convert between using `std::unique_ptr` and `Catch::Detail::unique_ptr`. This will likely also improve the compile times of the implementation, but that is less important than improving compilation times of the user's TUs with tests.
Diffstat (limited to 'src/catch2/catch_test_case_info.cpp')
-rw-r--r--src/catch2/catch_test_case_info.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/catch2/catch_test_case_info.cpp b/src/catch2/catch_test_case_info.cpp
index 7be5b861..a4bcb11c 100644
--- a/src/catch2/catch_test_case_info.cpp
+++ b/src/catch2/catch_test_case_info.cpp
@@ -105,11 +105,11 @@ namespace Catch {
}
}
- std::unique_ptr<TestCaseInfo>
+ Detail::unique_ptr<TestCaseInfo>
makeTestCaseInfo(std::string const& _className,
NameAndTags const& nameAndTags,
SourceLineInfo const& _lineInfo ) {
- return std::make_unique<TestCaseInfo>(_className, nameAndTags, _lineInfo);
+ return Detail::unique_ptr<TestCaseInfo>(new TestCaseInfo(_className, nameAndTags, _lineInfo));
}
TestCaseInfo::TestCaseInfo(std::string const& _className,