KiCad PCB EDA Suite
drc_proto_test.cpp File Reference
#include <string>
#include <common.h>
#include <profile.h>
#include <wx/cmdline.h>
#include <wx/init.h>
#include <property_mgr.h>
#include <pgm_base.h>
#include "drc_proto.h"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 38 of file drc_proto_test.cpp.

39 {
40  wxInitialize( argc, argv );
41 
42  Pgm().InitPgm( true );
43 
45  propMgr.Rebuild();
46 
47  if( argc < 2 )
48  {
49  printf("usage: %s <project-file/board-file> [drc-rules-file]\n", argv[0] );
50  Pgm().Destroy();
51  wxUninitialize();
52  return -1;
53  }
54 
55  PROJECT_CONTEXT project = loadKicadProject( argv[1], argv[2] ? wxString( argv[2] ) : OPT<wxString>() );
56 
57  // This causes some glib warnings on GTK3 (http://trac.wxwidgets.org/ticket/18274)
58  // but without it, Valgrind notices a lot of leaks from WX
59 
60  runDRCProto( project );
61 
62  Pgm().Destroy();
63 
64  wxUninitialize();
65 
66  return 0;
67 }
void Rebuild()
Rebuild the list of all registered properties.
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:65
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:106
PROJECT_CONTEXT loadKicadProject(const wxString &filename, OPT< wxString > rulesFilePath)
Definition: drc_proto.cpp:59
int runDRCProto(PROJECT_CONTEXT project, std::shared_ptr< KIGFX::VIEW_OVERLAY > aDebugOverlay)
Definition: drc_proto.cpp:103
boost::optional< T > OPT
Definition: optional.h:7
Provide class metadata.Helper macro to map type hashes to names.
Definition: property_mgr.h:62

References PROPERTY_MANAGER::Instance(), loadKicadProject(), Pgm(), project, PROPERTY_MANAGER::Rebuild(), and runDRCProto().