source: rtems-tools/tester/covoar/Explanations.h @ f9a4b2c

5
Last change on this file since f9a4b2c was 100f517, checked in by Chris Johns <chrisj@…>, on 05/09/14 at 11:50:37

covoar: Merger the covoar source from rtems-testing.git.

Use waf to build covoar.

  • Property mode set to 100644
File size: 2.5 KB
Line 
1/*! @file Explanations.h
2 *  @brief Explanations Specification
3 *
4 *  This file contains the specification of the Explanations class.
5 */
6
7#ifndef __EXPLANATIONS_H__
8#define __EXPLANATIONS_H__
9
10#include <map>
11#include <stdint.h>
12#include <string>
13#include <vector>
14
15namespace Coverage {
16
17  /*! @class Explanation
18   *
19   *  This class defines the information that comprises an explanation
20   *  of an uncovered range or branch.
21   */
22  class Explanation {
23
24  public:
25
26    /*!
27     *  This member variable contains the starting line number of
28     *  the uncovered range or branch.
29     */
30    std::string startingPoint;
31
32    /*!
33     *  This member variable contains the classification of
34     *  the explanation.
35     */
36    std::string classification;
37
38    /*!
39     *  This member variable contains the multi-line explanation text.
40     */
41    std::vector<std::string> explanation;
42
43    /*!
44     *  This member variable indicates whether this explanation was
45     *  used during analysis.
46     */
47    bool found;
48
49    /*!
50     *  This method constructs an Explanation instance.
51     */
52    Explanation() {found = false;}
53
54    /*!
55     *  This method destructs an Explanation instance.
56     */
57    ~Explanation() {}
58  };
59
60  /*! @class Explanations
61   *
62   *  This class defines a set of Explanation instances.
63   */
64  class Explanations {
65
66  public:
67
68    /*!
69     *  This member variable contains a list of Explanation instances.
70     */
71    std::map<std::string, Explanation> set;
72
73    /*!
74     *  This method constructs an Explanations instance.
75     */
76    Explanations();
77
78    /*!
79     *  This method destructs an Explanations instance.
80     */
81    ~Explanations();
82
83    /*!
84     *  This methods loads the explanation information from the
85     *  specified file.
86     *
87     *  @param[in] explanations specifies the file name containing
88     *             the explanation information
89     */
90    void load(
91      const char* const explanations
92    );
93
94    /*!
95     *  This method returns the explanation associated with the
96     *  specified starting line number.
97     *
98     *  @param[in] start specifies the starting line number for
99     *             which to search
100     */
101    const Explanation *lookupExplanation(
102      std::string& start
103    );
104
105    /*!
106     *  This method writes a file that contains a list of any
107     *  explanations that were not looked up.
108     *
109     *  @param[in] fileName specifies the name of the file to write
110     */ 
111    void writeNotFound(
112      const char* const fileName
113    );
114
115  };
116
117}
118
119#endif
Note: See TracBrowser for help on using the repository browser.