2 * Copyright © 2012 Intel Corporation
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
17 * Author: Benjamin Segovia <benjamin.segovia@intel.com>
22 * \author Benjamin Segovia <benjamin.segovia@intel.com>
24 * Just run the unit tests. The user can possibly provides the subset of it
26 #include "utest_helper.hpp"
27 #include "utest_exception.hpp"
31 static const char *shortopts = "c:lanh";
32 struct option longopts[] = {
33 {"casename", required_argument, NULL, 'c'},
34 {"list", no_argument, NULL, 'l'},
35 {"all", no_argument, NULL, 'a'},
36 {"allnoissue", no_argument, NULL, 'n'},
37 {"help", no_argument, NULL, 'h'},
45 ./utest_run <option>\n\
48 -c <casename>: run sub-case named 'casename'\n\
49 -l : list all the available case name\n\
50 -a : run all test cases\n\
51 -n : run all test cases without known issue (default option)\n\
52 -h : display this usage\n\
57 int main(int argc, char *argv[])
63 c = getopt_long (argc, argv, shortopts, longopts, NULL);
67 if (argc == 2 && c < 1 ){
80 std::cout << " " << e.what() << " [SUCCESS]" << std::endl;
86 UTest::listAllCases();
94 std::cout << " " << e.what() << " [SUCCESS]" << std::endl;
101 UTest::runAllBenchMark();
104 std::cout << " " << e.what() << " [SUCCESS]" << std::endl;
114 } while ((c = getopt_long (argc, argv, shortopts, longopts, NULL)) != -1);