169570cc8Sopenharmony_ci/* 269570cc8Sopenharmony_ci * Copyright (c) 2024 Huawei Device Co., Ltd. 369570cc8Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 469570cc8Sopenharmony_ci * you may not use this file except in compliance with the License. 569570cc8Sopenharmony_ci * You may obtain a copy of the License at 669570cc8Sopenharmony_ci * 769570cc8Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 869570cc8Sopenharmony_ci * 969570cc8Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1069570cc8Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1169570cc8Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1269570cc8Sopenharmony_ci * See the License for the specific language governing permissions and 1369570cc8Sopenharmony_ci * limitations under the License. 1469570cc8Sopenharmony_ci */ 1569570cc8Sopenharmony_ci 1669570cc8Sopenharmony_ci#include <cerrno> 1769570cc8Sopenharmony_ci#include <cstdint> 1869570cc8Sopenharmony_ci#include <cstdio> 1969570cc8Sopenharmony_ci#include <cstdlib> 2069570cc8Sopenharmony_ci#include <fcntl.h> 2169570cc8Sopenharmony_ci#include <string> 2269570cc8Sopenharmony_ci#include <termios.h> 2369570cc8Sopenharmony_ci#include <unistd.h> 2469570cc8Sopenharmony_ci 2569570cc8Sopenharmony_ci#include <sys/stat.h> 2669570cc8Sopenharmony_ci 2769570cc8Sopenharmony_ci#include "appspawn.h" 2869570cc8Sopenharmony_ci#include "appspawn_msg.h" 2969570cc8Sopenharmony_ci#include "appspawn_utils.h" 3069570cc8Sopenharmony_ci#include "appspawn_test_cmder.h" 3169570cc8Sopenharmony_ci#include "command_lexer.h" 3269570cc8Sopenharmony_ci#include "json_utils.h" 3369570cc8Sopenharmony_ci#include "cJSON.h" 3469570cc8Sopenharmony_ci#include "securec.h" 3569570cc8Sopenharmony_ci#include "thread_manager.h" 3669570cc8Sopenharmony_ci 3769570cc8Sopenharmony_ciint main(int argc, char *const argv[]) 3869570cc8Sopenharmony_ci{ 3969570cc8Sopenharmony_ci if (argc <= 0) { 4069570cc8Sopenharmony_ci return 0; 4169570cc8Sopenharmony_ci } 4269570cc8Sopenharmony_ci 4369570cc8Sopenharmony_ci OHOS::AppSpawnModuleTest::AppSpawnTestCommander commander; 4469570cc8Sopenharmony_ci int ret = commander.ProcessArgs(argc, argv); 4569570cc8Sopenharmony_ci if (ret == 0) { 4669570cc8Sopenharmony_ci commander.Run(); 4769570cc8Sopenharmony_ci } 4869570cc8Sopenharmony_ci return 0; 4969570cc8Sopenharmony_ci}