Commit Graph

114 Commits

Author SHA1 Message Date
John Ralls
5f18971afb SRFI-64 Handle run-test returning the runner instead of pass status.
Guile 3.0.5 fixed what they thought was a bug whering run-test returned
the rv of test-runner-on-final instead of the current test runner. Ctest
considered the returned object to be a successful test and always reported
the test passing.
2024-05-28 15:07:41 -07:00
Geert Janssens
b9eb550b9a Do a better job of including the -py3 option only for swig 4.1
The previous attempt broke builds with swig older than 4.1
2024-02-22 11:13:59 +01:00
Geert Janssens
cbf89a73be Avoid deprecation warning for -py3 in swig >= 4.1 2024-02-22 10:30:52 +01:00
John Ralls
93323cc1dc Fix Win32 build, broken by COMMAND_EXPAND_LISTS
Create a win32 analog to make_unix_path_list that escapes the
semicolons to prevent cmake turning them into list delimiters.
2023-12-11 11:49:59 -08:00
John Ralls
d92d97aef6 Add Scheme coverage collection with option GUILE_COVERAGE.
This can be used with or without COVERAGE, though if without the
results will reflect only the Scheme code exercised by the tests.
2023-12-08 14:55:49 -08:00
John Ralls
6834cb5025 Implement coverage option
To use pass -DCMAKE_BUILD_TYPE=Debug or Asan -DCOVERAGE=ON and build as
usual, then do ninja lcov-initialize && ninja check && ninja
lcov-collect. The result will be a directory, <Builddir>/Coverage
containing lcov tracefiles, including an aggregate file gnucash.info
which you can use for further processing. It will also report an overall summary.
Note that only C/C++ files are included.

