• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright (C) 2022 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 #pragma once
17 
18 #include <optional>
19 #include <string>
20 #include <unordered_map>
21 #include <unordered_set>
22 #include <vector>
23 
24 #include <gtest/gtest.h>
25 
26 #include "host/commands/cvd/selector/start_selector_parser.h"
27 #include "host/commands/cvd/types.h"
28 
29 namespace cuttlefish {
30 namespace selector {
31 
32 struct ExpectedOutput {
33   std::optional<std::vector<std::string>> names;
34   std::optional<std::string> group_name;
35   std::optional<std::vector<std::string>> per_instance_names;
36 };
37 
38 struct InputOutput {
39   std::string input;
40   ExpectedOutput expected;
41 };
42 
43 class ValidNamesTest : public testing::TestWithParam<InputOutput> {
44  protected:
45   ValidNamesTest();
46   void Init();
47 
48   cvd_common::Args selector_args_;
49   ExpectedOutput expected_output_;
50 };
51 
52 class InvalidNamesTest : public testing::TestWithParam<std::string> {
53  protected:
54   InvalidNamesTest();
55 
56   cvd_common::Args selector_args_;
57 };
58 
59 }  // namespace selector
60 }  // namespace cuttlefish
61