/* * Copyright (C) 2006, Intel Corporation * * This file is part of the Linux-ready Firmware Developer Kit * * This program file is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by the * Free Software Foundation;version 2.1 of the License. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program in a file named COPYING; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA */ #include #include #include #include #include void do_start_test(int argc, char **argv) { start_test(argv[1], argv[2], argv[3]); } void do_report_result(int argc, char **argv) { int result = 0; char *argv3 = NULL, *argv4 = NULL, *argv5 = NULL; if (argc>=3) argv3=argv[3]; if (argc>=4) argv4=argv[4]; if (argc>=5) argv5=argv[5]; if (strstr(argv[2],"FAIL")) result = FAIL; if (strstr(argv[2],"WARN")) result = WARN; if (strstr(argv[2],"INFO")) result = INFO; report_result(argv[1], result, argv3, argv4, argv5); } void do_finish_test(int argc, char **argv) { finish_test(argv[1]); } void do_report_testrun_progress(int argc, char **argv) { int percent; percent = strtoull(argv[1], NULL, 10); report_testrun_progress(percent); } void do_announce_resource(int argc, char **argv) { char *argv3 = NULL; if (argc>=3) argv3 = argv[3]; announce_resource(argv[1], argv[2], argv3); } int main(int argc, char **argv) { if (strcmp(argv[0],"start_test")==0 && argc>=3) do_start_test(argc, argv); if (strcmp(argv[0],"report_result")==0 && argc>=2) do_report_result(argc, argv); if (strcmp(argv[0],"finish_test")==0 && argc>=1) do_finish_test(argc, argv); if (strcmp(argv[0],"report_testrun_progress")==0 && argc>=1) do_report_testrun_progress(argc, argv); if (strcmp(argv[0],"announce_resource")==0 && argc>=2) do_announce_resource(argc, argv); return 0; }