KiCad PCB EDA Suite
Loading...
Searching...
No Matches
corpus.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#ifndef QA_DRC_BENCHMARK_CORPUS_H
21#define QA_DRC_BENCHMARK_CORPUS_H
22
23#include <vector>
24
25#include <wx/string.h>
26
27#include <drc/drc_rule.h>
28
29
36{
37 wxString board;
38 wxString rules;
39 wxString tier;
40 wxString source;
41 wxString notes;
42 bool quick = false;
43};
44
45
55class CORPUS
56{
57public:
59 static bool IsConfigured();
60
62 static wxString Root();
63
69 static bool Load( std::vector<CORPUS_ENTRY>& aEntries, wxString& aError );
70};
71
72
74const char* ConstraintTypeName( DRC_CONSTRAINT_T aType );
75
76
78const std::vector<DRC_CONSTRAINT_T>& AllConstraintTypes();
79
80
82const std::vector<wxString>& AllPredicateNames();
83
84
90std::vector<wxString> ScanPredicatesInRules( const wxString& aRulesText );
91
92
93#endif // QA_DRC_BENCHMARK_CORPUS_H
Read and resolve the corpus manifest pointed at by KICAD_DRC_BENCH_CORPUS.
Definition corpus.h:56
static bool Load(std::vector< CORPUS_ENTRY > &aEntries, wxString &aError)
Parse <root>/corpus.json into resolved entries.
Definition corpus.cpp:74
static bool IsConfigured()
True when KICAD_DRC_BENCH_CORPUS is set and names an existing directory.
Definition corpus.cpp:31
static wxString Root()
The resolved corpus root, or an empty string when unconfigured.
Definition corpus.cpp:42
const char * ConstraintTypeName(DRC_CONSTRAINT_T aType)
Human-readable token for a DRC_CONSTRAINT_T, matching the .kicad_dru keyword where one exists.
Definition corpus.cpp:151
std::vector< wxString > ScanPredicatesInRules(const wxString &aRulesText)
Scan raw .kicad_dru text for occurrences of each registered predicate name.
Definition corpus.cpp:257
const std::vector< wxString > & AllPredicateNames()
Every pcbexpr predicate registered in pcbexpr_functions.cpp, used for textual coverage scans.
Definition corpus.cpp:230
const std::vector< DRC_CONSTRAINT_T > & AllConstraintTypes()
Every DRC_CONSTRAINT_T the engine can carry rules for, in enum order, excluding NULL_CONSTRAINT.
Definition corpus.cpp:201
DRC_CONSTRAINT_T
Definition drc_rule.h:49
One board+rules pairing from the out-of-tree corpus manifest.
Definition corpus.h:36
wxString tier
Free-form tier tag from the manifest (A/B/C).
Definition corpus.h:39
wxString board
Absolute path to the .kicad_pcb.
Definition corpus.h:37
wxString rules
Absolute path to the .kicad_dru, or empty for none.
Definition corpus.h:38
wxString source
Provenance string for traceability.
Definition corpus.h:40
wxString notes
Free-form annotation.
Definition corpus.h:41
bool quick
Part of the fast iteration set selected by –quick.
Definition corpus.h:42