Keun Soo Yim | bf80453 | 2016-05-07 22:40:38 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 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 | |
Keun Soo Yim | 072337b | 2016-05-13 15:58:26 -0700 | [diff] [blame^] | 17 | #include <iostream> |
| 18 | |
Keun Soo Yim | 154b14f | 2016-05-09 19:41:58 -0700 | [diff] [blame] | 19 | #include "TcpServer.h" |
Keun Soo Yim | bf80453 | 2016-05-07 22:40:38 -0700 | [diff] [blame] | 20 | |
Keun Soo Yim | 072337b | 2016-05-13 15:58:26 -0700 | [diff] [blame^] | 21 | #define DEFAULT_FUZZER_FILE_PATH "./fuzzer" |
Keun Soo Yim | bf80453 | 2016-05-07 22:40:38 -0700 | [diff] [blame] | 22 | |
Keun Soo Yim | 072337b | 2016-05-13 15:58:26 -0700 | [diff] [blame^] | 23 | |
| 24 | int main(int argc, char* argv[]) { |
| 25 | char* fuzzer_path; |
| 26 | char* spec_dir_path = NULL; |
| 27 | |
| 28 | if (argc == 1) { |
| 29 | fuzzer_path = DEFAULT_FUZZER_FILE_PATH; |
| 30 | } else if (argc == 2) { |
| 31 | fuzzer_path = argv[1]; |
| 32 | } else if (argc == 3) { |
| 33 | fuzzer_path = argv[1]; |
| 34 | spec_dir_path = argv[2]; |
| 35 | } else { |
| 36 | std::cerr << "usage: vts_hal_agent " |
| 37 | << "[<fuzzer binary path> [<spec file base dir path>]]" << std::endl; |
| 38 | return -1; |
| 39 | } |
| 40 | android::vts::StartTcpServer( |
| 41 | (const char*) fuzzer_path, (const char*) spec_dir_path); |
Keun Soo Yim | bf80453 | 2016-05-07 22:40:38 -0700 | [diff] [blame] | 42 | return 0; |
| 43 | } |