blob: 76b25b688efc94d0d8b861e6b57f4c3eae118b5a [file] [log] [blame]
Arthur Ishiguro4e916c32021-08-12 12:47:03 -07001/*
2 * Copyright (C) 2021 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#include <aidl/Gtest.h>
17#include <aidl/Vintf.h>
18
19#include "VtsHalContexthubUtilsCommon.h"
20
21#include <android/hardware/contexthub/BnContextHub.h>
22#include <android/hardware/contexthub/BnContextHubCallback.h>
23#include <android/hardware/contexthub/IContextHub.h>
24#include <android/hardware/contexthub/IContextHubCallback.h>
25#include <binder/IServiceManager.h>
26#include <binder/ProcessState.h>
27#include <log/log.h>
28
29#include <cinttypes>
30#include <future>
31
32using ::android::ProcessState;
33using ::android::sp;
34using ::android::String16;
35using ::android::binder::Status;
36using ::android::hardware::contexthub::AsyncEventType;
37using ::android::hardware::contexthub::ContextHubInfo;
38using ::android::hardware::contexthub::ContextHubMessage;
Arthur Ishiguro065a9a52021-11-19 00:24:45 +000039using ::android::hardware::contexthub::HostEndpointInfo;
Arthur Ishiguro4e916c32021-08-12 12:47:03 -070040using ::android::hardware::contexthub::IContextHub;
41using ::android::hardware::contexthub::IContextHubCallbackDefault;
42using ::android::hardware::contexthub::NanoappBinary;
43using ::android::hardware::contexthub::NanoappInfo;
Arthur Ishiguro08103072021-12-09 18:30:49 +000044using ::android::hardware::contexthub::NanoappRpcService;
Anthony Stange7fba1002023-03-02 21:45:20 +000045using ::android::hardware::contexthub::NanSessionRequest;
46using ::android::hardware::contexthub::NanSessionStateUpdate;
Arthur Ishiguro4e916c32021-08-12 12:47:03 -070047using ::android::hardware::contexthub::Setting;
48using ::android::hardware::contexthub::vts_utils::kNonExistentAppId;
49using ::android::hardware::contexthub::vts_utils::waitForCallback;
50
Lei Ju8787afa2023-06-28 09:36:19 -070051// 6612b522-b717-41c8-b48d-c0b1cc64e142
Lei Ju5b2ded42023-12-05 15:08:21 -080052constexpr std::array<uint8_t, 16> kUuid = {0x66, 0x12, 0xb5, 0x22, 0xb7, 0x17, 0x41, 0xc8,
53 0xb4, 0x8d, 0xc0, 0xb1, 0xcc, 0x64, 0xe1, 0x42};
54const String16 kName{"VtsAidlHalContextHubTargetTest"};
Lei Ju8787afa2023-06-28 09:36:19 -070055
Arthur Ishiguro4e916c32021-08-12 12:47:03 -070056class ContextHubAidl : public testing::TestWithParam<std::tuple<std::string, int32_t>> {
57 public:
58 virtual void SetUp() override {
59 contextHub = android::waitForDeclaredService<IContextHub>(
60 String16(std::get<0>(GetParam()).c_str()));
61 ASSERT_NE(contextHub, nullptr);
62 }
63
64 uint32_t getHubId() { return std::get<1>(GetParam()); }
65
66 void testSettingChanged(Setting setting);
67
68 sp<IContextHub> contextHub;
69};
70
71TEST_P(ContextHubAidl, TestGetHubs) {
72 std::vector<ContextHubInfo> hubs;
73 ASSERT_TRUE(contextHub->getContextHubs(&hubs).isOk());
74
75 ALOGD("System reports %zu hubs", hubs.size());
76
77 for (const ContextHubInfo& hub : hubs) {
78 ALOGD("Checking hub ID %" PRIu32, hub.id);
79
80 EXPECT_GT(hub.name.size(), 0);
81 EXPECT_GT(hub.vendor.size(), 0);
82 EXPECT_GT(hub.toolchain.size(), 0);
83 EXPECT_GT(hub.peakMips, 0);
84 EXPECT_GT(hub.chrePlatformId, 0);
85 EXPECT_GT(hub.chreApiMajorVersion, 0);
Arthur Ishiguro6471f612021-10-28 21:59:55 +000086 EXPECT_GE(hub.chreApiMinorVersion, 0);
87 EXPECT_GE(hub.chrePatchVersion, 0);
Arthur Ishiguro4e916c32021-08-12 12:47:03 -070088
89 // Minimum 128 byte MTU as required by CHRE API v1.0
90 EXPECT_GE(hub.maxSupportedMessageLengthBytes, UINT32_C(128));
91 }
92}
93
Matthew Sedamc8ce4d52023-01-09 20:18:21 +000094TEST_P(ContextHubAidl, TestEnableTestMode) {
95 Status status = contextHub->setTestMode(true);
96 if (status.exceptionCode() == Status::EX_UNSUPPORTED_OPERATION ||
97 status.transactionError() == android::UNKNOWN_TRANSACTION) {
Matthew Sedam121b6d62023-01-19 19:04:53 +000098 GTEST_SKIP() << "Not supported -> old API; or not implemented";
99 } else {
100 ASSERT_TRUE(status.isOk());
Matthew Sedamc8ce4d52023-01-09 20:18:21 +0000101 }
Matthew Sedamc8ce4d52023-01-09 20:18:21 +0000102}
103
104TEST_P(ContextHubAidl, TestDisableTestMode) {
105 Status status = contextHub->setTestMode(false);
106 if (status.exceptionCode() == Status::EX_UNSUPPORTED_OPERATION ||
107 status.transactionError() == android::UNKNOWN_TRANSACTION) {
Matthew Sedam121b6d62023-01-19 19:04:53 +0000108 GTEST_SKIP() << "Not supported -> old API; or not implemented";
109 } else {
110 ASSERT_TRUE(status.isOk());
Matthew Sedamc8ce4d52023-01-09 20:18:21 +0000111 }
Matthew Sedamc8ce4d52023-01-09 20:18:21 +0000112}
113
Arthur Ishiguroe6b540d2021-10-29 16:01:35 +0000114class EmptyContextHubCallback : public android::hardware::contexthub::BnContextHubCallback {
115 public:
116 Status handleNanoappInfo(const std::vector<NanoappInfo>& /* appInfo */) override {
117 return Status::ok();
118 }
119
120 Status handleContextHubMessage(const ContextHubMessage& /* msg */,
121 const std::vector<String16>& /* msgContentPerms */) override {
122 return Status::ok();
123 }
124
125 Status handleContextHubAsyncEvent(AsyncEventType /* evt */) override { return Status::ok(); }
126
127 Status handleTransactionResult(int32_t /* transactionId */, bool /* success */) override {
128 return Status::ok();
129 }
Anthony Stange7344af92022-12-22 14:21:31 +0000130
Anthony Stange7fba1002023-03-02 21:45:20 +0000131 Status handleNanSessionRequest(const NanSessionRequest& /* request */) override {
132 return Status::ok();
133 }
Lei Ju8787afa2023-06-28 09:36:19 -0700134
135 Status getUuid(std::array<uint8_t, 16>* out_uuid) override {
136 *out_uuid = kUuid;
137 return Status::ok();
138 }
Lei Ju5b2ded42023-12-05 15:08:21 -0800139
140 Status getName(::android::String16* out_name) override {
141 *out_name = kName;
142 return Status::ok();
143 }
Arthur Ishiguroe6b540d2021-10-29 16:01:35 +0000144};
145
Arthur Ishiguro4e916c32021-08-12 12:47:03 -0700146TEST_P(ContextHubAidl, TestRegisterCallback) {
Arthur Ishiguroe6b540d2021-10-29 16:01:35 +0000147 sp<EmptyContextHubCallback> cb = sp<EmptyContextHubCallback>::make();
Arthur Ishiguro070f47d2022-01-06 22:42:10 +0000148 ASSERT_TRUE(contextHub->registerCallback(getHubId(), cb).isOk());
Arthur Ishiguro4e916c32021-08-12 12:47:03 -0700149}
150
Arthur Ishiguro4e916c32021-08-12 12:47:03 -0700151// Helper callback that puts the async appInfo callback data into a promise
152class QueryAppsCallback : public android::hardware::contexthub::BnContextHubCallback {
153 public:
154 Status handleNanoappInfo(const std::vector<NanoappInfo>& appInfo) override {
155 ALOGD("Got app info callback with %zu apps", appInfo.size());
156 promise.set_value(appInfo);
157 return Status::ok();
158 }
159
160 Status handleContextHubMessage(const ContextHubMessage& /* msg */,
161 const std::vector<String16>& /* msgContentPerms */) override {
162 return Status::ok();
163 }
164
165 Status handleContextHubAsyncEvent(AsyncEventType /* evt */) override { return Status::ok(); }
166
167 Status handleTransactionResult(int32_t /* transactionId */, bool /* success */) override {
168 return Status::ok();
169 }
170
Anthony Stange7fba1002023-03-02 21:45:20 +0000171 Status handleNanSessionRequest(const NanSessionRequest& /* request */) override {
172 return Status::ok();
173 }
Anthony Stange7344af92022-12-22 14:21:31 +0000174
Lei Ju8787afa2023-06-28 09:36:19 -0700175 Status getUuid(std::array<uint8_t, 16>* out_uuid) override {
176 *out_uuid = kUuid;
177 return Status::ok();
178 }
179
Lei Ju5b2ded42023-12-05 15:08:21 -0800180 Status getName(::android::String16* out_name) override {
181 *out_name = kName;
182 return Status::ok();
183 }
184
Arthur Ishiguro4e916c32021-08-12 12:47:03 -0700185 std::promise<std::vector<NanoappInfo>> promise;
186};
187
188// Calls queryApps() and checks the returned metadata
189TEST_P(ContextHubAidl, TestQueryApps) {
190 sp<QueryAppsCallback> cb = sp<QueryAppsCallback>::make();
Arthur Ishiguro070f47d2022-01-06 22:42:10 +0000191 ASSERT_TRUE(contextHub->registerCallback(getHubId(), cb).isOk());
192 ASSERT_TRUE(contextHub->queryNanoapps(getHubId()).isOk());
Arthur Ishiguro4e916c32021-08-12 12:47:03 -0700193
194 std::vector<NanoappInfo> appInfoList;
195 ASSERT_TRUE(waitForCallback(cb->promise.get_future(), &appInfoList));
196 for (const NanoappInfo& appInfo : appInfoList) {
197 EXPECT_NE(appInfo.nanoappId, UINT64_C(0));
198 EXPECT_NE(appInfo.nanoappId, kNonExistentAppId);
Arthur Ishiguro08103072021-12-09 18:30:49 +0000199
200 // Verify services are unique.
201 std::set<uint64_t> existingServiceIds;
202 for (const NanoappRpcService& rpcService : appInfo.rpcServices) {
203 EXPECT_NE(rpcService.id, UINT64_C(0));
204 EXPECT_EQ(existingServiceIds.count(rpcService.id), 0);
205 existingServiceIds.insert(rpcService.id);
206 }
Arthur Ishiguro4e916c32021-08-12 12:47:03 -0700207 }
208}
209
Matthew Sedamd70f84d2023-03-06 18:34:24 +0000210// Calls getPreloadedNanoappsIds() and verifies there are preloaded nanoapps
211TEST_P(ContextHubAidl, TestGetPreloadedNanoappIds) {
Arthur Ishigurofd5e65c2022-11-08 16:49:47 +0000212 std::vector<int64_t> preloadedNanoappIds;
Matthew Sedamd70f84d2023-03-06 18:34:24 +0000213 Status status = contextHub->getPreloadedNanoappIds(getHubId(), &preloadedNanoappIds);
Arthur Ishigurofd5e65c2022-11-08 16:49:47 +0000214 if (status.exceptionCode() == Status::EX_UNSUPPORTED_OPERATION ||
215 status.transactionError() == android::UNKNOWN_TRANSACTION) {
Matthew Sedam121b6d62023-01-19 19:04:53 +0000216 GTEST_SKIP() << "Not supported -> old API; or not implemented";
217 } else {
218 ASSERT_TRUE(status.isOk());
Arthur Ishigurofd5e65c2022-11-08 16:49:47 +0000219 }
Arthur Ishigurofd5e65c2022-11-08 16:49:47 +0000220}
221
Arthur Ishiguro4e916c32021-08-12 12:47:03 -0700222// Helper callback that puts the TransactionResult for the expectedTransactionId into a
223// promise
224class TransactionResultCallback : public android::hardware::contexthub::BnContextHubCallback {
225 public:
226 Status handleNanoappInfo(const std::vector<NanoappInfo>& /* appInfo */) override {
227 return Status::ok();
228 }
229
230 Status handleContextHubMessage(const ContextHubMessage& /* msg */,
231 const std::vector<String16>& /* msgContentPerms */) override {
232 return Status::ok();
233 }
234
235 Status handleContextHubAsyncEvent(AsyncEventType /* evt */) override { return Status::ok(); }
236
237 Status handleTransactionResult(int32_t transactionId, bool success) override {
238 ALOGD("Got transaction result callback for transactionId %" PRIu32 " (expecting %" PRIu32
239 ") with success %d",
240 transactionId, expectedTransactionId, success);
241 if (transactionId == expectedTransactionId) {
242 promise.set_value(success);
243 }
244 return Status::ok();
245 }
246
Anthony Stange7fba1002023-03-02 21:45:20 +0000247 Status handleNanSessionRequest(const NanSessionRequest& /* request */) override {
248 return Status::ok();
249 }
Anthony Stange7344af92022-12-22 14:21:31 +0000250
Lei Ju8787afa2023-06-28 09:36:19 -0700251 Status getUuid(std::array<uint8_t, 16>* out_uuid) override {
252 *out_uuid = kUuid;
253 return Status::ok();
254 }
255
Lei Ju5b2ded42023-12-05 15:08:21 -0800256 Status getName(::android::String16* out_name) override {
257 *out_name = kName;
258 return Status::ok();
259 }
260
Arthur Ishiguro4e916c32021-08-12 12:47:03 -0700261 uint32_t expectedTransactionId = 0;
262 std::promise<bool> promise;
263};
264
265// Parameterized fixture that sets the callback to TransactionResultCallback
266class ContextHubTransactionTest : public ContextHubAidl {
267 public:
268 virtual void SetUp() override {
269 ContextHubAidl::SetUp();
Arthur Ishiguro070f47d2022-01-06 22:42:10 +0000270 ASSERT_TRUE(contextHub->registerCallback(getHubId(), cb).isOk());
Arthur Ishiguro4e916c32021-08-12 12:47:03 -0700271 }
272
273 sp<TransactionResultCallback> cb = sp<TransactionResultCallback>::make();
274};
275
276TEST_P(ContextHubTransactionTest, TestSendMessageToNonExistentNanoapp) {
277 ContextHubMessage message;
278 message.nanoappId = kNonExistentAppId;
279 message.messageType = 1;
280 message.messageBody.resize(4);
281 std::fill(message.messageBody.begin(), message.messageBody.end(), 0);
282
283 ALOGD("Sending message to non-existent nanoapp");
Arthur Ishiguro070f47d2022-01-06 22:42:10 +0000284 ASSERT_TRUE(contextHub->sendMessageToHub(getHubId(), message).isOk());
Arthur Ishiguro4e916c32021-08-12 12:47:03 -0700285}
286
287TEST_P(ContextHubTransactionTest, TestLoadEmptyNanoapp) {
288 cb->expectedTransactionId = 0123;
289 NanoappBinary emptyApp;
290
291 emptyApp.nanoappId = kNonExistentAppId;
292 emptyApp.nanoappVersion = 1;
293 emptyApp.flags = 0;
294 emptyApp.targetChreApiMajorVersion = 1;
295 emptyApp.targetChreApiMinorVersion = 0;
296
297 ALOGD("Loading empty nanoapp");
Arthur Ishiguro070f47d2022-01-06 22:42:10 +0000298 bool success = contextHub->loadNanoapp(getHubId(), emptyApp, cb->expectedTransactionId).isOk();
Arthur Ishiguro4e916c32021-08-12 12:47:03 -0700299 if (success) {
300 bool transactionSuccess;
301 ASSERT_TRUE(waitForCallback(cb->promise.get_future(), &transactionSuccess));
302 ASSERT_FALSE(transactionSuccess);
303 }
304}
305
306TEST_P(ContextHubTransactionTest, TestUnloadNonexistentNanoapp) {
307 cb->expectedTransactionId = 1234;
308
309 ALOGD("Unloading nonexistent nanoapp");
Arthur Ishiguro070f47d2022-01-06 22:42:10 +0000310 bool success =
311 contextHub->unloadNanoapp(getHubId(), kNonExistentAppId, cb->expectedTransactionId)
312 .isOk();
Arthur Ishiguro4e916c32021-08-12 12:47:03 -0700313 if (success) {
314 bool transactionSuccess;
315 ASSERT_TRUE(waitForCallback(cb->promise.get_future(), &transactionSuccess));
316 ASSERT_FALSE(transactionSuccess);
317 }
318}
319
320TEST_P(ContextHubTransactionTest, TestEnableNonexistentNanoapp) {
321 cb->expectedTransactionId = 2345;
322
323 ALOGD("Enabling nonexistent nanoapp");
Arthur Ishiguro070f47d2022-01-06 22:42:10 +0000324 bool success =
325 contextHub->enableNanoapp(getHubId(), kNonExistentAppId, cb->expectedTransactionId)
326 .isOk();
Arthur Ishiguro4e916c32021-08-12 12:47:03 -0700327 if (success) {
328 bool transactionSuccess;
329 ASSERT_TRUE(waitForCallback(cb->promise.get_future(), &transactionSuccess));
330 ASSERT_FALSE(transactionSuccess);
331 }
332}
333
334TEST_P(ContextHubTransactionTest, TestDisableNonexistentNanoapp) {
335 cb->expectedTransactionId = 3456;
336
337 ALOGD("Disabling nonexistent nanoapp");
Arthur Ishiguro070f47d2022-01-06 22:42:10 +0000338 bool success =
339 contextHub->disableNanoapp(getHubId(), kNonExistentAppId, cb->expectedTransactionId)
340 .isOk();
Arthur Ishiguro4e916c32021-08-12 12:47:03 -0700341 if (success) {
342 bool transactionSuccess;
343 ASSERT_TRUE(waitForCallback(cb->promise.get_future(), &transactionSuccess));
344 ASSERT_FALSE(transactionSuccess);
345 }
346}
347
348void ContextHubAidl::testSettingChanged(Setting setting) {
349 // In VTS, we only test that sending the values doesn't cause things to blow up - GTS tests
350 // verify the expected E2E behavior in CHRE
Arthur Ishiguroe6b540d2021-10-29 16:01:35 +0000351 sp<EmptyContextHubCallback> cb = sp<EmptyContextHubCallback>::make();
Arthur Ishiguro070f47d2022-01-06 22:42:10 +0000352 ASSERT_TRUE(contextHub->registerCallback(getHubId(), cb).isOk());
Arthur Ishiguro4e916c32021-08-12 12:47:03 -0700353
354 ASSERT_TRUE(contextHub->onSettingChanged(setting, true /* enabled */).isOk());
355 ASSERT_TRUE(contextHub->onSettingChanged(setting, false /* enabled */).isOk());
Arthur Ishiguro4e916c32021-08-12 12:47:03 -0700356}
357
358TEST_P(ContextHubAidl, TestOnLocationSettingChanged) {
359 testSettingChanged(Setting::LOCATION);
360}
361
362TEST_P(ContextHubAidl, TestOnWifiMainSettingChanged) {
363 testSettingChanged(Setting::WIFI_MAIN);
364}
365
366TEST_P(ContextHubAidl, TestOnWifiScanningSettingChanged) {
367 testSettingChanged(Setting::WIFI_SCANNING);
368}
369
370TEST_P(ContextHubAidl, TestOnAirplaneModeSettingChanged) {
371 testSettingChanged(Setting::AIRPLANE_MODE);
372}
373
374TEST_P(ContextHubAidl, TestOnMicrophoneSettingChanged) {
375 testSettingChanged(Setting::MICROPHONE);
376}
377
Anthonya6b65002022-01-20 20:49:10 +0000378TEST_P(ContextHubAidl, TestOnBtMainSettingChanged) {
379 testSettingChanged(Setting::BT_MAIN);
380}
381
382TEST_P(ContextHubAidl, TestOnBtScanningSettingChanged) {
383 testSettingChanged(Setting::BT_SCANNING);
384}
385
Arthur Ishiguro4e916c32021-08-12 12:47:03 -0700386std::vector<std::tuple<std::string, int32_t>> generateContextHubMapping() {
387 std::vector<std::tuple<std::string, int32_t>> tuples;
388 auto contextHubAidlNames = android::getAidlHalInstanceNames(IContextHub::descriptor);
389 std::vector<ContextHubInfo> contextHubInfos;
390
391 for (int i = 0; i < contextHubAidlNames.size(); i++) {
392 auto contextHubName = contextHubAidlNames[i].c_str();
393 auto contextHub = android::waitForDeclaredService<IContextHub>(String16(contextHubName));
394 if (contextHub->getContextHubs(&contextHubInfos).isOk()) {
395 for (auto& info : contextHubInfos) {
396 tuples.push_back(std::make_tuple(contextHubName, info.id));
397 }
398 }
399 }
400
401 return tuples;
402}
403
Arthur Ishiguro065a9a52021-11-19 00:24:45 +0000404TEST_P(ContextHubAidl, TestHostConnection) {
405 constexpr char16_t kHostEndpointId = 1;
406 HostEndpointInfo hostEndpointInfo;
Arthur Ishiguro16f40622023-02-10 18:11:12 +0000407 hostEndpointInfo.type = HostEndpointInfo::Type::NATIVE;
Arthur Ishiguro065a9a52021-11-19 00:24:45 +0000408 hostEndpointInfo.hostEndpointId = kHostEndpointId;
409
410 ASSERT_TRUE(contextHub->onHostEndpointConnected(hostEndpointInfo).isOk());
411 ASSERT_TRUE(contextHub->onHostEndpointDisconnected(kHostEndpointId).isOk());
412}
413
414TEST_P(ContextHubAidl, TestInvalidHostConnection) {
415 constexpr char16_t kHostEndpointId = 1;
416
Arthur Ishiguro5dba9212022-02-01 17:03:32 +0000417 ASSERT_TRUE(contextHub->onHostEndpointDisconnected(kHostEndpointId).isOk());
Arthur Ishiguro065a9a52021-11-19 00:24:45 +0000418}
419
Anthony Stange7344af92022-12-22 14:21:31 +0000420TEST_P(ContextHubAidl, TestNanSessionStateChange) {
Anthony Stange7fba1002023-03-02 21:45:20 +0000421 NanSessionStateUpdate update;
422 update.state = true;
Rocky Fang78140982023-06-16 00:42:41 +0000423 Status status = contextHub->onNanSessionStateChanged(update);
424 if (status.exceptionCode() == Status::EX_UNSUPPORTED_OPERATION ||
425 status.transactionError() == android::UNKNOWN_TRANSACTION) {
426 GTEST_SKIP() << "Not supported -> old API; or not implemented";
427 } else {
428 ASSERT_TRUE(status.isOk());
429 update.state = false;
430 ASSERT_TRUE(contextHub->onNanSessionStateChanged(update).isOk());
431 }
Anthony Stange7344af92022-12-22 14:21:31 +0000432}
433
Arthur Ishiguro4e916c32021-08-12 12:47:03 -0700434std::string PrintGeneratedTest(const testing::TestParamInfo<ContextHubAidl::ParamType>& info) {
435 return std::string("CONTEXT_HUB_ID_") + std::to_string(std::get<1>(info.param));
436}
437
438GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(ContextHubAidl);
439INSTANTIATE_TEST_SUITE_P(ContextHub, ContextHubAidl, testing::ValuesIn(generateContextHubMapping()),
440 PrintGeneratedTest);
441
442GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(ContextHubTransactionTest);
443INSTANTIATE_TEST_SUITE_P(ContextHub, ContextHubTransactionTest,
444 testing::ValuesIn(generateContextHubMapping()), PrintGeneratedTest);
445
446int main(int argc, char** argv) {
447 ::testing::InitGoogleTest(&argc, argv);
448 ProcessState::self()->setThreadPoolMaxThreadCount(1);
449 ProcessState::self()->startThreadPool();
450 return RUN_ALL_TESTS();
451}