Commit Graph

68 Commits

Author SHA1 Message Date
Derek Atkins
7397e4adce Update r23747 -- require 2.0.10 for guile2 builds, but allow older versions
for guile 1.8 builds.  However if we don't have guile 2.0.10 then don't
allow "make dist" to run.  This also means we wont patch the guile
files unless we find swig 2.0.10.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23748 57a11ea4-9604-0410-9ed3-97b8803252fd
2014-01-23 21:20:37 +00:00
Geert Janssens
8e6463b9da Win32: don't apply swig patch on this platform
The current version of the patch tool in our build chain
can't handle this patch.
This is not a problem (for now) because
a. our windows build is still using guile 1.8
b. we're not creating release tarballs on windows

Hopefully swig itself is updated before we move to guile 2 on Windows

This reverts commit e48381ecf9.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23743 57a11ea4-9604-0410-9ed3-97b8803252fd
2014-01-22 15:48:15 +00:00
Geert Janssens
e48381ecf9 Bug 721600 - Segmentation fault on startup if report Income/Expense Chart was opened since last running
This bug is a continuation of bug 719481. The fix for that bug
wouldn't trickle down into the release tarballs because the needed
patch would only be applied if the tarball were generated against
guile 2.

This commit fixes this by applying that patch unconditionally

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23702 57a11ea4-9604-0410-9ed3-97b8803252fd
2014-01-18 15:09:52 +00:00
Geert Janssens
8325bf8e5c Guile 1.8 fixes for r23556 and r23557
- guile 1.8 doesn't need the swig patch
- make sure all swig interface files include guile-mappings.h
  for the *utf8_string to *locale_string mappings
  but only load it when building guile modules

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23559 57a11ea4-9604-0410-9ed3-97b8803252fd
2013-12-14 16:40:42 +00:00
Geert Janssens
2a5f68c812 Bug 719481 - GnuCash report crashes with Guile2
This is actually a bug in swig.
This commit works around it by patching the swig
generated source files until swig itself has been fixed.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23557 57a11ea4-9604-0410-9ed3-97b8803252fd
2013-12-13 20:22:01 +00:00
John Ralls
de3a6e3df2 Handle RAND_MAX < 2^32 in get_random_gint64()
MacOSX, for example, sets RAND_MAX at 65535, which rather limits the
size of random gint64s on that platform.

Fixing this revealed some odd behavior in creating random interest rates,
so created a specific function for that with a somewhat more reasonable
approach.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23493 57a11ea4-9604-0410-9ed3-97b8803252fd
2013-12-05 21:54:18 +00:00
Geert Janssens
1f7549c082 Code reindentation in tests
Command used: astyle --indent=spaces=4 --brackets=break --suffix=none <files>

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23359 57a11ea4-9604-0410-9ed3-97b8803252fd
2013-10-31 22:23:28 +00:00
John Ralls
6aa2cb9deb Unit test Transaction.c
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23139 57a11ea4-9604-0410-9ed3-97b8803252fd
2013-08-16 16:44:28 +00:00
John Ralls
6379a23b87 [Testing] Create log handlers in one step, clean up in teardown
New functions to simplify creating log handlers for expected log
messages, especially fatal message handlers. Handlers are tracked in the
Fixture and automatically freed during teardown.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23138 57a11ea4-9604-0410-9ed3-97b8803252fd
2013-08-16 16:44:08 +00:00
John Ralls
827eb333c3 Fix automake INCLUDE deprecation warnings
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22539 57a11ea4-9604-0410-9ed3-97b8803252fd
2012-11-07 03:08:15 +00:00
Geert Janssens
67b2a56855 Change of mind. Use scm instead of vcs.
scm is the modern term. vcs is rather used to refer to archaic systems
such as cvs and older. I wish I remembered this before my previous
commit. Oh well...

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22476 57a11ea4-9604-0410-9ed3-97b8803252fd
2012-11-01 10:35:34 +00:00
Geert Janssens
27c76eccd5 Minor changes to indicate svn is not the only/primary vcs used.
The code actually has provisions for svn, svk, git and bzr. Only svn and
git are actively used by the core developers though.

