/src/CMake/Source/cmTestPropertyHelper.cxx
Line | Count | Source |
1 | | /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying |
2 | | file LICENSE.rst or https://cmake.org/licensing for details. */ |
3 | | #include "cmTestPropertyHelper.h" |
4 | | |
5 | | #include "cmExecutionStatus.h" |
6 | | #include "cmMakefile.h" |
7 | | #include "cmSetPropertyCommand.h" |
8 | | #include "cmTest.h" |
9 | | #include "cmValue.h" |
10 | | |
11 | | cmGetTestPropertyResult cmGetTestProperty(std::string const& testName, |
12 | | std::string const& propertyName, |
13 | | cmExecutionStatus& status, |
14 | | bool testDirectoryOptionEnabled, |
15 | | std::string& testDirectory, |
16 | | cmValue& propertyValue) |
17 | 0 | { |
18 | 0 | cmMakefile* testDirectoryMakefile = &status.GetMakefile(); |
19 | 0 | if (!SetPropertyCommand::HandleAndValidateTestDirectoryScopes( |
20 | 0 | status, testDirectoryOptionEnabled, testDirectory, |
21 | 0 | testDirectoryMakefile)) { |
22 | 0 | return cmGetTestPropertyResult::ScopeError; |
23 | 0 | } |
24 | | |
25 | 0 | cmTest* test = testDirectoryMakefile->GetTest(testName); |
26 | 0 | if (!test) { |
27 | 0 | return cmGetTestPropertyResult::TestNotFound; |
28 | 0 | } |
29 | | |
30 | 0 | propertyValue = test->GetProperty(propertyName); |
31 | 0 | return cmGetTestPropertyResult::Success; |
32 | 0 | } |