Remove boost dependency
[platform/core/appfw/app-installers.git] / test / smoke_tests / libs / test_assessor.h
1 // Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
2 // Use of this source code is governed by an apache 2.0 license that can be
3 // found in the LICENSE file.
4
5 #ifndef TEST_SMOKE_TESTS_LIBS_TEST_ASSESSOR_H_
6 #define TEST_SMOKE_TESTS_LIBS_TEST_ASSESSOR_H_
7
8 #include <map>
9 #include <optional>
10 #include <string>
11 #include <tuple>
12 #include <utility>
13
14 #include "common/plugins/plugin.h"
15 #include "common/utils/singleton.h"
16
17 namespace common_installer {
18
19 extern const char kTagPluginName[];
20 extern const char kCategoryPluginName[];
21 extern const char kMetadataPluginName[];
22 extern const char kTestPackageId[];
23 extern const char kTestApplicationId[];
24
25 class TestAssessor : public common_installer::Singleton<TestAssessor> {
26   CRTP_DECLARE_DEFAULT_CONSTRUCTOR_CLASS(TestAssessor)
27  public:
28   using ResultLine = std::tuple<std::string, Plugin::ActionType,
29                             Plugin::ProcessType>;
30   using ResultStore = std::map<ResultLine, std::optional<std::string>>;
31
32   void ClearResults();
33   void AddResult(const ResultLine& result,
34                  const std::optional<std::string> &error);
35   const ResultStore& GetResults() const;
36
37  private:
38   ResultStore results;
39 };
40
41 }  // namespace common_installer
42
43 #endif  // TEST_SMOKE_TESTS_LIBS_TEST_ASSESSOR_H_