2 * Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of version 2 of the GNU General Public License as
6 * published by the Free Software Foundation.
8 * This program is distributed in the hope that it would be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 * Further, this software is distributed without any warranty that it is
13 * free of the rightful claim of any third person regarding infringement
14 * or the like. Any license provided herein, whether implied or
15 * otherwise, applies only to this software file. Patent licenses, if
16 * any, provided herein do not apply to combinations of this program with
17 * other software, or any other product whatsoever.
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write the Free Software Foundation, Inc., 59
21 * Temple Place - Suite 330, Boston MA 02111-1307, USA.
23 * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
24 * Mountain View, CA 94043, or:
28 * For further information regarding this notice, see:
30 * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
33 /* $Id: ltp-scanner.c,v 1.1 2009/05/19 09:39:11 subrata_modak Exp $ */
35 * An RTS/pan driver output processing program.
37 * This program reads an RTS/pan driver output format file, parses it using lex
38 * and saves the information into an in-memory hierarchical keyword table.
40 * The reporting segment of the program reads that keyword table to produce
44 * ltp-scanner [ -e ] [ -D area:level ] [ -h ]
47 * Scanner is part of the RTS 2.0 reporting mechanism or pan.
48 * It processes RTS/pan driver format output and produces a single simple report
49 * of each test tag executed, the TCIDs it executed, and their testcases.
53 * use an "extended" output format
56 * enable debug statements. Areas are listed in report2.h and levels
57 * are in the code. Must be compiled with "-DDEBUGGING"
60 * print out a command usage statement and exit.
63 * The input must conform to the RTS/pan driver format.
66 * A single report style is used. It consists of a header made of all
67 * keywords in the rts_keywords fields of the driver output, and the test
69 * interpretation of CUTS "number of testcases" field when there are
70 * multiple TCIDs. It must be the sum of all TCIDs' testcases.
72 * System Configuration:
73 * ARCHITECTURE IOS_MODEL_E CRAY_YMP YMP7XX
74 * CONFIG JOBCNTL AVL BMD EMA HPM SECURE TFM_UDB_6 SDS SSD
76 * UNAME sn1703c cool 8.2.0ae d82.25
79 * tag tcid testcase status contact
80 * ------------------------------------------------------------------------
82 * When a report is made for only a tag, the TCID and Testcase fields
83 * contain a dash ( "-" ). The intention is that the output be usable
84 * by other Unix programs.
86 * When a report is made for all TCIDs and Testcases, a star ( "*" ) is used.
88 * When in extended mode, an additional output line is produced for each
91 * This line is identified with a "!" in the TCID and Testcase fields.
93 * It has no minimum and maximum field widths, so the output does not
96 * the "status" field contains the initiation status
98 * the "contact" field does not expand multiple comma-separated contacts
101 * tag, tcid, testcase, status, contact,
102 * start time, duration, termination type, termination id,
103 * output starting line, output ending line
106 * Regression Test System Phase 2 Test Result Reporting System
109 * Glen Overby wrote the code.
111 * Internal Data Format
112 * All data is maintained in a hierarchical key database. While there are
113 * many available databases, this impliments a simple ASCII comma-separated
117 * - The top-level keys are named after the RTS or pan test tags.
118 * - The top-level key named "_RTS" contains the RTS Keywords
119 * - Each tag has a "_keys" tag that contains the key fields from
120 * the TEST_START and EXECUTION_STATUS fields.
131 #include "reporter.h"
134 char *cnf
; /* current filename */
135 int extended
=0; /* -e option */
137 int main(int argc
, char *argv
[])
139 SYM tags
; /* tag data */
142 while ((c
= getopt(argc
, argv
, "D:ehi")) != -1) {
154 fprintf(stderr
, "%s [-e] [-i] [ -D area, level ] input-filenames\n",
158 fprintf(stderr
, "invalid argument, %c\n", c
);
163 lex_files(&argv
[optind
]); /* I hope that argv[argc+1] == NULL */
164 tags
= sym_open(0, 0, 0);