kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #39131
Re: [RFC] Pcbnew tests/utils
-
To:
kicad-developers@xxxxxxxxxxxxxxxxxxx
-
From:
Wayne Stambaugh <stambaughw@xxxxxxxxx>
-
Date:
Wed, 23 Jan 2019 11:09:00 -0500
-
In-reply-to:
<CAG1r56Kpu4Zr8x=N+psa=6qfUGsk-q1sB0H4p8L8Gx-Tih3J6w@mail.gmail.com>
-
User-agent:
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0
Hey John,
I'm getting a bunch of build errors on windows. It looks like it's
having issues finding std::set.
In file included from
C:/msys64/home/wstambaugh/src/kicad-trunk/qa/common/test_color4d.cpp:28:0:
C:/msys64/home/wstambaugh/src/kicad-trunk/qa/unit_test_utils/include/unit_test_utils/unit_test_utils.h:
In function 'void KI_TEST::CheckUnorderedMatches(const EXP_CONT&, const
FOUND_CONT&, MATCH_PRED)':
C:/msys64/home/wstambaugh/src/kicad-trunk/qa/unit_test_utils/include/unit_test_utils/unit_test_utils.h:124:10:
error: 'set' is not a member of 'std'
std::set<const EXP_OBJ*> matched;
^~~
C:/msys64/home/wstambaugh/src/kicad-trunk/qa/unit_test_utils/include/unit_test_utils/unit_test_utils.h:124:10:
note: suggested alternative: 'get'
std::set<const EXP_OBJ*> matched;
^~~
get
C:/msys64/home/wstambaugh/src/kicad-trunk/qa/unit_test_utils/include/unit_test_utils/unit_test_utils.h:124:14:
error: expected primary-expression before 'const'
std::set<const EXP_OBJ*> matched;
^~~~~
C:/msys64/home/wstambaugh/src/kicad-trunk/qa/unit_test_utils/include/unit_test_utils/unit_test_utils.h:133:17:
error: 'matched' was not declared in this scope
matched.insert( &expected );
^~~~~~~
C:/msys64/home/wstambaugh/src/kicad-trunk/qa/unit_test_utils/include/unit_test_utils/unit_test_utils.h:133:17:
note: suggested alternative: 'matherr'
matched.insert( &expected );
^~~~~~~
matherr
In file included from
C:/msys64/mingw32/include/boost/test/test_tools.hpp:45:0,
from C:/msys64/mingw32/include/boost/test/unit_test.hpp:18,
from
C:/msys64/mingw32/include/boost/test/test_case_template.hpp:13,
from
C:/msys64/home/wstambaugh/src/kicad-trunk/qa/common/test_color4d.cpp:24:
C:/msys64/home/wstambaugh/src/kicad-trunk/qa/unit_test_utils/include/unit_test_utils/unit_test_utils.h:142:30:
error: 'matched' was not declared in this scope
BOOST_CHECK_MESSAGE( matched.count( &exp ) > 0, "Expected item
was not found. Expected: \n"
^
C:/msys64/home/wstambaugh/src/kicad-trunk/qa/unit_test_utils/include/unit_test_utils/unit_test_utils.h:142:30:
note: suggested alternative: 'matherr'
In file included from
C:/msys64/home/wstambaugh/src/kicad-trunk/qa/common/test_color4d.cpp:28:0:
C:/msys64/home/wstambaugh/src/kicad-trunk/qa/unit_test_utils/include/unit_test_utils/unit_test_utils.h:147:33:
error: 'matched' was not declared in this scope
for( const EXP_OBJ* found : matched )
^~~~~~~
C:/msys64/home/wstambaugh/src/kicad-trunk/qa/unit_test_utils/include/unit_test_utils/unit_test_utils.h:147:33:
note: suggested alternative: 'matherr'
for( const EXP_OBJ* found : matched )
^~~~~~~
matherr
[ 66%] Built target qa_common_tools
In file included from
C:/msys64/home/wstambaugh/src/kicad-trunk/qa/common/test_color4d.cpp:28:0:
C:/msys64/home/wstambaugh/src/kicad-trunk/qa/unit_test_utils/include/unit_test_utils/unit_test_utils.h:
In function 'void KI_TEST::CheckUnorderedMatches(const EXP_CONT&, const
FOUND_CONT&, MATCH_PRED)':
C:/msys64/home/wstambaugh/src/kicad-trunk/qa/unit_test_utils/include/unit_test_utils/unit_test_utils.h:124:10:
error: 'set' is not a member of 'std'
std::set<const EXP_OBJ*> matched;
^~~
C:/msys64/home/wstambaugh/src/kicad-trunk/qa/unit_test_utils/include/unit_test_utils/unit_test_utils.h:124:10:
note: suggested alternative: 'get'
std::set<const EXP_OBJ*> matched;
^~~
get
C:/msys64/home/wstambaugh/src/kicad-trunk/qa/unit_test_utils/include/unit_test_utils/unit_test_utils.h:124:14:
error: expected primary-expression before 'const'
std::set<const EXP_OBJ*> matched;
^~~~~
C:/msys64/home/wstambaugh/src/kicad-trunk/qa/unit_test_utils/include/unit_test_utils/unit_test_utils.h:133:17:
error: 'matched' was not declared in this scope
matched.insert( &expected );
^~~~~~~
C:/msys64/home/wstambaugh/src/kicad-trunk/qa/unit_test_utils/include/unit_test_utils/unit_test_utils.h:133:17:
note: suggested alternative: 'matherr'
matched.insert( &expected );
^~~~~~~
matherr
In file included from
C:/msys64/mingw32/include/boost/test/test_tools.hpp:45:0,
from C:/msys64/mingw32/include/boost/test/unit_test.hpp:18,
from
C:/msys64/mingw32/include/boost/test/test_case_template.hpp:13,
from
C:/msys64/home/wstambaugh/src/kicad-trunk/qa/common/test_color4d.cpp:24:
C:/msys64/home/wstambaugh/src/kicad-trunk/qa/unit_test_utils/include/unit_test_utils/unit_test_utils.h:142:30:
error: 'matched' was not declared in this scope
BOOST_CHECK_MESSAGE( matched.count( &exp ) > 0, "Expected item
was not found. Expected: \n"
^
C:/msys64/home/wstambaugh/src/kicad-trunk/qa/unit_test_utils/include/unit_test_utils/unit_test_utils.h:142:30:
note: suggested alternative: 'matherr'
In file included from
C:/msys64/home/wstambaugh/src/kicad-trunk/qa/common/test_color4d.cpp:28:0:
C:/msys64/home/wstambaugh/src/kicad-trunk/qa/unit_test_utils/include/unit_test_utils/unit_test_utils.h:147:33:
error: 'matched' was not declared in this scope
for( const EXP_OBJ* found : matched )
^~~~~~~
C:/msys64/home/wstambaugh/src/kicad-trunk/qa/unit_test_utils/include/unit_test_utils/unit_test_utils.h:147:33:
note: suggested alternative: 'matherr'
for( const EXP_OBJ* found : matched )
^~~~~~~
matherr
[ 66%] Linking CXX executable gerbview.exe
In file included from
C:/msys64/home/wstambaugh/src/kicad-trunk/qa/common/test_color4d.cpp:28:0:
C:/msys64/home/wstambaugh/src/kicad-trunk/qa/unit_test_utils/include/unit_test_utils/unit_test_utils.h:
In function 'void KI_TEST::CheckUnorderedMatches(const EXP_CONT&, const
FOUND_CONT&, MATCH_PRED)':
C:/msys64/home/wstambaugh/src/kicad-trunk/qa/unit_test_utils/include/unit_test_utils/unit_test_utils.h:124:10:
error: 'set' is not a member of 'std'
std::set<const EXP_OBJ*> matched;
^~~
C:/msys64/home/wstambaugh/src/kicad-trunk/qa/unit_test_utils/include/unit_test_utils/unit_test_utils.h:124:10:
note: suggested alternative: 'get'
std::set<const EXP_OBJ*> matched;
^~~
get
C:/msys64/home/wstambaugh/src/kicad-trunk/qa/unit_test_utils/include/unit_test_utils/unit_test_utils.h:124:14:
error: expected primary-expression before 'const'
std::set<const EXP_OBJ*> matched;
^~~~~
C:/msys64/home/wstambaugh/src/kicad-trunk/qa/unit_test_utils/include/unit_test_utils/unit_test_utils.h:133:17:
error: 'matched' was not declared in this scope
matched.insert( &expected );
^~~~~~~
C:/msys64/home/wstambaugh/src/kicad-trunk/qa/unit_test_utils/include/unit_test_utils/unit_test_utils.h:133:17:
note: suggested alternative: 'matherr'
matched.insert( &expected );
^~~~~~~
matherr
In file included from
C:/msys64/mingw32/include/boost/test/test_tools.hpp:45:0,
from C:/msys64/mingw32/include/boost/test/unit_test.hpp:18,
from
C:/msys64/mingw32/include/boost/test/test_case_template.hpp:13,
from
C:/msys64/home/wstambaugh/src/kicad-trunk/qa/common/test_color4d.cpp:24:
C:/msys64/home/wstambaugh/src/kicad-trunk/qa/unit_test_utils/include/unit_test_utils/unit_test_utils.h:142:30:
error: 'matched' was not declared in this scope
BOOST_CHECK_MESSAGE( matched.count( &exp ) > 0, "Expected item
was not found. Expected: \n"
^
C:/msys64/home/wstambaugh/src/kicad-trunk/qa/unit_test_utils/include/unit_test_utils/unit_test_utils.h:142:30:
note: suggested alternative: 'matherr'
In file included from
C:/msys64/home/wstambaugh/src/kicad-trunk/qa/common/test_color4d.cpp:28:0:
C:/msys64/home/wstambaugh/src/kicad-trunk/qa/unit_test_utils/include/unit_test_utils/unit_test_utils.h:147:33:
error: 'matched' was not declared in this scope
for( const EXP_OBJ* found : matched )
^~~~~~~
C:/msys64/home/wstambaugh/src/kicad-trunk/qa/unit_test_utils/include/unit_test_utils/unit_test_utils.h:147:33:
note: suggested alternative: 'matherr'
for( const EXP_OBJ* found : matched )
^~~~~~~
matherr
On 1/22/2019 1:12 PM, John Beard wrote:
> Hi,
>
> Thanks Wayne for merging the utility program stuff.
>
> This brings me onto the subject of PCB utility programs in the same
> vein. Attached are some fun patches:
>
> 1) Some DRC-related groundwork
> 2) A Pcbnew unit test that can test a DRC function and the breaking
> out of the courtyard DRC functions. Also makes a so called
> "qa_pcbnew_utils" "library" *In theory* that can be shared between
> Pcbnew unit tests and Pcbnew utility programs.
> 3) A Pcbnew DRC util that allows to run the courtyard DRC (broken out
> in #2) from the command line. This is essentially what I used to
> generate the benchmarks the other day. Also can be used for fuzz
> testing, as well as debugging, developing and profiling.
> 4) Port the PCB parser utility over to the same executable.
>
> To run the DRC util, for example, with timing and marker information:
>
> $ qa/pcbnew_tools/qa_pcbnew_tools drc -vtm --courtyard-overlap
> --courtyard-missing /path/to/pcb.kicad_pcb
> Parsing: /path/to/pcb.kicad_pcb
> Running DRC check: Courtyard overlap
> Took: 1736us
> DRC markers: 1
> 0: ErrType(45): Courtyards overlap
> @(24.500 mm, 20.000 mm): Footprint <no reference> on F.Cu
> @(23.600 mm, 20.000 mm): Footprint <no reference> on F.Cu
> Running DRC check: Courtyard missing
> Took: 131us
> DRC markers: 0
>
> However, I have had the traditional difficulty getting this to link
> using a library for "qa_pcbnew_utils". What is in the patch #2 is a
> nasty and heinous hack that just about gets it working on
> Linux/Msys2/MSVC, but it's highly sub-optimal (it just puts the files
> and link_libraries in variables :s) So, that's why this is an "RFC":
> any ideas for getting this to work properly will be highly
> appreciated.
>
> Also, because this uses the same way of linking into pcbnew, it's even
> *more* brutal on the RAM needs at link-time: the targets "pcbnew",
> "qa_pcbnew" (unit tests) and "qa_pcbnew_tools" (the discussed utility
> tools) are all quite slow.
>
> Cheers,
>
> John
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help : https://help.launchpad.net/ListHelp
>
Follow ups
References