2017-02-27 10:07:52 +00:00
|
|
|
#
|
|
|
|
# This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
#
|
|
|
|
# Copyright (C) 2017 CERN
|
|
|
|
# @author Alejandro García Montoro <alejandro.garciamontoro@gmail.com>
|
2022-04-17 21:23:22 +00:00
|
|
|
# Copyright (C) 2022 KiCad Developers, see AUTHORS.txt for contributors.
|
2017-02-27 10:07:52 +00:00
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, you may find one here:
|
|
|
|
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
# or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
# or you may write to the Free Software Foundation, Inc.,
|
|
|
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
|
2019-01-09 14:35:42 +00:00
|
|
|
|
2017-02-27 10:07:52 +00:00
|
|
|
include_directories( BEFORE ${INC_BEFORE} )
|
|
|
|
|
2022-08-01 12:09:41 +00:00
|
|
|
if( KICAD_SPICE )
|
|
|
|
set( INC_AFTER ${INC_AFTER} ${NGSPICE_INCLUDE_DIR} )
|
|
|
|
|
|
|
|
# Find out the exact libngspice file name
|
|
|
|
get_filename_component( NGSPICE_DLL_ABSPATH "${NGSPICE_DLL}" ABSOLUTE )
|
|
|
|
get_filename_component( NGSPICE_DLL_FILE "${NGSPICE_DLL_ABSPATH}" NAME )
|
|
|
|
|
|
|
|
set_property( SOURCE sim/ngspice.cpp
|
|
|
|
APPEND PROPERTY COMPILE_DEFINITIONS
|
|
|
|
NGSPICE_DLL_FILE="${NGSPICE_DLL_FILE}"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2020-05-19 02:40:13 +00:00
|
|
|
include_directories(
|
|
|
|
${CMAKE_SOURCE_DIR}
|
|
|
|
${CMAKE_SOURCE_DIR}/include
|
|
|
|
${CMAKE_SOURCE_DIR}/pcbnew
|
2022-02-11 17:57:28 +00:00
|
|
|
${CMAKE_SOURCE_DIR}/qa/mocks/include
|
2021-11-30 23:33:21 +00:00
|
|
|
${CMAKE_SOURCE_DIR}/qa/qa_utils
|
2022-09-06 20:26:36 +00:00
|
|
|
${CMAKE_SOURCE_DIR}/qa
|
2020-05-19 02:40:13 +00:00
|
|
|
${INC_AFTER}
|
|
|
|
)
|
|
|
|
|
2020-04-17 23:46:01 +00:00
|
|
|
set( QA_EESCHEMA_SRCS
|
2019-04-23 08:18:15 +00:00
|
|
|
# need the mock Pgm for many functions
|
2022-02-11 17:57:28 +00:00
|
|
|
${CMAKE_SOURCE_DIR}/qa/mocks/kicad/common_mocks.cpp
|
2019-04-23 08:18:15 +00:00
|
|
|
|
2019-04-02 15:35:25 +00:00
|
|
|
eeschema_test_utils.cpp
|
2020-02-28 21:55:51 +00:00
|
|
|
uuid_test_utils.cpp
|
2019-04-02 15:35:25 +00:00
|
|
|
|
2019-04-02 12:36:12 +00:00
|
|
|
# The main test entry points
|
2020-11-14 22:00:12 +00:00
|
|
|
test_module.cpp
|
2019-04-02 12:36:12 +00:00
|
|
|
|
2019-12-30 18:28:00 +00:00
|
|
|
# Base internal units (1=100nm) testing.
|
|
|
|
test_sch_biu.cpp
|
|
|
|
|
2020-07-16 14:11:31 +00:00
|
|
|
# Shared between programs, but dependent on the BIU
|
2022-03-18 20:05:15 +00:00
|
|
|
${CMAKE_SOURCE_DIR}/qa/unittests/common/test_format_units.cpp
|
|
|
|
${CMAKE_SOURCE_DIR}/qa/unittests/common/test_array_options.cpp
|
2020-07-16 14:11:31 +00:00
|
|
|
|
2021-02-04 19:16:34 +00:00
|
|
|
sch_plugins/altium/test_altium_parser_sch.cpp
|
|
|
|
|
2022-09-06 20:26:36 +00:00
|
|
|
erc/test_erc_label_not_connected.cpp
|
|
|
|
erc/test_erc_stacking_pins.cpp
|
|
|
|
erc/test_erc_global_labels.cpp
|
2022-12-07 21:15:29 +00:00
|
|
|
erc/test_erc_no_connect.cpp
|
2023-01-21 23:25:40 +00:00
|
|
|
erc/test_erc_hierarchical_schematics.cpp
|
2022-09-06 20:26:36 +00:00
|
|
|
|
2019-04-02 12:36:12 +00:00
|
|
|
test_eagle_plugin.cpp
|
2019-04-23 08:18:15 +00:00
|
|
|
test_lib_part.cpp
|
2022-04-12 14:37:06 +00:00
|
|
|
test_netlist_exporter_kicad.cpp
|
|
|
|
test_netlist_exporter_spice.cpp
|
2021-11-29 21:19:43 +00:00
|
|
|
test_ee_item.cpp
|
2022-04-19 21:43:32 +00:00
|
|
|
test_pin_numbers.cpp
|
2019-04-23 08:18:15 +00:00
|
|
|
test_sch_pin.cpp
|
2019-06-25 23:39:58 +00:00
|
|
|
test_sch_rtree.cpp
|
2022-04-17 21:23:22 +00:00
|
|
|
test_sch_reference_list.cpp
|
2019-04-23 08:18:15 +00:00
|
|
|
test_sch_sheet.cpp
|
|
|
|
test_sch_sheet_path.cpp
|
2020-10-18 20:30:37 +00:00
|
|
|
test_sch_sheet_list.cpp
|
2020-04-16 16:43:50 +00:00
|
|
|
test_sch_symbol.cpp
|
2020-04-17 23:46:01 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
# Spice specific testing routine
|
|
|
|
if( KICAD_SPICE )
|
|
|
|
set( QA_EESCHEMA_SRCS
|
|
|
|
${QA_EESCHEMA_SRCS}
|
|
|
|
# Simulation tests
|
2022-05-31 02:55:48 +00:00
|
|
|
sim/test_library_spice.cpp
|
2022-12-21 17:01:05 +00:00
|
|
|
sim/test_sim_model_inference.cpp
|
2022-08-05 15:37:20 +00:00
|
|
|
sim/test_sim_model_ngspice.cpp
|
2023-01-21 14:27:33 +00:00
|
|
|
sim/test_sim_regressions.cpp
|
2022-03-05 23:49:25 +00:00
|
|
|
sim/test_ngspice_helpers.cpp
|
2020-04-17 23:46:01 +00:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2022-08-09 01:25:31 +00:00
|
|
|
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()
|
|
|
|
|
2020-04-17 23:46:01 +00:00
|
|
|
add_executable( qa_eeschema
|
|
|
|
${QA_EESCHEMA_SRCS}
|
2022-08-09 01:25:31 +00:00
|
|
|
${QA_EESCHEMA_RESOURCES}
|
2019-04-02 12:36:12 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries( qa_eeschema
|
2022-08-08 22:41:57 +00:00
|
|
|
PRIVATE
|
2022-01-02 02:21:49 +00:00
|
|
|
eeschema_kiface_objects
|
2019-04-02 12:36:12 +00:00
|
|
|
common
|
2020-05-19 02:40:13 +00:00
|
|
|
pcbcommon
|
2021-03-18 13:28:04 +00:00
|
|
|
scripting
|
2020-03-10 15:04:05 +00:00
|
|
|
kimath
|
2019-04-02 12:36:12 +00:00
|
|
|
qa_utils
|
2022-09-06 20:26:36 +00:00
|
|
|
qa_schematic_utils
|
2019-12-29 13:07:17 +00:00
|
|
|
markdown_lib
|
2019-04-02 12:36:12 +00:00
|
|
|
${GDI_PLUS_LIBRARIES}
|
|
|
|
${Boost_LIBRARIES}
|
|
|
|
)
|
|
|
|
|
2022-08-08 22:41:57 +00:00
|
|
|
if( KICAD_SPICE AND MSVC )
|
|
|
|
# Allow for MSVC to run from the build directory
|
|
|
|
add_custom_command( TARGET qa_eeschema POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${NGSPICE_DLL}" "$<TARGET_FILE_DIR:qa_eeschema>"
|
|
|
|
)
|
2022-08-09 01:57:44 +00:00
|
|
|
|
|
|
|
add_custom_command( TARGET qa_eeschema POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory "${NGSPICE_CM_DIR}" "$<TARGET_FILE_DIR:qa_eeschema>/ngspice"
|
|
|
|
)
|
2022-08-08 22:41:57 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
2019-04-02 12:36:12 +00:00
|
|
|
# Eeschema tests, so pretend to be eeschema (for units, etc)
|
|
|
|
target_compile_definitions( qa_eeschema
|
|
|
|
PUBLIC EESCHEMA
|
2019-04-02 15:35:25 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# Pass in the default data location
|
|
|
|
set_source_files_properties( eeschema_test_utils.cpp PROPERTIES
|
2022-03-18 21:26:09 +00:00
|
|
|
COMPILE_DEFINITIONS "QA_EESCHEMA_DATA_LOCATION=(\"${CMAKE_SOURCE_DIR}/qa/data/eeschema\")"
|
2019-04-17 11:41:15 +00:00
|
|
|
)
|
|
|
|
|
2020-07-16 14:11:31 +00:00
|
|
|
kicad_add_boost_test( qa_eeschema qa_eeschema )
|
2020-04-19 20:13:21 +00:00
|
|
|
|