There's one more target, lcov-generate-html, that you can run after
lcov-collect. It will generate a simple website in
<Builddir>/Coverage-HTML showing coverage by source directory (the
directories in <Builddir> have coverage for generated files). Each
directory path is a clickable link to a page that shows coverage for
each source file; the filenames link to a page for each showing which
lines have been exercised.
2023-12-08 14:53:02 -08:00
John Ralls
a3f14759ab Asan: Make leak and ODR violation reporting CMake options.
pass -DLEAKS=ON or -DODR=ON to enable these features. They have an
effect only with CMAKE_BUILD_TYPE=Asan and don't work on Apple because
Apple clang doesn't enable them.
2023-11-25 11:17:14 -08:00
John Ralls
2234fa433e Add Asan build type that enables the Address and UB sanitizers.
Uses generator statements instead of CMAKE_<TYPE>_FLAGS_ASAN to support multiconfig generators like Xcode.
2023-11-02 12:58:46 -07:00
Richard Cohen
3a7464a312 Remove redundant uses of cmake -E env
- In GncAddTest, set_tests_properties() is already setting the env
- In the other uses, there is no change to the environment
2023-03-07 15:44:43 +00:00
Richard Cohen
be41bde58a Add missing MAKE_LINKS, and the local scm directory to %load-path
Before this change, "make check" would fail after
  rm -rf ${build}/share/guile/site/*/gnucash/
2023-02-28 11:51:23 +00:00
Richard Cohen
7cae61d97a Make the scheme tests fail immediately if they load an external gnucash file
This would be a mistake in the build, but can happen if there
is already a gnucash installed in the standard guile load path.
2023-02-28 11:48:57 +00:00
Geert Janssens
470afc918f Relocate resource to /org/gnucash/GnuCash prefix
This is done to be consistent with the GSettings
prefix (which is also a GLib subsystem).

In the process replace the magic string with
a single, globally defined macro.
2023-01-01 17:23:17 +01:00
Geert Janssens
b3fa876da3 Drop ui path specifier from resources paths
They were only there due to how the source directories
are organized and not really adding useful detail.
Removing it from the resource paths gives more freeedom
wrt to the organization of source files.
2023-01-01 16:34:29 +01:00
Geert Janssens
a543143689 Generate the gresource xml file based on a list of resources
This inverts the logic from
- having an xml file and extracting dependencies
  from it to
- having a list of dependencies and generating
  an xml file from it

In the original configuration adding or removing a
resource to/from the gresources.xml file would not
be detected by cmake as a change in dependencies.
The user would have to remember to rerun cmake manually.
By explicitly listing the dependencies, cmake will
properly recongifure and regenerate if that list is
updated. The remainder of the dependency configuration
also ensures proper rebuilds of gnucash, libaqbanking
and libofx if any of the resource files change, a new
one is added or an existing one is removed.

For reusability the code to generate the gresource related
files as been extracted into a separate function.
2023-01-01 15:06:42 +01:00
luz paz
8adedc2248 Fix various typos
Found via `codespell -q 3 -S *.po,./po,*.min.js,./ChangeLog*,./NEWS,./borrowed,./doc/README*,./AUTHORS,./libgnucash/tax/us/txf-de*,./data/accounts -L ans,ba,cas,dragable,gae,iff,iif,mut,nd,numer,parm,parms,startd,stoll`
2022-04-08 14:12:50 -04:00
John Ralls
76a4389a92 Bomb out immediately if or aren't set
Instead of spewing dozens of errors about file(TO_CMAKE_PATH) needing 3 parameters.
2021-03-25 13:53:58 -07:00
John Ralls
273841eabc Fix variable reversal in GncAddTest.cmake. 2021-01-17 11:08:24 -08:00
John Ralls
d86b30b628 Force scheme to make links before any builds.
The new modules regime can only find files in the final modules
layout, so interdependent files can be built only if they're linked
first or have a strict dependency order provided to cmake. In many
cases the latter is impractical.
2020-12-13 16:45:18 -08:00
John Ralls
401299cdd3 Fix adding Scheme tests to check target.
TEST isn't a variable name, SCHEME_TGT_TESTS is.
2020-09-26 13:11:12 -07:00
John Ralls
4ee573e23a Link with libm.so on those platforms that require it. 2020-07-06 12:30:37 -07:00
Christopher Lam
14ea5d9751 Merge branch 'maint' 2020-05-04 23:31:21 +08:00
John Ralls
1e59819176 Respect the environment LD_LIBRARY_PATH for loading Scheme modules and tests. 2020-04-29 17:11:52 -07:00
John Ralls
758bd7b656 Merge branch 'maint' 2020-04-24 13:52:21 -07:00
John Ralls
4b8649f77b Set CONFIGURATIONS property on tests only for Xcode.
Having it in the general case disabled a large number of tests.
2020-04-18 13:09:32 -07:00
John Ralls
3ca8fa1229 Merge branch 'maint' 2020-04-13 11:27:14 -07:00
John Ralls
1365a19e2e Force WITH_PYTHON=YES for distcheck.
To ensure that it works from the tarball.
2020-04-12 15:51:05 -07:00
c-holtermann
ab843c0b7a include gnucash_core of python bindings in python swig app-utils 2020-04-06 07:03:40 +02:00
Geert Janssens
e78313147c Cmake - rework gnc_add_scheme_deprecated_module to use keyword parameters
Update all invocations accordingly
2020-03-30 08:41:29 +02:00
Geert Janssens
ba15cf7f7f Combine the two scheme target generation functions
Add another keyword TEST to set when test targets are to be created
2020-03-30 08:41:29 +02:00
Geert Janssens
25e08f88a5 Document the two primary functions for adding scheme targets 2020-03-30 08:41:29 +02:00
Geert Janssens
06ff8a292d Use new keyword parameters for all calls to gnc_add_scheme_test_targets 2020-03-30 08:41:29 +02:00
Geert Janssens
c05281c582 Use new keyword parameters for all calls to gnc_add_scheme_targets 2020-03-30 08:41:29 +02:00
Geert Janssens
91ecdcb5dd Rework SchemeTargets module to use keyword parameters 2020-03-30 08:41:29 +02:00
Geert Janssens
ba7362d895 CMake - Drop oldstyle endfunction invocations
The form without repeating the function name is preferred
2020-03-30 08:41:29 +02:00
John Ralls
f85be03bb5 Merge branch 'maint' 2020-03-29 14:46:55 -07:00
John Ralls
33902a6793 Improve test building with the Xcode generator.
Add CONFIGURATIONS keyword to unadorned tests, enables tests with
multi-config generators.
Add CONFIGURATION generator expression to libgtest.a and libgmock.a
build directory specs when building with Xcode so that it can
find them when building tests.
2020-03-23 17:52:26 -07:00
Geert Janssens
987fc15fc9 Drop our local copy of pkg_check_modules
It was needed for cmake versions older than 3.6, but we
require at least 3.10 now
2020-02-24 13:33:06 +01:00
Geert Janssens
301db9020d Merge branch 'maint' 2020-02-06 16:50:08 +01:00
Geert Janssens
90e95ba8ef CMake - remove parameter repetition in else() and endif() statements - part 2
This follows Professional CMake's recommended practises
I missed plenty of these in my first commit. This one should fix
these remaining occurrences.
2020-02-06 16:16:36 +01:00
Geert Janssens
45cfb8937a Merge branch 'maint'
Resolves most merge conflicts. The only bit I was unable
to merge from maint into master is the use of match-lambda
in category-barchart.scm. This will have to be redone manually.
2020-01-14 19:56:35 +01:00
John Ralls
53ed90862c Bug 797536 - cmake errors out because it cannot find GncPkgConfig (cmake 3.5.2) 2019-12-29 12:35:13 -08:00
Geert Janssens
88706e5657 bindings/guile - remove gnc-module wrapper
Emit appropriate deprecation warnings in case code tries to invoke the removed functions.
Only for gnc:module-load a more elaborate compat function has
been written which should allow code using this obsolete function
to continue to function. The emitted deprecation warning will
guide the user to update his/her code for future compatibility.
2019-12-06 20:38:21 +01:00
Geert Janssens
a6b7eecd81 core-utils - make the swig generated source file dependent on the core-utils headers
That should trigger a regeneration of these swig sources if
any of the header files change.
This is done via a small macro that can be reused for other wrappers as well.

Note
cmake 3.15 introduces a 'FILTER' generator expression
that might allow us to do something like the following:
$<FILTER:$<TARGET_PROPERTY:baselib,SOURCES>,INCLUDE,"*.h[pp]?$">
I toyed briefly with that idea but it currently has two issues:
1. 3.15 is newer than our current minimum cmake requirement, so we can't
   depend in that feature yet.
2. the sources are relative to *their* source directory, which
   is different from the one in which the wrappers are generated
   So they should still be properly transformed into absolute paths
2019-12-06 19:59:11 +01:00
Geert Janssens
33e1ff645c Allow to pass include directories to the add_swig_xyz commands
This will be needed when the wrappers no longer live in
the same directory as the objects they are wrapping.
2019-12-06 19:59:11 +01:00
Geert Janssens
980daeec83 Make swig wrapper generation just another build step
Until now it was only done when building from git, but there's no
real reason not to do it as a normal build step in all cases.
It may have been unreliable in the past. There's no evidence
it still is.
2019-09-21 22:50:51 +02:00
Geert Janssens
797654133b Use newer cmake version checks 2019-09-17 15:46:50 +02:00
John Ralls
e38cc91452 Merge branch 'maint'
Bumping the required cmake to 3.10 and removing GncPkgConfig.cmake as
no longer required.
2019-09-13 09:43:04 -07:00
John Ralls
41c58ec00a Convert Gtk3 and Webkit to imported targets.
This causes CMake to include their headers with -isystem instead of -I,
so the compiler doesn't generate warnings on them. ArchLinux was failing
to build because of such warnings.

Includes a function from cmake 3.6 to allow this to work on systems like
Ubuntu 14.04 that still provide only cmake 3.5.
2019-09-12 21:20:29 -07:00
Geert Janssens
70eb7172d5 Drop special case for old cmake versions
We require 3.5 which is more recent than 3.3
2019-09-12 22:54:24 +02:00
Geert Janssens
82b3af9695 Change scheme file compile command invocation
This
* adds normal double quotes around the guild function call
* removes escaped quotes from paths
* add 'VERBATIM' keyword to let cmake perform its own escape logic on the commands

Verified to work on Windows and linux with both ninja and make.
2019-09-12 22:54:24 +02:00