Commit Graph

11 Commits

Author SHA1 Message Date
jean-pierre charras decc7ed888 Try to fix a compil issue in qa test 2019-01-11 18:13:58 +01:00
John Beard dc71a73178 QA: Add unit test of SHAPE_ARC
Test a few "centre-point-angle" cases and add some
generic geom code for testing vectors and boxes are within
tolerance (since rounding often creeps in).

Much of the arc-checking code will be useful to other
construction methods (e.g. point-point-point).

There are expected failures for the bbox code when
the arc passes though, but does not end on, a quadrant point
(0, 90, 180, 270). This is due to a defective
implementation of SHAPE_ARC::BBox() that does not take
into account the quadrant points. This will be fixed
as a follow-up.
2019-01-10 07:52:25 -05:00
John Beard f86d953c80 QA: unit tests for file ext filters
This adds a unit test for the recent AddFileExtListToFilter
to demonstrate how to use it and the expected output.

The unit tests are a bit clunky, as the vararg approach cannot
work winth strings passed at runtime.
2019-01-09 08:57:29 -05:00
Seth Hillbrand 90ad240660 units: Move common units and add tests
Centralizing duplicate code from Eeschema and pcbnew and adding unit
tests
2019-01-08 09:29:32 -08:00
John Beard 49c723fc83 QA: Add numeric evaluator tests
Remove obsolete and unbuildable common/libeval/main.cpp
test program.
2018-12-03 08:39:21 +01:00
John Beard 5a0318968f Break zoom control into a self-contained controller
This is done to avoid a big chunk of conditionally-compiled code
in the middle of the event function.

Also separates the zoom logic from the WX_VIEW_CONTROLS object
and isolates it in a separate class behind a clearer interface.

Add some simple tests for sane steps on GTK+3-sized scroll
steps.
2018-11-26 14:40:09 -05:00
John Beard ee819216e2 QA: Make a separate unit test utils library, COLOR4D tests
This includes:

* Linkage against the Boost unit test libs
* Configuration of the Boost libs
* A place for common generics "extras" for unit test harnesses
  including
    * A simple way to allow "expected-failure" tests (without
      breaking Boost < 1.58, e.g. Ubuntu LTS)
    * Moving some simple numeric predicates from the geom tests
      to the utils library.

Expand unit test docs to describe the expected failures macro.

Add a few COLOR4D tests, including one with expected failures due
to a pre-existing bug. This will be fixed in a follow-up commit.
2018-11-08 14:40:42 -05:00
John Beard 5660ad86ea QA: Add TITLE_BLOCK tests
Add some unit tests on TITLE_BLOCK

This commit also requires some mocks so the libcommon stuff
can work:

* Needs a Kiface() function to be linkable
* Needs some stuff from common to be build specially
* Needs to define itself as one of the unit-having programs
  to appease the units defines.
2018-11-08 08:28:20 -05:00
John Beard 4f0166e064 Add some hotkey store tests
This also adds some mocks to the libcommon test executable, which
hopefully will allow it to work with more of libcommon.
2018-09-28 08:27:57 -04:00
John Beard 04a1084549 QA: Place UTF8 tests under Boost unit tests
This transfers the old #if'd-out tests in utf8.cpp into a
proper Boost unit test in /qa (run on `make test`).
2018-09-26 09:32:26 -04:00
John Beard 9c78ef5784 QA: Make a generic common test suite
* Renames /qa/common to /qa/qa_utils, as it is not to do with /common
* Renames /qa/geometry to /qa/common
* Put existing geometry tests into a subdirectory of /qa/common, to
  echo the layout of the main tree.

The intention is to provide a place to put tests of other libcommon
code in the /qa/common suite.
2018-09-26 09:32:18 -04:00
Renamed from qa/geometry/CMakeLists.txt (Browse further)