Ensure all QA tests on windows use a manifest
We want UTF8 mode enabled via manifest for accurate behavior that matches the application
This commit is contained in:
parent
28179296db
commit
8fd524aec1
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
find_package( wxWidgets 3.0.0 COMPONENTS gl aui adv html core net base xml stc REQUIRED )
|
find_package( wxWidgets 3.0.0 COMPONENTS gl aui adv html core net base xml stc REQUIRED )
|
||||||
|
|
||||||
set( common_srcs
|
set( QA_COMMON_SRCS
|
||||||
# This is needed for the global mock objects
|
# This is needed for the global mock objects
|
||||||
${CMAKE_SOURCE_DIR}/qa/mocks/kicad/common_mocks.cpp
|
${CMAKE_SOURCE_DIR}/qa/mocks/kicad/common_mocks.cpp
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ set( common_srcs
|
||||||
view/test_zoom_controller.cpp
|
view/test_zoom_controller.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
set( common_libs
|
set( QA_COMMON_LIBS
|
||||||
common
|
common
|
||||||
libcontext
|
libcontext
|
||||||
gal
|
gal
|
||||||
|
@ -62,10 +62,23 @@ set( common_libs
|
||||||
${wxWidgets_LIBRARIES}
|
${wxWidgets_LIBRARIES}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if( WIN32 )
|
||||||
|
# We want to declare a resource manifest on Windows to enable UTF8 mode
|
||||||
|
# Without UTF8 mode, some random IO tests may fail, we set the active code page on normal kicad to UTF8 as well
|
||||||
|
if( MINGW )
|
||||||
|
# QA_COMMON_RESOURCES variable is set by the macro.
|
||||||
|
mingw_resource_compiler( qa_common )
|
||||||
|
else()
|
||||||
|
set( QA_COMMON_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/qa_common.rc )
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
# Test executable for non-program-specific code
|
# Test executable for non-program-specific code
|
||||||
add_executable( qa_common ${common_srcs} )
|
add_executable( qa_common
|
||||||
target_link_libraries( qa_common ${common_libs} )
|
${QA_COMMON_SRCS}
|
||||||
|
${QA_COMMON_RESOURCES} )
|
||||||
|
target_link_libraries( qa_common ${QA_COMMON_LIBS} )
|
||||||
|
|
||||||
include_directories(
|
include_directories(
|
||||||
${CMAKE_SOURCE_DIR}
|
${CMAKE_SOURCE_DIR}
|
||||||
|
|
|
@ -94,8 +94,20 @@ if( KICAD_SPICE )
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if( WIN32 )
|
||||||
|
# We want to declare a resource manifest on Windows to enable UTF8 mode
|
||||||
|
# Without UTF8 mode, some random IO tests may fail, we set the active code page on normal kicad to UTF8 as well
|
||||||
|
if( MINGW )
|
||||||
|
# QA_EESCHEMA_RESOURCES variable is set by the macro.
|
||||||
|
mingw_resource_compiler( qa_eeschema )
|
||||||
|
else()
|
||||||
|
set( QA_EESCHEMA_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/qa_eeschema.rc )
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
add_executable( qa_eeschema
|
add_executable( qa_eeschema
|
||||||
${QA_EESCHEMA_SRCS}
|
${QA_EESCHEMA_SRCS}
|
||||||
|
${QA_EESCHEMA_RESOURCES}
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries( qa_eeschema
|
target_link_libraries( qa_eeschema
|
||||||
|
|
|
@ -28,13 +28,20 @@ set( QA_GERBVIEW_SRCS
|
||||||
${CMAKE_SOURCE_DIR}/qa/unittests/common/test_format_units.cpp
|
${CMAKE_SOURCE_DIR}/qa/unittests/common/test_format_units.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if( WIN32 )
|
||||||
|
# We want to declare a resource manifest on Windows to enable UTF8 mode
|
||||||
|
# Without UTF8 mode, some random IO tests may fail, we set the active code page on normal kicad to UTF8 as well
|
||||||
|
if( MINGW )
|
||||||
|
# QA_GERBVIEW_RESOURCES variable is set by the macro.
|
||||||
|
mingw_resource_compiler( qa_gerbview )
|
||||||
|
else()
|
||||||
|
set( QA_GERBVIEW_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/qa_gerbview.rc )
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
add_executable( qa_gerbview
|
add_executable( qa_gerbview
|
||||||
${QA_GERBVIEW_SRCS}
|
${QA_GERBVIEW_SRCS}
|
||||||
|
${QA_GERBVIEW_RESOURCES}
|
||||||
# In order to enable this, the actual Gerbview kiface build must be updated to match pcbnew's
|
|
||||||
# Older CMakes cannot link OBJECT libraries
|
|
||||||
# https://cmake.org/pipermail/cmake/2013-November/056263.html
|
|
||||||
$<TARGET_OBJECTS:gerbview_kiface_objects>
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Gerbview tests, so pretend to be gerbview (for units, etc)
|
# Gerbview tests, so pretend to be gerbview (for units, etc)
|
||||||
|
@ -52,6 +59,7 @@ target_include_directories( qa_gerbview PRIVATE
|
||||||
add_dependencies( qa_gerbview gerbview )
|
add_dependencies( qa_gerbview gerbview )
|
||||||
|
|
||||||
target_link_libraries( qa_gerbview
|
target_link_libraries( qa_gerbview
|
||||||
|
gerbview_kiface_objects
|
||||||
pcbcommon
|
pcbcommon
|
||||||
gal
|
gal
|
||||||
common
|
common
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
#
|
#
|
||||||
# Unit tests for KiCad math routines.
|
# Unit tests for KiCad math routines.
|
||||||
|
|
||||||
set( KIMATH_SRCS
|
set( QA_KIMATH_SRCS
|
||||||
kimath_test_module.cpp
|
kimath_test_module.cpp
|
||||||
|
|
||||||
test_kimath.cpp
|
test_kimath.cpp
|
||||||
|
@ -43,7 +43,21 @@ set( KIMATH_SRCS
|
||||||
math/test_util.cpp
|
math/test_util.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable( qa_kimath ${KIMATH_SRCS} )
|
if( WIN32 )
|
||||||
|
# We want to declare a resource manifest on Windows to enable UTF8 mode
|
||||||
|
# Without UTF8 mode, some random IO tests may fail, we set the active code page on normal kicad to UTF8 as well
|
||||||
|
if( MINGW )
|
||||||
|
# QA_KIMATH_RESOURCES variable is set by the macro.
|
||||||
|
mingw_resource_compiler( qa_kimath )
|
||||||
|
else()
|
||||||
|
set( QA_KIMATH_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/qa_kimath.rc )
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_executable( qa_kimath
|
||||||
|
${QA_KIMATH_SRCS}
|
||||||
|
${QA_KIMATH_RESOURCES}
|
||||||
|
)
|
||||||
|
|
||||||
target_link_libraries( qa_kimath
|
target_link_libraries( qa_kimath
|
||||||
qa_utils
|
qa_utils
|
||||||
|
|
|
@ -55,8 +55,20 @@ set( QA_PCBNEW_SRCS
|
||||||
group_saveload.cpp
|
group_saveload.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if( WIN32 )
|
||||||
|
# We want to declare a resource manifest on Windows to enable UTF8 mode
|
||||||
|
# Without UTF8 mode, some random IO tests may fail, we set the active code page on normal kicad to UTF8 as well
|
||||||
|
if( MINGW )
|
||||||
|
# QA_PCBNEW_RESOURCES variable is set by the macro.
|
||||||
|
mingw_resource_compiler( qa_pcbnew )
|
||||||
|
else()
|
||||||
|
set( QA_PCBNEW_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/qa_pcbnew.rc )
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
add_executable( qa_pcbnew
|
add_executable( qa_pcbnew
|
||||||
${QA_PCBNEW_SRCS}
|
${QA_PCBNEW_SRCS}
|
||||||
|
${QA_PCBNEW_RESOURCES}
|
||||||
)
|
)
|
||||||
|
|
||||||
# Pcbnew tests, so pretend to be pcbnew (for units, etc)
|
# Pcbnew tests, so pretend to be pcbnew (for units, etc)
|
||||||
|
|
|
@ -35,7 +35,20 @@ if( MINGW )
|
||||||
list( APPEND K2S_TEST_SRCS ${CMAKE_SOURCE_DIR}/common/streamwrapper.cpp )
|
list( APPEND K2S_TEST_SRCS ${CMAKE_SOURCE_DIR}/common/streamwrapper.cpp )
|
||||||
endif( MINGW )
|
endif( MINGW )
|
||||||
|
|
||||||
add_executable( qa_kicad2step ${K2S_TEST_SRCS} )
|
if( WIN32 )
|
||||||
|
# We want to declare a resource manifest on Windows to enable UTF8 mode
|
||||||
|
# Without UTF8 mode, some random IO tests may fail, we set the active code page on normal kicad to UTF8 as well
|
||||||
|
if( MINGW )
|
||||||
|
# QA_KICAD2STEP_RESOURCES variable is set by the macro.
|
||||||
|
mingw_resource_compiler( qa_kicad2step )
|
||||||
|
else()
|
||||||
|
set( QA_KICAD2STEP_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/qa_kicad2step.rc )
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_executable( qa_kicad2step
|
||||||
|
${K2S_TEST_SRCS}
|
||||||
|
${QA_KICAD2STEP_RESOURCES} )
|
||||||
|
|
||||||
target_link_libraries( qa_kicad2step
|
target_link_libraries( qa_kicad2step
|
||||||
kicad2step_lib
|
kicad2step_lib
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
icon_qa_common ICON "../resources/bitmaps_png/icons/icon_kicad.ico"
|
||||||
|
|
||||||
|
#define RC_VER_FILE_DESCRIPTION "KiCad QA Common " KICAD_WIN32_RC_PRODVER_STR
|
||||||
|
#define RC_VER_INTERNALNAME "qa_common"
|
||||||
|
#define RC_VER_ORIGINALFILENAME "qa_common.exe"
|
||||||
|
|
||||||
|
#include "kiwin32.rc"
|
|
@ -0,0 +1,7 @@
|
||||||
|
icon_qa_eeschema ICON "../resources/bitmaps_png/icons/icon_eeschema.ico"
|
||||||
|
|
||||||
|
#define RC_VER_FILE_DESCRIPTION "KiCad QA Schematic Editor " KICAD_WIN32_RC_PRODVER_STR
|
||||||
|
#define RC_VER_INTERNALNAME "qa_eeschema"
|
||||||
|
#define RC_VER_ORIGINALFILENAME "qa_eeschema.exe"
|
||||||
|
|
||||||
|
#include "kiwin32.rc"
|
|
@ -0,0 +1,6 @@
|
||||||
|
icon_qa_gerbview ICON "../resources/bitmaps_png/icons/icon_gerbview.ico"
|
||||||
|
|
||||||
|
#define RC_VER_FILE_DESCRIPTION "QA Gerber Viewer " KICAD_WIN32_RC_PRODVER_STR
|
||||||
|
#define RC_VER_INTERNALNAME "qa_gerbview"
|
||||||
|
#define RC_VER_ORIGINALFILENAME "qa_gerbview.exe"
|
||||||
|
#include "kiwin32.rc"
|
|
@ -0,0 +1,7 @@
|
||||||
|
icon_qa_kicad2step ICON "../resources/bitmaps_png/icons/icon_kicad.ico"
|
||||||
|
|
||||||
|
#define RC_VER_FILE_DESCRIPTION "QA KiCad2Step " KICAD_WIN32_RC_PRODVER_STR
|
||||||
|
#define RC_VER_INTERNALNAME "qa_kicad2step"
|
||||||
|
#define RC_VER_ORIGINALFILENAME "qa_kicad2step.exe"
|
||||||
|
|
||||||
|
#include "kiwin32.rc"
|
|
@ -0,0 +1,7 @@
|
||||||
|
icon_qa_common ICON "../resources/bitmaps_png/icons/icon_kicad.ico"
|
||||||
|
|
||||||
|
#define RC_VER_FILE_DESCRIPTION "KiCad QA KiMath " KICAD_WIN32_RC_PRODVER_STR
|
||||||
|
#define RC_VER_INTERNALNAME "qa_kimath"
|
||||||
|
#define RC_VER_ORIGINALFILENAME "qa_kimath.exe"
|
||||||
|
|
||||||
|
#include "kiwin32.rc"
|
|
@ -0,0 +1,6 @@
|
||||||
|
icon_qa_pcbnew ICON "../resources/bitmaps_png/icons/icon_pcbnew.ico"
|
||||||
|
|
||||||
|
#define RC_VER_FILE_DESCRIPTION "KiCad QA PCB Editor " KICAD_WIN32_RC_PRODVER_STR
|
||||||
|
#define RC_VER_INTERNALNAME "qa_pcbnew"
|
||||||
|
#define RC_VER_ORIGINALFILENAME "qa_pcbnew.exe"
|
||||||
|
#include "kiwin32.rc"
|
Loading…
Reference in New Issue