Commit Graph

25 Commits

Author SHA1 Message Date
Vicent Marti
2a1732b439 Rewrite the unit testing suite
NIH Enterprises presents: a new testing system based on CuTesT, which is
faster than our previous one and fortunately uses no preprocessing on
the source files, which means we can run that from CMake.

The test suites have been gathered together into bigger files (one file
per suite, testing each of the different submodules of the library).

Signed-off-by: Vicent Marti <tanoku@gmail.com>
2011-02-02 02:15:25 +02:00
Alex Budovski
9ace34c8de Revised build configuration for MSVC.
Major changes and rationale:
- /WX: absolutely vital when compiling in C-mode as the compiler is
  incredibly lenient on what is allowed to compile. It allows functions to be
  called without prototypes declared, treating them as functions returning int
  taking an unspecified (read: unrestricted) list of arguments, without any
  type checking! It will simply issue a warning, which is easily overlooked.

  A real example: it will allow you to call ceil(1.75) without first including
  <math.h> causing UB, returning bogus results like 1023 on the machine I
  tested on.

- Release build separate from debug.
  Presently release builds don't exist.  Consequently they are completely
  untested. Many bugs may only manifest themselves in release mode. The current
  configuration sets debug-only flags like /RTC1 which are incompatible with
  optimization (/O2).

  In addition, the Windows build of libgit2 has no optimized version. This
  change resolves this.

- Added checksum generation in image headers. This is so debuggers don't
  complain about checksum mismatches and provides a small amount of consistency
  to binaries.
2011-01-08 22:17:01 +02:00
Vicent Marti
2645053be2 Find proper path to 'ldconfig' on wscript
Don't hardcode the '/sbin/ldconfig' path; also, don't run anything if
ldconfig cannot be found (Mac OS X, for instance).

Signed-off-by: Vicent Marti <tanoku@gmail.com>
2011-01-04 01:17:07 +02:00
Vicent Marti
51035184dd Prevent test manifests from being run
The test runner was running the manifest and other crap files. Now it
filters out to just the executables.

Signed-off-by: Vicent Marti <tanoku@gmail.com>
2010-12-23 01:00:40 +02:00
Vicent Marti
e6c8966d37 Merge branch 'call-ldconfig-on-unix' of https://github.com/marvil07/libgit2 2010-12-23 00:49:34 +02:00
Vicent Marti
f464965584 Merge branch 'waf-pkgconfig-typo' of https://github.com/marvil07/libgit2 2010-12-23 00:48:35 +02:00
Vicent Marti
e7379f3384 Link tests with the raw objects
Fix the test building issues once for all; each test is linked
with the raw objects of the library, not with any compiled version. That
way we make sure the tests always run, and are always linked with the
latest and most up-to-date version of the code.

Signed-off-by: Vicent Marti <tanoku@gmail.com>
2010-12-23 00:43:07 +02:00
Vicent Marti
0847dff5cd Fix test builds in Win32
Use forward slashes for the TEST_RESOURCES definition. libgit2 uses only
forward slashes.

Signed-off-by: Vicent Marti <tanoku@gmail.com>
2010-12-22 21:57:48 +02:00
Marco Villegas
a58e6a5fc9 Run ldconfig on install at unix platforms. 2010-12-22 13:40:39 -05:00
Marco Villegas
bd6eb23022 minor: Let waf write the right values for prefix and libdir at pkg-config file. 2010-12-22 04:09:24 -05:00
Vicent Marti
f70cbbc511 Link tests with shared library, not static
Signed-off-by: Vicent Marti <tanoku@gmail.com>
2010-12-18 03:16:04 +02:00
Vicent Marti
2cd6d6866e Tests now run with the resources folder as a hardcoded path
Each tests expects a "TEST_RESOURCES" define with the full path to the
resources folder.

Signed-off-by: Vicent Marti <tanoku@gmail.com>
2010-12-10 05:53:39 +02:00
Vicent Marti
9de351b258 Move documentation generation to the Waf system
The new command is './waf doxygen'

Signed-off-by: Vicent Marti <tanoku@gmail.com>
2010-12-10 04:38:15 +02:00
Vicent Marti
44908fe763 Change the library include file
Libgit2 is now officially include as

	#include "<git2.h>"

or indidividual files may be included as

	#include <git2/index.h>

Signed-off-by: Vicent Marti <tanoku@gmail.com>
2010-12-06 23:03:16 +02:00
Vicent Marti
d12299fe22 Change include structure for the project
The maze with include dependencies has been fixed.
There is now a global include:

	#include <git.h>

The git_odb_backend API has been exposed.

Signed-off-by: Vicent Marti <tanoku@gmail.com>
2010-12-06 01:14:15 +02:00
Vicent Marti
8507ab12cf Improve build system for MSVC
Add options to select architecture and compiler version.
Removed dependency on 'grep'.
Fix debug mode flags being always empty.

Signed-off-by: Vicent Marti <tanoku@gmail.com>
2010-11-24 17:56:41 +02:00
Vicent Marti
0ef70b4a81 Make the test suite depend on the static library
Signed-off-by: Vicent Marti <tanoku@gmail.com>
2010-11-24 00:23:15 +02:00
Vicent Marti
405ac51182 Add --debug flag to toggle debugging
Signed-off-by: Vicent Marti <tanoku@gmail.com>
2010-11-24 00:23:15 +02:00
Vicent Marti
f8b422b6d4 Use the proper Zlib version with MSVC
Signed-off-by: Vicent Marti <tanoku@gmail.com>
2010-11-24 00:23:15 +02:00
Vicent Marti
5dc2bee153 Fix compilation in Win32
Currently, libgit2 compiles and passes all tests under MinGW, and
compiles but fails the test suite on MSVC 2010.

Signed-off-by: Vicent Marti <tanoku@gmail.com>
2010-11-24 00:23:15 +02:00
Vicent Marti
e06551e51c Add library dependencies to the build
The libgit2 shared library must be linked with all the dynamic libraries
it depends (z, openssl).

These libraries are now automatically detected during the configuration
phase.

Also, removed the linking dependency on libgit2 which Scott added: if
you link libgit2 with itself, the universe could implode, and we don't
want that to happen.

Signed-off-by: Vicent Marti <tanoku@gmail.com>
2010-11-24 00:23:15 +02:00
Scott Chacon
c34a044f4e add library includes, remove Makefile and readme update for waf 2010-11-24 00:23:14 +02:00
Vicent Marti
d910be2105 Add separate commands for all possible actions
The build script now supports all the required features

Signed-off-by: Vicent Marti <tanoku@gmail.com>
2010-11-24 00:23:14 +02:00
Vicent Marti
b2898c4500 Add more features to the build system
- Windows 32 compilation
	- Test system
	- Shared and static libraries

Signed-off-by: Vicent Marti <tanoku@gmail.com>
2010-11-24 00:23:14 +02:00
Vicent Marti
357547fa12 Change to waf as the buildsystem
Signed-off-by: Vicent Marti <tanoku@gmail.com>
2010-11-24 00:23:14 +02:00