blob: f0774db933ba57a3825b98b505d530f8f8133d05 [file] [log] [blame]
Joe Onorato0578cbc2016-10-19 17:03:06 -07001/*
2 * Copyright (C) 2016 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
17#ifndef ADB_H
18#define ADB_H
19
Dan Willemsend3eac262017-09-08 22:47:47 -070020#include "proto/instrumentation_data.pb.h"
Joe Onorato0578cbc2016-10-19 17:03:06 -070021
22#include <string>
23
24using namespace android::am;
25using namespace google::protobuf;
26using namespace std;
27
28class InstrumentationCallbacks {
29public:
30 virtual void OnTestStatus(TestStatus& status) = 0;
31 virtual void OnSessionStatus(SessionStatus& status) = 0;
32};
33
34int run_adb(const char* first, ...);
35
36string get_system_property(const string& name, int* err);
37
38int run_instrumentation_test(const string& packageName, const string& runner,
39 const string& className, InstrumentationCallbacks* callbacks);
40
41string get_bundle_string(const ResultsBundle& bundle, bool* found, ...);
42int32_t get_bundle_int(const ResultsBundle& bundle, bool* found, ...);
43float get_bundle_float(const ResultsBundle& bundle, bool* found, ...);
44double get_bundle_double(const ResultsBundle& bundle, bool* found, ...);
45int64_t get_bundle_long(const ResultsBundle& bundle, bool* found, ...);
46
47#endif // ADB_H