Add new internal functions to kill loader process
[platform/core/appfw/aul-1.git] / tool / aul_test / tests / aul_kill_loader_test.cc
1 /*
2  * Copyright (c) 2023 Samsung Electronics Co., Ltd All Rights Reserved
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 #include <stdlib.h>
18
19 #include "include/aul.h"
20
21 #include "aul_test.hh"
22 #include "log_private.hh"
23
24 namespace aul_test {
25
26 class AulKillLoaderTest : public AulTest {
27  public:
28   AulKillLoaderTest()
29       : AulTest("kill_loader", "aul_kill_loader", "kill_loader <loader_name>") {
30   }
31
32   virtual ~AulKillLoaderTest() {}
33
34   void SetUp() override {}
35
36   void TearDown() override {}
37
38   int Test(int argc, char** argv) override {
39     if (argc < 3) {
40       Usage();
41       return -1;
42     }
43
44     _D("[aul_kill_loader test] %s", argv[2]);
45     return aul_kill_loader(argv[2]);
46   }
47 };
48
49 AUL_TEST_REGISTER(AulKillLoaderTest, kill_loader_test);
50
51 }  // namespace aul_test