Move test codes
[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 SMOKE_TESTS_LIBS_TEST_ASSESSOR_H_
6 #define SMOKE_TESTS_LIBS_TEST_ASSESSOR_H_
7
8 #include <boost/optional/optional.hpp>
9
10 #include <map>
11 #include <string>
12 #include <tuple>
13 #include <utility>
14
15 #include "common/plugins/plugin.h"
16 #include "common/utils/singleton.h"
17
18 namespace common_installer {
19
20 extern const char kTagPluginName[];
21 extern const char kCategoryPluginName[];
22 extern const char kMetadataPluginName[];
23 extern const char kTestPackageId[];
24 extern const char kTestApplicationId[];
25
26 class TestAssessor : public common_installer::Singleton<TestAssessor> {
27   CRTP_DECLARE_DEFAULT_CONSTRUCTOR_CLASS(TestAssessor)
28  public:
29   using ResultLine = std::tuple<std::string, Plugin::ActionType,
30                             Plugin::ProcessType>;
31   using ResultStore = std::map<ResultLine, boost::optional<std::string>>;
32
33   void ClearResults();
34   void AddResult(const ResultLine& result,
35                  const boost::optional<std::string> &error);
36   const ResultStore& GetResults() const;
37
38  private:
39   ResultStore results;
40 };
41
42 }  // namespace common_installer
43
44 #endif  // SMOKE_TESTS_LIBS_TEST_ASSESSOR_H_