This involves changing
- filenames that contained svn while meant for multiple vcs's
- variable and macro names that are relevant for multiple vcs's
- the various locations where the vcs revision info is displayed
  to the user, to mention the actual vcs used instead of standard "svn"

While at the last item, I also changed the text printed when gnucash is
called with the --version parameter, to reuse the translatable string
that is also used for the about dialog. This saves us one string to
translate.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22475 57a11ea4-9604-0410-9ed3-97b8803252fd
2012-10-31 21:38:49 +00:00
John Ralls
b391754ff6 Correct -Wunused warnings
The actual change to configure.ac (at line 1106) to enable -Wunused -- or rather to un-disable it -- is not included in order to not break the build for folks with buggy versions of swig.
(For example, https://sourceforge.net/tracker/?func=detail&aid=3530021&group_id=1645&atid=101645)

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22203 57a11ea4-9604-0410-9ed3-97b8803252fd
2012-05-26 23:47:34 +00:00
John Ralls
12387c1c02 [Testing] Add hits field to TestErrorStruct
Allows asserting on the number of times error messages are encountered.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22135 57a11ea4-9604-0410-9ed3-97b8803252fd
2012-04-03 21:35:47 +00:00
John Ralls
6d32b6f693 [Testing] Separate unit test functions from make check functions.
I'd originally put the functions supporting log detection, qof event handling, and mock-counting in test-stuff along with the functions that support the older "make check" integration tests. There are now more unit test support functions than there are of the older functions, so it's time for them to move out on their own.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22132 57a11ea4-9604-0410-9ed3-97b8803252fd
2012-04-03 21:35:19 +00:00
John Ralls
0ecb61dd13 Testing: Provide a test_destroy function/macro combination.
Works on GObjects. Asserts if the object isn't a GObject (which may be the case if it has already been finalized) or if the object's finalize method isn't called (indicating a leak).

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22114 57a11ea4-9604-0410-9ed3-97b8803252fd
2012-03-24 22:20:19 +00:00
John Ralls
777074f482 Testing: Rewrite test_signal_assert_hits as a function/macro combination
Now the assert reports the location in the test program where it fails instead of inside test-stuff.c.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22113 57a11ea4-9604-0410-9ed3-97b8803252fd
2012-03-24 22:20:08 +00:00
John Ralls
b5c62a1385 Testing: Add a basic print-to-stdout log handler as a test debugging aid.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22112 57a11ea4-9604-0410-9ed3-97b8803252fd
2012-03-24 22:19:58 +00:00
Christian Stimming
3fcdf59adf Re-indentation of source code.
As usual, re-indentation was done using astyle-1.24 using the following options:

  astyle --indent=spaces=4 --brackets=break --pad-oper --pad-header --suffix=none

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21816 57a11ea4-9604-0410-9ed3-97b8803252fd
2012-01-01 20:36:46 +00:00
John Ralls
dbd7744602 [Testing] Complete repositioning of test-core to build after libqof
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21759 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-12-20 04:02:26 +00:00
John Ralls
5c52e5eb57 [Testing] Export test-core log suppression functions to python and guile
Enables silencing expected error output. Finally found the secret code
to get libtool to build a "noinst" dynamic library: pass -rpath as an
ldflag.

BP

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21724 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-12-12 22:41:41 +00:00
John Ralls
f7604f117f [Testing] Provide list error handler, rename some functions
Add an GTestFatalFunc which can examine a list of error conditions and suppress those messages and prevent their exiting while passing through any unexpected errors.

Rename test_silent_logger to test_null_handler and change it to a GTestFatalFunc (it can still be used as a GLogFunc).

Rename test_handle_faults to test_checked_handler and improve its flow and message display. It no longer asserts on a bad match.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21668 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-12-05 00:06:28 +00:00
John Ralls
2ab005524a [Testing] Test facility for QofEvents and improve fatal-handling
For use from tests based on glib testing. Create a private structure to
compare to and register a handler which tests the event parameters
against the private structure and counts the number of valid hits.
Provides a test function for checking that the event handler has been
hit the requisite number of times.

Pass through, rather than testing, logs with a lower (i.e., less
important rather than lower-value) loglevel than the one the handler was
set up for. Test the log message rather than overwriting the pre-set one
with the actual message.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21523 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-11-05 23:04:23 +00:00
Christian Stimming
1961766c99 Re-indentation of source code.
As usual, re-indentation was done using astyle-1.24 using the following options:

  astyle --indent=spaces=4 --brackets=break --pad-oper --pad-header --suffix=none

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21205 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-08-22 07:10:56 +00:00
John Ralls
a71070277c Testing: Fix compile error introduced in r20928
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20939 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-07-18 12:00:44 +00:00
John Ralls
2a565cf498 Testing: Fixed test_reset_called() return type
Author: Muslim Chochlov

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20938 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-07-17 21:22:11 +00:00
John Ralls
e7534148cc Testing: Add some convenience functions to make it
easier to test callbacks and to intercept and
ignore or test expected error log messages.

Much lifted from Muslim's test-qofbook.c

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20928 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-07-14 17:06:13 +00:00
John Ralls
4dc91e4441 Testing: Fix an error in the GNC_TEST_ADD macro that
ate user data for the fixture.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20927 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-07-14 17:06:04 +00:00
John Ralls
fb0f27b043 Add unit test utility macros
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20768 57a11ea4-9604-0410-9ed3-97b8803252fd
2011-06-18 23:20:20 +00:00
Geert Janssens
98bfef5845 Remove gncmod-test from test-core
It's not used and prevents test-core from being included in core-utils tests

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18826 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-04 22:03:42 +00:00
Christian Stimming
0df2d5f8d5 Remove C executable from cmake as it is no longer necessary.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18819 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-04 20:04:35 +00:00
Christian Stimming
dffacfefc7 Finish cmake build system for the C++ experiment.
To build this:

mkdir build-cpp
cd build-cpp
cmake ..
make
./src/gnc/cutecash

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18815 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-04 17:48:36 +00:00
Christian Stimming
ce99c42871 Re-indentation of source code, next batch.
This also strips trailing whitespaces from lines where they existed.
This re-indentation was done using astyle-1.24 using the following options:

astyle --indent=spaces=4 --brackets=break --pad-oper --pad-header --suffix=none

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18787 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-02 21:40:02 +00:00
Christian Stimming
cfd3a5b33e Add example main window in C++ and Qt that links against gnucash-engine.
The example was based on Qt4's "application" example, but
the main window layout is done through the .ui file already.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18776 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-01 18:45:53 +00:00
Christian Stimming
3236b3c93c Also build backend/xml in cmake.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18743 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-02-27 11:37:14 +00:00
Christian Stimming
69dc9107ff Make CMake system more complete so that it builds on win32/mingw.
Also, add a test executable to check that we got all the
library dependencies.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18737 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-02-25 17:42:21 +00:00
Christian Stimming
61c16a06dd Re-indentation of source code, next batch.
This also strips trailing whitespaces from lines where they existed.
This re-indentation was done using astyle-1.23 using the following options:

astyle --indent=spaces=4 --brackets=break --pad-oper

Discussed at http://lists.gnucash.org/pipermail/gnucash-devel/2009-August/026121.html

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18535 57a11ea4-9604-0410-9ed3-97b8803252fd
2009-12-29 20:12:48 +00:00
Christian Stimming
60c32fd16b Bug #514043: Use AM_CPPFLAGS instead of AM_CFLAGS.
AM_CFLAGS is passed both to the compiler (.c -> .o) and to the linker, so it
should only have flags that are appropriate for both steps. AM_CPPFLAGS is
passed only to the compiler, so flags that are only appropriate for that step
(-I and -D flags, for example), should be in _CPPFLAGS instead of _CFLAGS.
Every gnucash-2.2.3 Makefile.am that passes -I flags gets it wrong, placing
them in _CFLAGS. It's not a functional bug (the linker ignores -I flags), but a
ton of superfluous flags makes the build output pretty verbose and hard to
debug when things do go wrong.

To make matters more confusing as a developer, the FOO_CFLAGS variable set by
PKG_CHECK_MODULES(FOO) is actually for _CPPFLAGS in the Makefile.am
('pkg-config --cflags' returns the -I flags).

A related -I bug (one that *is* functionally broken) is that sometimes a local
(build dir) -I flag is passed after a global (installed dependent library) one.
If my system happens to have a header installed from some unrelated thing,
compiler will find *that* one instead of the expected one in the source
directory. Should always pass all local -I before any global ones.

Patch by andi5 plus one manual addition in src/gnome-utils/Makefile.am

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@17655 57a11ea4-9604-0410-9ed3-97b8803252fd
2008-10-25 20:30:47 +00:00
Derek Atkins
167feed527 Make sure that each GNCModule has a unique set of symbols.
Change gnc-module.c to load the unique symbols based on the module filename.
Change gnc-module-api.h to declare the functions based on a provided filename.
Change ALL the modules to use the new symbol names.

This change should allow the code to build cleanly on the MacIntel platform.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15928 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-04-18 23:23:04 +00:00
Andreas Köhler
b34a1c9f3f Unify library names and installation directories.
Rename libcore-utils        to libgnc-core-utils
Rename libgncgnome          to libgnc-gnome
Rename libgncmodule         to libgnc-module
Rename libgncqof            to libgnc-qof
Rename libgnc-backend-file  to libgncmod-backend-file
Move libgnc-business-ledger to $prefix/lib
Move libgncqof-backend-qsf  to $prefix/lib/gnucash
Move libgncmod-backend-file to $prefix/lib/gnucash


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15321 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-01-07 07:04:23 +00:00
Andreas Köhler
2e69bba2db Merge reshuffle-modules (r15315) back into the trunk.
Modules are loaded directly with the g_symbol_* API now while dropping
the dependency on libltdl.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15317 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-01-06 00:41:51 +00:00
Chris Shoemaker
dde4a52308 More comments, spelling fixes, line-wraps, whitespace cleanups.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14615 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-08-08 23:16:54 +00:00
Joshua Sled
fa132e4bab match quotes (breaks editor syntax hilighting)
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13721 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-31 21:08:24 +00:00
Chris Shoemaker
ec1bcb86df Return the actual number of test failures with get_rv().
Use shorter strings for commodity mnemonics.
   Ensure that test splits amount and value have the same sign.
   Avoid numerical overflow in rate calculation when generating test splits.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13718 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-31 01:43:16 +00:00
David Hampton
4b04137e7d Never include "config.h" from a header file. Doing so makes it nigh
impossible to override configuration settings.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13549 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-03-09 05:51:07 +00:00
Neil Williams
d7309a5261 Ensuring get_random_double returns at least some decimal places more often than not.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13238 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-02-12 18:55:36 +00:00
Joshua Sled
5eded02d6c Removing .cvsignore files; mis-migrated po/ChangeLog
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@11785 57a11ea4-9604-0410-9ed3-97b8803252fd
2005-11-02 16:38:29 +00:00
David Hampton
f28d033d74 Collapse the gnome2 branch back into HEAD.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@11565 57a11ea4-9604-0410-9ed3-97b8803252fd
2005-11-02 03:32:36 +00:00
Derek Atkins
fb50077329 Fix a few problems to get CVS to compile.
test-core/test-stuff: remove unused variable.
  register/ledger-core/split-register-control: insert do .. while
      because the code still uses "break"s to exit out.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@10253 57a11ea4-9604-0410-9ed3-97b8803252fd
2004-08-29 02:10:15 +00:00
Linas Vepstas
824bac37ed replace insane algorithm (which always returned last iterm in array)
with something real.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@10236 57a11ea4-9604-0410-9ed3-97b8803252fd
2004-08-27 21:37:20 +00:00