2 * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 * @file test_results_collector_commons.h
18 * @author Marcin Niesluchowski (m.niesluchow@samsung.com)
20 * @brief Header file containing declarations of collectors common
21 * functions and macros
24 #ifndef DPL_TEST_RESULTS_COLLECTOR_COMMONS_H
25 #define DPL_TEST_RESULTS_COLLECTOR_COMMONS_H
33 #define GREEN_RESULT_OK "[%s%s%s]\n", BOLD_GREEN_BEGIN, " OK ", \
35 #define GREEN_RESULT_OK_TIME "[%s%s%s] [elapsed: %0.3fms]\n", BOLD_GREEN_BEGIN, \
36 " OK ", BOLD_GREEN_END
37 #define GREEN_RESULT_OK_TIME_MAX(elapsed, max) \
38 "[%s%s%s] %s[elapsed: %0.3fms, expected < %0.3fms]%s\n", BOLD_GREEN_BEGIN, \
39 " OK ", BOLD_GREEN_END, BOLD_GREEN_BEGIN, elapsed, max, BOLD_GREEN_END
40 #define GREEN_RESULT_OK_TIME_TOO_LONG(elapsed, max) \
41 "[%s%s%s] %s[elapsed: %0.3fms, expected < %0.3fms]%s\n", BOLD_GREEN_BEGIN, \
42 " OK ", BOLD_GREEN_END, BOLD_RED_BEGIN, elapsed, max, BOLD_RED_END
44 // Get duration as a fraction of millisecond (max precision is 1 microsecond)
45 double get_milliseconds (const std::chrono::system_clock::duration& performanceTime);
47 bool ParseCollectorFileArg(const std::string &arg, std::string &filename);
52 #endif // DPL_TEST_RESULTS_COLLECTOR_COMMONS_H