← Back to team overview

kicad-developers team mailing list archive

Re: [PATCH] Pcbnew unit test framework

 

Hi JP,

Sorry, I thought that issue was just a side effect of conflicted
merges in these files, but maybe not. I had built this code on Linux
GCC, Windows Msys2 and MSVC on Simon's Jenkins with no issues, so I'm
working blind in trying to fix it.

I think it might be an issue with older CMakes, but I cannot test this
as I do not know of a CI target I could use to check. I am rebuilding
on Jenkins now, but since it takes an hour and doesn't even show the
error, I'd like to know if I have also fixed it for you.

Here's an attempt to fix it (replaces prior patch).

What is the right way for me to check these patches are correct in
future? It is frustrating to submit patches that break builds that I
have no way to predict or detect, and I'm sure it frustrating for
maintainers to waste so much time speculatively building patches and
replying to emails with the failures.

Cheers,

John

On Mon, Jan 7, 2019 at 11:42 AM jp charras <jp.charras@xxxxxxxxxx> wrote:
>
> Le 07/01/2019 à 12:33, John Beard a écrit :
> > Hi Seth,
> >
> > The revert commit (8f11a2133efd95526d1a3783dbaca76f732b8efb) also
> > killed the CMake add_subdirectory (because the original commit was
> > conflicted). Here is a patch to put it back in order (and put the
> > existing subdirs into some order).
> >
> > Cheers,
> >
> > John
> >
>
> Hi John,
>
> As previously reported, the add_subdirectory pcbnew breaks the windows
> build and some Linux builds.
>
> Please, first fix the the build issue in qa/pcbnew.
>
> Thanks.
>
>
> --
> Jean-Pierre CHARRAS
>
> _______________________________________________
> 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
From 5ba2710894311c56754e237607c5dbdb769b10c4 Mon Sep 17 00:00:00 2001
From: John Beard <john.j.beard@xxxxxxxxx>
Date: Mon, 7 Jan 2019 11:11:47 +0000
Subject: [PATCH] QA: Add pcbnew unit tests CMake subdir

Also modify the linkage of kiface objects, as this is not
supported by older CMake versions.

This was accidentally removed with the reversion of the application
of the wrong patch (8f11a2133).

QA: fix object files
---
 qa/CMakeLists.txt        | 7 ++++++-
 qa/pcbnew/CMakeLists.txt | 5 ++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/qa/CMakeLists.txt b/qa/CMakeLists.txt
index fd592f321..e0011ff77 100644
--- a/qa/CMakeLists.txt
+++ b/qa/CMakeLists.txt
@@ -12,13 +12,18 @@ if( KICAD_SCRIPTING_MODULES )
 
 endif()
 
-# common QA helpers
+# Shared QA helper libraries
 add_subdirectory( qa_utils )
 add_subdirectory( unit_test_utils )
 
+# Unit tests
 add_subdirectory( common )
+add_subdirectory( pcbnew )
 add_subdirectory( shape_poly_set_refactor )
+
+# Utility/test programs
 add_subdirectory( pcb_parse_input )
+
 # add_subdirectory( pcb_test_window )
 # add_subdirectory( polygon_triangulation )
 # add_subdirectory( polygon_generator )
diff --git a/qa/pcbnew/CMakeLists.txt b/qa/pcbnew/CMakeLists.txt
index 6402eea24..abaaa9f1f 100644
--- a/qa/pcbnew/CMakeLists.txt
+++ b/qa/pcbnew/CMakeLists.txt
@@ -36,6 +36,10 @@ add_executable( qa_pcbnew
 
     test_graphics_import_mgr.cpp
     test_pad_naming.cpp
+
+    # Older CMakes cannot link OBJECT libraries
+    # https://cmake.org/pipermail/cmake/2013-November/056263.html
+    $<TARGET_OBJECTS:pcbnew_kiface_objects>
 )
 
 if( BUILD_GITHUB_PLUGIN )
@@ -73,7 +77,6 @@ target_link_libraries( qa_pcbnew
     qa_utils
     lib_dxf
     idf3
-    pcbnew_kiface_objects
     unit_test_utils
     ${wxWidgets_LIBRARIES}
     ${GITHUB_PLUGIN_LIBRARIES}
-- 
2.20.1


Follow ups

References