| 1 | // SPDX-License-Identifier: GPL-3.0-or-latercxx . . $ `<file>/tests/src/test_cpufreq.cpp`/ |
| 2 | // Copyright 2019 Juan Palacios <[email protected]> |
| 3 | |
| 4 | #include <catch2/catch_all.hpp> |
| 5 | #include <catch2/trompeloeil.hpp> |
| 6 | |
| 7 | #include "common/commandqueuestub.h"cxx . . $ `<file>/tests/src/common/commandqueuestub.h`/ |
| 8 | #include "common/stringdatasourcestub.h"cxx . . $ `<file>/tests/src/common/stringdatasourcestub.h`/ |
| 9 | #include "core/components/controls/cpu/cpufreq.h"cxx . . $ `<file>/src/core/components/controls/cpu/cpufreq.h`/ |
| 10 | #include "core/components/controls/cpu/handlers/iepphandler.h"cxx . . $ `<file>/src/core/components/controls/cpu/handlers/iepphandler.h`/ |
| 11 | |
| 12 | extern template struct trompeloeil::reportercxx . . $ trompeloeil/reporter#<trompeloeilcxx . . $ trompeloeil/::specializedcxx . . $ trompeloeil/specialized#>; |
| 13 | |
| 14 | namespace Testscxx . . $ Tests/::CPUFreqcxx . . $ Tests/CPUFreq/ { |
| 15 | |
| 16 | class CPUFreqTestAdaptercxx . . $ Tests/CPUFreq/CPUFreqTestAdapter# : public ::CPUFreqcxx . . $ CPUFreq# |
| 17 | { |
| 18 | public: |
| 19 | using ::CPUFreqcxx . . $ CPUFreq#::CPUFreqcxx . . $ Tests/CPUFreq/CPUFreqTestAdapter#CPUFreqTestAdapter(46e6d37f5dcc783b).; |
| 20 | |
| 21 | using ::CPUFreqcxx . . $ CPUFreq#::cleanControlcxx . . $ Tests/CPUFreq/CPUFreqTestAdapter#cleanControl(151e9138769f295e).; |
| 22 | using ::CPUFreqcxx . . $ CPUFreq#::exportControlcxx . . $ Tests/CPUFreq/CPUFreqTestAdapter#exportControl(40299682ab9c8676).; |
| 23 | using ::CPUFreqcxx . . $ CPUFreq#::importControlcxx . . $ Tests/CPUFreq/CPUFreqTestAdapter#importControl(4f796e3ecd5dcd94).; |
| 24 | using ::CPUFreqcxx . . $ CPUFreq#::scalingGovernorcxx . . $ Tests/CPUFreq/CPUFreqTestAdapter#scalingGovernor(9c546c94e5fcce4e).; |
| 25 | using ::CPUFreqcxx . . $ CPUFreq#::scalingGovernorscxx . . $ Tests/CPUFreq/CPUFreqTestAdapter#scalingGovernors(f5f2959be38ccc08).; |
| 26 | using ::CPUFreqcxx . . $ CPUFreq#::syncControlcxx . . $ Tests/CPUFreq/CPUFreqTestAdapter#syncControl(151e9138769f295e).; |
| 27 | }; |
| 28 | |
| 29 | class CPUFreqImporterStubcxx . . $ Tests/CPUFreq/CPUFreqImporterStub# : public ::CPUFreqcxx . . $ CPUFreq#::Importercxx . . $ CPUFreq#Importer# |
| 30 | { |
| 31 | public: |
| 32 | CPUFreqImporterStubcxx . . $ Tests/CPUFreq/CPUFreqImporterStub#CPUFreqImporterStub(cbc285e2492b6694).(stdcxx . . $ std/::string_viewcxx . . $ std/string_view# scalingGovernor, |
| 33 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<stdcxx . . $ std/::stringcxx . . $ std/string#> eppHint = stdcxx . . $ std/optional#optional(eb2253fdec8870b5).::nulloptcxx . . $ std/nullopt.) |
| 34 | : scalingGovernor_cxx . . $ Tests/CPUFreq/CPUFreqImporterStub#scalingGovernor_.(scalingGovernor) |
| 35 | , eppHint_cxx . . $ Tests/CPUFreq/CPUFreqImporterStub#eppHint_.(eppHint) |
| 36 | { |
| 37 | } |
| 38 | |
| 39 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<stdcxx . . $ std/::reference_wrappercxx . . $ std/reference_wrapper#<Importablecxx . . $ Importable#::Importercxx . . $ Importable#Importer#>> |
| 40 | provideImportercxx . . $ Tests/CPUFreq/CPUFreqImporterStub#provideImporter(c13a3bcac0db4745).(Itemcxx . . $ Item# const &) override |
| 41 | { |
| 42 | return {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 43 | } |
| 44 | |
| 45 | bool provideActivecxx . . $ Tests/CPUFreq/CPUFreqImporterStub#provideActive(50ce9a9e25b4a850).() const override |
| 46 | { |
| 47 | return false; |
| 48 | } |
| 49 | |
| 50 | stdcxx . . $ std/::stringcxx . . $ std/string# const &provideCPUFreqScalingGovernorcxx . . $ Tests/CPUFreq/CPUFreqImporterStub#provideCPUFreqScalingGovernor(f4fff0029955a25f).() const override |
| 51 | { |
| 52 | return scalingGovernor_cxx . . $ Tests/CPUFreq/CPUFreqImporterStub#scalingGovernor_.; |
| 53 | } |
| 54 | |
| 55 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<stdcxx . . $ std/::stringcxx . . $ std/string#> const &provideCPUFreqEPPHintcxx . . $ Tests/CPUFreq/CPUFreqImporterStub#provideCPUFreqEPPHint(f34183478aa9387b).() const override |
| 56 | { |
| 57 | return eppHint_cxx . . $ Tests/CPUFreq/CPUFreqImporterStub#eppHint_.; |
| 58 | } |
| 59 | |
| 60 | private: |
| 61 | stdcxx . . $ std/::stringcxx . . $ std/string# scalingGovernor_cxx . . $ Tests/CPUFreq/CPUFreqImporterStub#scalingGovernor_.; |
| 62 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<stdcxx . . $ std/::stringcxx . . $ std/string#> eppHint_cxx . . $ Tests/CPUFreq/CPUFreqImporterStub#eppHint_.; |
| 63 | }; |
| 64 | |
| 65 | class EPPHandlerMockcxx . . $ Tests/CPUFreq/EPPHandlerMock# : public IEPPHandlercxx . . $ IEPPHandler# |
| 66 | { |
| 67 | public: |
| 68 | MAKE_CONST_MOCK0cxx . . $ `<external>/1068432606165018960/mock.hpp:4240:9`!(hints, std::vector<std::string> const &(void), override); |
| 69 | MAKE_CONST_MOCK0cxx . . $ `<external>/1068432606165018960/mock.hpp:4240:9`!(hint, std::string const &(), override); |
| 70 | MAKE_MOCK1cxx . . $ `<external>/1068432606165018960/mock.hpp:4223:9`!(hint, void(std::string const &), override); |
| 71 | MAKE_MOCK0cxx . . $ `<external>/1068432606165018960/mock.hpp:4222:9`!(init, void(), override); |
| 72 | MAKE_MOCK0cxx . . $ `<external>/1068432606165018960/mock.hpp:4222:9`!(saveState, void(), override); |
| 73 | MAKE_MOCK1cxx . . $ `<external>/1068432606165018960/mock.hpp:4223:9`!(restoreState, void(ICommandQueue &), override); |
| 74 | MAKE_MOCK1cxx . . $ `<external>/1068432606165018960/mock.hpp:4223:9`!(reset, void(ICommandQueue &), override); |
| 75 | MAKE_MOCK1cxx . . $ `<external>/1068432606165018960/mock.hpp:4223:9`!(sync, void(ICommandQueue &), override); |
| 76 | }; |
| 77 | |
| 78 | class CPUFreqImporterMockcxx . . $ Tests/CPUFreq/CPUFreqImporterMock# : public ::CPUFreqcxx . . $ CPUFreq#::Importercxx . . $ CPUFreq#Importer# |
| 79 | { |
| 80 | public: |
| 81 | MAKE_CONST_MOCK0cxx . . $ `<external>/1068432606165018960/mock.hpp:4240:9`!(provideCPUFreqScalingGovernor, std::string const &(void), |
| 82 | override); |
| 83 | MAKE_CONST_MOCK0cxx . . $ `<external>/1068432606165018960/mock.hpp:4240:9`!(provideCPUFreqEPPHint, |
| 84 | std::optional<std::string> const &(void), override); |
| 85 | MAKE_CONST_MOCK0cxx . . $ `<external>/1068432606165018960/mock.hpp:4240:9`!(provideActive, bool(void), override); |
| 86 | MAKE_MOCK1cxx . . $ `<external>/1068432606165018960/mock.hpp:4223:9`!( |
| 87 | provideImporter, |
| 88 | std::optional<std::reference_wrapper<Importable::Importer>>(Item const &), |
| 89 | override); |
| 90 | }; |
| 91 | |
| 92 | class CPUFreqExporterMockcxx . . $ Tests/CPUFreq/CPUFreqExporterMock# : public ::CPUFreqcxx . . $ CPUFreq#::Exportercxx . . $ CPUFreq#Exporter# |
| 93 | { |
| 94 | public: |
| 95 | MAKE_MOCK1cxx . . $ `<external>/1068432606165018960/mock.hpp:4223:9`!(takeCPUFreqScalingGovernor, void(std::string const &), override); |
| 96 | MAKE_MOCK1cxx . . $ `<external>/1068432606165018960/mock.hpp:4223:9`!(takeCPUFreqScalingGovernors, |
| 97 | void(std::vector<std::string> const &), override); |
| 98 | MAKE_MOCK1cxx . . $ `<external>/1068432606165018960/mock.hpp:4223:9`!(takeCPUFreqEPPHint, void(std::optional<std::string> const &), |
| 99 | override); |
| 100 | MAKE_MOCK1cxx . . $ `<external>/1068432606165018960/mock.hpp:4223:9`!(takeCPUFreqEPPHints, |
| 101 | void(std::optional<std::vector<std::string>> const &), override); |
| 102 | MAKE_MOCK1cxx . . $ `<external>/1068432606165018960/mock.hpp:4223:9`!(takeActive, void(bool), override); |
| 103 | MAKE_MOCK1cxx . . $ `<external>/1068432606165018960/mock.hpp:4223:9`!( |
| 104 | provideExporter, |
| 105 | std::optional<std::reference_wrapper<Exportable::Exporter>>(Item const &), |
| 106 | override); |
| 107 | }; |
| 108 | |
| 109 | TEST_CASEcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:144:11`!("AMD CPUFreq tests", "[CPU][CPUFreq]") |
| 110 | { |
| 111 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> availableGovernorscxx . . $ std/vector#vector(9619226211e5a241).{"performance", "powersave"}; |
| 112 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<IDataSourcecxx . . $ IDataSource#<stdcxx . . $ std/::stringcxx . . $ std/string#>>> scalingGovernorDataSourcescxx . . $ std/vector#vector(49f6e7a06ebc5aa8).; |
| 113 | stdcxx . . $ std/::stringcxx . . $ std/string# defaultGovernorcxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).{"powersave"}; |
| 114 | stdcxx . . $ std/::stringcxx . . $ std/string# const scalingGovernorPathcxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).{"scaling_governor"}; |
| 115 | CommandQueueStubcxx . . $ CommandQueueStub# ctlCmds; |
| 116 | |
| 117 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("Has CPUFreq ID") |
| 118 | { |
| 119 | CPUFreqTestAdaptercxx . . $ Tests/CPUFreq/CPUFreqTestAdapter# ts(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(availableGovernors), defaultGovernor, |
| 120 | stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(scalingGovernorDataSources)); |
| 121 | |
| 122 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(ts.ID() == ::CPUFreq::ItemID); |
| 123 | } |
| 124 | |
| 125 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("Is active by default") |
| 126 | { |
| 127 | CPUFreqTestAdaptercxx . . $ Tests/CPUFreq/CPUFreqTestAdapter# ts(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(availableGovernors), defaultGovernor, |
| 128 | stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(scalingGovernorDataSources)); |
| 129 | |
| 130 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(ts.active()); |
| 131 | } |
| 132 | |
| 133 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("Has defaultGovernor selected by default when is available") |
| 134 | { |
| 135 | CPUFreqTestAdaptercxx . . $ Tests/CPUFreq/CPUFreqTestAdapter# ts(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(availableGovernors), defaultGovernor, |
| 136 | stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(scalingGovernorDataSources)); |
| 137 | |
| 138 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(ts.scalingGovernor() == defaultGovernor); |
| 139 | } |
| 140 | |
| 141 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("Has the first available scaling governor selected by default when " |
| 142 | "defaultGovernor is not available") |
| 143 | { |
| 144 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> otherGovernorscxx . . $ std/vector#vector(9619226211e5a241).{"_other_0_", "_other_1_"}; |
| 145 | CPUFreqTestAdaptercxx . . $ Tests/CPUFreq/CPUFreqTestAdapter# ts(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(otherGovernors), defaultGovernor, |
| 146 | stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(scalingGovernorDataSources)); |
| 147 | |
| 148 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(ts.scalingGovernor() == "_other_0_"); |
| 149 | } |
| 150 | |
| 151 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("scalingGovernor only sets known scaling governors") |
| 152 | { |
| 153 | CPUFreqTestAdaptercxx . . $ Tests/CPUFreq/CPUFreqTestAdapter# ts(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(availableGovernors), defaultGovernor, |
| 154 | stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(scalingGovernorDataSources)); |
| 155 | |
| 156 | ts.scalingGovernorcxx . . $ CPUFreq#scalingGovernor(9c546c94e5fcce4e).("performance"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 157 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(ts.scalingGovernor() == "performance"); |
| 158 | |
| 159 | ts.scalingGovernorcxx . . $ CPUFreq#scalingGovernor(9c546c94e5fcce4e).("unknown"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 160 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(ts.scalingGovernor() == "performance"); |
| 161 | } |
| 162 | |
| 163 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!( |
| 164 | "Does not generate pre-init control commands when EPP is not supported") |
| 165 | { |
| 166 | CPUFreqTestAdaptercxx . . $ Tests/CPUFreq/CPUFreqTestAdapter# ts(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(availableGovernors), defaultGovernor, |
| 167 | stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(scalingGovernorDataSources)); |
| 168 | ts.preInitcxx . . $ CPUFreq#preInit(151e9138769f295e).(ctlCmds); |
| 169 | |
| 170 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(ctlCmds.commands().empty()); |
| 171 | } |
| 172 | |
| 173 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!( |
| 174 | "Does not generate pre-init control commands when EPP is supported and " |
| 175 | "the current scaling governor is the EPP scaling governor ('powersave')") |
| 176 | { |
| 177 | auto eppHandlerMock = stdcxx . . $ std/::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<EPPHandlerMockcxx . . $ Tests/CPUFreq/EPPHandlerMock#>(); |
| 178 | |
| 179 | scalingGovernorDataSources.emplace_backcxx . . $ std/vector#emplace_back(a1bcdfdabc3a37df).( |
| 180 | stdcxx . . $ std/::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<StringDataSourceStubcxx . . $ StringDataSourceStub#>(scalingGovernorPath, |
| 181 | "powersave")); |
| 182 | |
| 183 | CPUFreqTestAdaptercxx . . $ Tests/CPUFreq/CPUFreqTestAdapter# ts(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(availableGovernors), defaultGovernor, |
| 184 | stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(scalingGovernorDataSources), |
| 185 | stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::movecxx . . $ std/move(e35c19a1ba7baa26).(eppHandlerMock)); |
| 186 | ts.preInitcxx . . $ CPUFreq#preInit(151e9138769f295e).(ctlCmds); |
| 187 | |
| 188 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(ctlCmds.commands().empty()); |
| 189 | } |
| 190 | |
| 191 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("Does generate pre-init control commands to set the scaling governor " |
| 192 | "when EPP is supported and the current scaling governor is not the " |
| 193 | "EPP scaling governor ('powersave')") |
| 194 | { |
| 195 | auto eppHandlerMock = stdcxx . . $ std/::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<EPPHandlerMockcxx . . $ Tests/CPUFreq/EPPHandlerMock#>(); |
| 196 | |
| 197 | scalingGovernorDataSources.emplace_backcxx . . $ std/vector#emplace_back(a1bcdfdabc3a37df).( |
| 198 | stdcxx . . $ std/::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<StringDataSourceStubcxx . . $ StringDataSourceStub#>(scalingGovernorPath, |
| 199 | "performance")); |
| 200 | |
| 201 | CPUFreqTestAdaptercxx . . $ Tests/CPUFreq/CPUFreqTestAdapter# ts(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(availableGovernors), defaultGovernor, |
| 202 | stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(scalingGovernorDataSources), |
| 203 | stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::movecxx . . $ std/move(e35c19a1ba7baa26).(eppHandlerMock)); |
| 204 | ts.preInitcxx . . $ CPUFreq#preInit(151e9138769f295e).(ctlCmds); |
| 205 | |
| 206 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(ctlCmds.commands().size() == 1); |
| 207 | |
| 208 | auto &[path, value] = ctlCmds.commandscxx . . $ CommandQueueStub#commands(f070559094366392).().frontcxx . . $ std/vector#front(af0004c3ce7cab93).(); |
| 209 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(path == scalingGovernorPath); |
| 210 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(value == "powersave"); |
| 211 | } |
| 212 | |
| 213 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("Does not generate post-init control commands") |
| 214 | { |
| 215 | CPUFreqTestAdaptercxx . . $ Tests/CPUFreq/CPUFreqTestAdapter# ts(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(availableGovernors), defaultGovernor, |
| 216 | stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(scalingGovernorDataSources)); |
| 217 | ts.postInitcxx . . $ CPUFreq#postInit(151e9138769f295e).(ctlCmds); |
| 218 | |
| 219 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(ctlCmds.commands().empty()); |
| 220 | } |
| 221 | |
| 222 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("Initialize EPP handler when EPP is supported") |
| 223 | { |
| 224 | auto eppHandlerMock = stdcxx . . $ std/::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<EPPHandlerMockcxx . . $ Tests/CPUFreq/EPPHandlerMock#>(); |
| 225 | REQUIRE_CALLcxx . . $ `<external>/1068432606165018960/mock.hpp:4335:9`!(*eppHandlerMock, init()); |
| 226 | |
| 227 | CPUFreqTestAdaptercxx . . $ Tests/CPUFreq/CPUFreqTestAdapter# ts(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(availableGovernors), defaultGovernor, |
| 228 | stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(scalingGovernorDataSources), |
| 229 | stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::movecxx . . $ std/move(e35c19a1ba7baa26).(eppHandlerMock)); |
| 230 | ts.initcxx . . $ CPUFreq#init(49f6e7a06ebc5aa8).(); |
| 231 | } |
| 232 | |
| 233 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("Imports scaling governor state") |
| 234 | { |
| 235 | CPUFreqTestAdaptercxx . . $ Tests/CPUFreq/CPUFreqTestAdapter# ts(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(availableGovernors), defaultGovernor, |
| 236 | stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(scalingGovernorDataSources)); |
| 237 | CPUFreqImporterStubcxx . . $ Tests/CPUFreq/CPUFreqImporterStub# icxx . . $ Tests/CPUFreq/CPUFreqImporterStub#CPUFreqImporterStub(cbc285e2492b6694).("performance"cxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792).); |
| 238 | ts.importControlcxx . . $ CPUFreq#importControl(4f796e3ecd5dcd94).(i); |
| 239 | |
| 240 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(ts.scalingGovernor() == "performance"); |
| 241 | } |
| 242 | |
| 243 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("Imports EPP hint state when EPP is supported") |
| 244 | { |
| 245 | stdcxx . . $ std/::stringcxx . . $ std/string# eppHintcxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).{"power"}; |
| 246 | auto eppHandlerMock = stdcxx . . $ std/::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<EPPHandlerMockcxx . . $ Tests/CPUFreq/EPPHandlerMock#>(); |
| 247 | REQUIRE_CALLcxx . . $ `<external>/1068432606165018960/mock.hpp:4335:9`!(*eppHandlerMock, hint(trompeloeil::_)).LR_WITHcxx . . $ `<external>/1068432606165018960/mock.hpp:4345:9`!(_1 == eppHint); |
| 248 | |
| 249 | CPUFreqTestAdaptercxx . . $ Tests/CPUFreq/CPUFreqTestAdapter# ts(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(availableGovernors), defaultGovernor, |
| 250 | stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(scalingGovernorDataSources), |
| 251 | stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::movecxx . . $ std/move(e35c19a1ba7baa26).(eppHandlerMock)); |
| 252 | CPUFreqImporterStubcxx . . $ Tests/CPUFreq/CPUFreqImporterStub# icxx . . $ Tests/CPUFreq/CPUFreqImporterStub#CPUFreqImporterStub(cbc285e2492b6694).("performance"cxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792)., eppHintcxx . . $ std/optional#optional(e3f0d6382bd52f24).); |
| 253 | ts.importControlcxx . . $ CPUFreq#importControl(4f796e3ecd5dcd94).(i); |
| 254 | } |
| 255 | |
| 256 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("Export scaling governor state and available scaling governors") |
| 257 | { |
| 258 | auto governors = availableGovernorscxx . . $ std/vector#vector(a1201200cf0efa42).; |
| 259 | CPUFreqTestAdaptercxx . . $ Tests/CPUFreq/CPUFreqTestAdapter# ts(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(availableGovernors), defaultGovernor, |
| 260 | stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(scalingGovernorDataSources)); |
| 261 | trompeloeilcxx . . $ trompeloeil/::sequencecxx . . $ trompeloeil/sequence# seq; |
| 262 | CPUFreqExporterMockcxx . . $ Tests/CPUFreq/CPUFreqExporterMock# e; |
| 263 | REQUIRE_CALLcxx . . $ `<external>/1068432606165018960/mock.hpp:4335:9`!(e, takeCPUFreqScalingGovernors(trompeloeil::_)) |
| 264 | .LR_WITHcxx . . $ `<external>/1068432606165018960/mock.hpp:4345:9`!(_1 == governors) |
| 265 | .IN_SEQUENCEcxx . . $ `<external>/3750106516996543135/sequence.hpp:394:9`!(seq); |
| 266 | REQUIRE_CALLcxx . . $ `<external>/1068432606165018960/mock.hpp:4335:9`!(e, takeCPUFreqEPPHints(trompeloeil::eq(std::nullopt))) |
| 267 | .IN_SEQUENCEcxx . . $ `<external>/3750106516996543135/sequence.hpp:394:9`!(seq); |
| 268 | REQUIRE_CALLcxx . . $ `<external>/1068432606165018960/mock.hpp:4335:9`!(e, takeCPUFreqScalingGovernor(trompeloeil::eq(defaultGovernor))) |
| 269 | .IN_SEQUENCEcxx . . $ `<external>/3750106516996543135/sequence.hpp:394:9`!(seq); |
| 270 | REQUIRE_CALLcxx . . $ `<external>/1068432606165018960/mock.hpp:4335:9`!(e, takeCPUFreqEPPHint(trompeloeil::eq(std::nullopt))) |
| 271 | .IN_SEQUENCEcxx . . $ `<external>/3750106516996543135/sequence.hpp:394:9`!(seq); |
| 272 | |
| 273 | ts.exportControlcxx . . $ CPUFreq#exportControl(40299682ab9c8676).(e); |
| 274 | } |
| 275 | |
| 276 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("Export EPP hint state and available hints when EPP is supported") |
| 277 | { |
| 278 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> eppHintscxx . . $ std/vector#vector(9619226211e5a241).{"default", "power"}; |
| 279 | stdcxx . . $ std/::stringcxx . . $ std/string# eppHintcxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).{"default"}; |
| 280 | auto eppHandlerMock = stdcxx . . $ std/::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<EPPHandlerMockcxx . . $ Tests/CPUFreq/EPPHandlerMock#>(); |
| 281 | ALLOW_CALLcxx . . $ `<external>/1068432606165018960/mock.hpp:4337:9`!(*eppHandlerMock, hints()).RETURNcxx . . $ `<external>/1068432606165018960/mock.hpp:4348:9`!(eppHints); |
| 282 | ALLOW_CALLcxx . . $ `<external>/1068432606165018960/mock.hpp:4337:9`!(*eppHandlerMock, hint()).RETURNcxx . . $ `<external>/1068432606165018960/mock.hpp:4348:9`!(eppHint); |
| 283 | |
| 284 | auto governors = availableGovernorscxx . . $ std/vector#vector(a1201200cf0efa42).; |
| 285 | CPUFreqTestAdaptercxx . . $ Tests/CPUFreq/CPUFreqTestAdapter# ts(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(availableGovernors), defaultGovernor, |
| 286 | stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(scalingGovernorDataSources), |
| 287 | stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::movecxx . . $ std/move(e35c19a1ba7baa26).(eppHandlerMock)); |
| 288 | trompeloeilcxx . . $ trompeloeil/::sequencecxx . . $ trompeloeil/sequence# seq; |
| 289 | CPUFreqExporterMockcxx . . $ Tests/CPUFreq/CPUFreqExporterMock# e; |
| 290 | ALLOW_CALLcxx . . $ `<external>/1068432606165018960/mock.hpp:4337:9`!(e, takeCPUFreqScalingGovernors(trompeloeil::_)).IN_SEQUENCEcxx . . $ `<external>/3750106516996543135/sequence.hpp:394:9`!(seq); |
| 291 | REQUIRE_CALLcxx . . $ `<external>/1068432606165018960/mock.hpp:4335:9`!(e, takeCPUFreqEPPHints(trompeloeil::_)) |
| 292 | .LR_WITHcxx . . $ `<external>/1068432606165018960/mock.hpp:4345:9`!(_1 == eppHints) |
| 293 | .IN_SEQUENCEcxx . . $ `<external>/3750106516996543135/sequence.hpp:394:9`!(seq); |
| 294 | ALLOW_CALLcxx . . $ `<external>/1068432606165018960/mock.hpp:4337:9`!(e, takeCPUFreqScalingGovernor(trompeloeil::_)).IN_SEQUENCEcxx . . $ `<external>/3750106516996543135/sequence.hpp:394:9`!(seq); |
| 295 | REQUIRE_CALLcxx . . $ `<external>/1068432606165018960/mock.hpp:4335:9`!(e, takeCPUFreqEPPHint(trompeloeil::eq(eppHint))).IN_SEQUENCEcxx . . $ `<external>/3750106516996543135/sequence.hpp:394:9`!(seq); |
| 296 | |
| 297 | ts.exportControlcxx . . $ CPUFreq#exportControl(40299682ab9c8676).(e); |
| 298 | } |
| 299 | |
| 300 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("Does not generate clean control commands") |
| 301 | { |
| 302 | CPUFreqTestAdaptercxx . . $ Tests/CPUFreq/CPUFreqTestAdapter# ts(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(availableGovernors), defaultGovernor, |
| 303 | stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(scalingGovernorDataSources)); |
| 304 | ts.cleanControlcxx . . $ CPUFreq#cleanControl(151e9138769f295e).(ctlCmds); |
| 305 | |
| 306 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(ctlCmds.commands().empty()); |
| 307 | } |
| 308 | |
| 309 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("Does not generate sync control commands when is synced") |
| 310 | { |
| 311 | scalingGovernorDataSources.emplace_backcxx . . $ std/vector#emplace_back(a1bcdfdabc3a37df).( |
| 312 | stdcxx . . $ std/::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<StringDataSourceStubcxx . . $ StringDataSourceStub#>(scalingGovernorPath, |
| 313 | defaultGovernor)); |
| 314 | CPUFreqTestAdaptercxx . . $ Tests/CPUFreq/CPUFreqTestAdapter# ts(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(availableGovernors), defaultGovernor, |
| 315 | stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(scalingGovernorDataSources)); |
| 316 | |
| 317 | ts.syncControlcxx . . $ CPUFreq#syncControl(151e9138769f295e).(ctlCmds); |
| 318 | |
| 319 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(ctlCmds.commands().empty()); |
| 320 | } |
| 321 | |
| 322 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("Does generate sync control commands when is out of sync") |
| 323 | { |
| 324 | scalingGovernorDataSources.emplace_backcxx . . $ std/vector#emplace_back(a1bcdfdabc3a37df).( |
| 325 | stdcxx . . $ std/::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<StringDataSourceStubcxx . . $ StringDataSourceStub#>(scalingGovernorPath, "_other_")); |
| 326 | CPUFreqTestAdaptercxx . . $ Tests/CPUFreq/CPUFreqTestAdapter# ts(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(availableGovernors), defaultGovernor, |
| 327 | stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(scalingGovernorDataSources)); |
| 328 | |
| 329 | ts.syncControlcxx . . $ CPUFreq#syncControl(151e9138769f295e).(ctlCmds); |
| 330 | |
| 331 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(ctlCmds.commands().size() == 1); |
| 332 | |
| 333 | auto &[path, value] = ctlCmds.commandscxx . . $ CommandQueueStub#commands(f070559094366392).().frontcxx . . $ std/vector#front(af0004c3ce7cab93).(); |
| 334 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(path == scalingGovernorPath); |
| 335 | REQUIREcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:127:11`!(value == defaultGovernor); |
| 336 | } |
| 337 | |
| 338 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("Does not generate sync control commands for EPP when this feature " |
| 339 | "is supported and the frequency scaling governor is not set " |
| 340 | "to 'powersave'") |
| 341 | { |
| 342 | auto eppHandlerMock = stdcxx . . $ std/::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<EPPHandlerMockcxx . . $ Tests/CPUFreq/EPPHandlerMock#>(); |
| 343 | FORBID_CALLcxx . . $ `<external>/1068432606165018960/mock.hpp:4339:9`!(*eppHandlerMock, sync(trompeloeil::_)); |
| 344 | |
| 345 | scalingGovernorDataSources.emplace_backcxx . . $ std/vector#emplace_back(a1bcdfdabc3a37df).( |
| 346 | stdcxx . . $ std/::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<StringDataSourceStubcxx . . $ StringDataSourceStub#>(scalingGovernorPath, |
| 347 | defaultGovernor)); |
| 348 | CPUFreqTestAdaptercxx . . $ Tests/CPUFreq/CPUFreqTestAdapter# ts(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(availableGovernors), defaultGovernor, |
| 349 | stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(scalingGovernorDataSources), |
| 350 | stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::movecxx . . $ std/move(e35c19a1ba7baa26).(eppHandlerMock)); |
| 351 | |
| 352 | ts.scalingGovernorcxx . . $ CPUFreq#scalingGovernor(9c546c94e5fcce4e).("performance"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 353 | ts.syncControlcxx . . $ CPUFreq#syncControl(151e9138769f295e).(ctlCmds); |
| 354 | } |
| 355 | |
| 356 | SECTIONcxx . . $ `<external>/1821973855936310166/catch_test_macros.hpp:149:11`!("Could generate sync control commands for EPP when this feature " |
| 357 | "is supported and the frequency scaling governor is set " |
| 358 | "to 'powersave'") |
| 359 | { |
| 360 | auto eppHandlerMock = stdcxx . . $ std/::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<EPPHandlerMockcxx . . $ Tests/CPUFreq/EPPHandlerMock#>(); |
| 361 | REQUIRE_CALLcxx . . $ `<external>/1068432606165018960/mock.hpp:4335:9`!(*eppHandlerMock, sync(trompeloeil::_)); |
| 362 | |
| 363 | scalingGovernorDataSources.emplace_backcxx . . $ std/vector#emplace_back(a1bcdfdabc3a37df).( |
| 364 | stdcxx . . $ std/::make_uniquecxx . . $ std/make_unique(5cd499e8540a10bb).<StringDataSourceStubcxx . . $ StringDataSourceStub#>(scalingGovernorPath, |
| 365 | defaultGovernor)); |
| 366 | CPUFreqTestAdaptercxx . . $ Tests/CPUFreq/CPUFreqTestAdapter# ts(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(availableGovernors), defaultGovernor, |
| 367 | stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(scalingGovernorDataSources), |
| 368 | stdcxx . . $ std/unique_ptr#unique_ptr(8bcafd3b0b660df8).::movecxx . . $ std/move(e35c19a1ba7baa26).(eppHandlerMock)); |
| 369 | |
| 370 | ts.syncControlcxx . . $ CPUFreq#syncControl(151e9138769f295e).(ctlCmds); |
| 371 | } |
| 372 | } |
| 373 | |
| 374 | } // namespace Tests::CPUFreq |