1 /* 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 3 * 4 * Use of this source code is governed by a BSD-style license 5 * that can be found in the LICENSE file in the root of the source 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 #ifndef WEBRTC_VIDEO_ENGINE_MAIN_TEST_AUTOTEST_INTERFACE_VIE_AUTOTEST_MAIN_H_ 12 #define WEBRTC_VIDEO_ENGINE_MAIN_TEST_AUTOTEST_INTERFACE_VIE_AUTOTEST_MAIN_H_ 13 14 #include <string> 15 #include <map> 16 17 class ViEAutoTestMain { 18 public: 19 ViEAutoTestMain(); 20 21 // Runs the test according to the specified arguments. 22 // Pass in --automated to run in automated mode; interactive 23 // mode is default. All usual googletest flags also apply. 24 int RunTests(int argc, char** argv); 25 26 private: 27 std::map<int, std::string> index_to_test_method_map_; 28 29 static const int kInvalidChoice = -1; 30 31 // Starts interactive mode. 32 int RunInteractiveMode(); 33 // Prompts the user for a specific test method in the provided test case. 34 // Returns 0 on success, nonzero otherwise. 35 int RunSpecificTestCaseIn(const std::string test_case_name); 36 // Asks the user for a particular test case to run. 37 int AskUserForTestCase(); 38 // Retrieves a number from the user in the interval 39 // [min_allowed, max_allowed]. Returns kInvalidChoice on failure. 40 int AskUserForNumber(int min_allowed, int max_allowed); 41 // Runs all tests matching the provided filter. * are wildcards. 42 // Returns the test runner result (0 == OK). 43 int RunTestMatching(const std::string test_case, 44 const std::string test_method); 45 // Runs a non-gtest test case. Choice must be [7,9]. Returns 0 on success. 46 int RunSpecialTestCase(int choice); 47 }; 48 49 #endif // WEBRTC_VIDEO_ENGINE_MAIN_TEST_AUTOTEST_INTERFACE_VIE_AUTOTEST_MAIN_H_ 50