← Back to team overview

kicad-developers team mailing list archive

[PATCH] qa_geometry tests

 

Hi,

Are the qa_geometry test supposed to all work?

When I run `qa_geometry`, I get 1160 errors like this:

error: in "ChamferFillet/Fillet": check { chainPoints.begin(),
chainPoints.end() } == { polyPoints.begin(), polyPoints.end() } has
failed.

Mismatch at position 0: [ 40 | 14 ] != [ 40 | 12 ]
Mismatch at position 1: [ 40 | 15 ] != [ 40 | 13 ]
Mismatch at position 2: [ 44 | 10 ] != [ 40 | 14 ]
Mismatch at position 3: [ 44 | 18 ] != [ 40 | 15 ]
Mismatch at position 4: [ 50 | 10 ] != [ 40 | 16 ]
Mismatch at position 5: [ 51 | 14 ] != [ 40 | 17 ]
Collections size mismatch: 6 != 25

Attached is a patch that enabled CTest tests and adds qa_geometry as a
test. Then you can run `make test` or `ctest` to run all tests. I
think it would be good to have a single unambigous and easily
understood command to be able to run unit tests?

This patch explicitly excludes the "ChamferFillet/Fillet" tests as
they are failing, but if those tests can be fixed, it would be good to
run them too.

Cheers,

John
From a6b98ecfd06529d7722a2834083d67a011741e63 Mon Sep 17 00:00:00 2001
From: John Beard <john.j.beard@xxxxxxxxx>
Date: Thu, 5 Jul 2018 11:11:57 +0100
Subject: [PATCH] Enable CTest tests and add qa_geometry as a test

This allows the use of `make test` or `ctest` to run all registered
tests.

The ChamferFillet/Fillet test is disabled for now as it fails.
---
 CMakeLists.txt             | 1 +
 qa/geometry/CMakeLists.txt | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f2ea761f9..60c22c2f4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -912,6 +912,7 @@ if( UNIX AND NOT APPLE )
 endif()
 
 #include( CTest )
+enable_testing()
 
 if( UNIX AND NOT APPLE )
 
diff --git a/qa/geometry/CMakeLists.txt b/qa/geometry/CMakeLists.txt
index b932bfb74..19ca8b91b 100644
--- a/qa/geometry/CMakeLists.txt
+++ b/qa/geometry/CMakeLists.txt
@@ -54,3 +54,7 @@ target_link_libraries(qa_geometry
 )
 
 add_dependencies( qa_geometry pcbnew )
+
+add_test( NAME geometry
+    COMMAND qa_geometry --run_test=!ChamferFillet/Fillet
+)
\ No newline at end of file
-- 
2.17.1


Follow ups