Commit Graph

14 Commits

Author SHA1 Message Date
Kirill A. Shutemov
d568d5856b CMakefile: add -Wmissing-prototypes and fix warnings
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2011-08-30 23:55:22 +03:00
Kirill A. Shutemov
932d1baf29 cleanup: remove trailing spaces
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2011-07-01 18:02:56 +02:00
Vicent Marti
ab7941b5d9 test: Properly show error messages 2011-06-28 21:10:51 +02:00
schu
6628c2560c test_lib: add return value to git_test
Save the return value of functions not passing must_pass() and report
the returned error.

Signed-off-by: schu <schu-github@schulog.org>
2011-05-18 12:36:41 +02:00
Vicent Marti
3dccfed163 Cleanup the testing toolkit
Tests are now declared with detailed descriptions and a short test name:

	BEGIN_TEST(the_test0, "this is an example test that does something")
		...
	END_TEST

Modules are declared through a simple macro interface:

	BEGIN_MODULE(mod_name)
		ADD_TEST(the_test0);
		...
	END_MODULE

Error messages when tests fail have been greatly improved.

Signed-off-by: Vicent Marti <tanoku@gmail.com>
2011-03-03 20:23:52 +02:00
Vicent Marti
87d82994be Make the test return an error code on failure
Signed-off-by: Vicent Marti <tanoku@gmail.com>
2011-02-02 02:32:21 +02:00
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
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
Ramsay Jones
1e5dd57214 Fix some coding style issues
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
2010-02-28 20:09:45 +00:00
Ramsay Jones
cfe3a027ab Use a 64 bit off_t throughout the library and tests on POSIX
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
2010-01-20 20:13:07 +00:00
Julio Espinoza-Sokal
73c4dd9253 Add noreturn declaration compatible with the MSVC compiler.
MSVC provides a compiler declaration to declare that a function
never returns. This declaration is required in front of the
function definition rather than at the end, but fortunately gcc
is compatible with this location as well.

Explicit returns are no longer required after calls to test_die.

Signed-off-by: Julio Espinoza-Sokal <julioes@gmail.com>
Signed-off-by: Andreas Ericsson <ae@op5.se>
2009-06-16 11:40:14 +02:00
Shawn O. Pearce
b7c891c629 Add git_oid_cpy, git_oid_cmp as inline functions
These are easily built off the standard C library functions memcpy
and memcmp.  By marking these inline we stand a good chance of
the C compiler replacing the entire thing with tight machine code,
because many compilers will actually inline a memcmp or memcpy when
the 3rd argument (the size) is a constant value.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-11-03 18:43:04 -08:00
Shawn O. Pearce
fbbfdf9f13 Move GIT_NORETURN into test_lib.h only
We should never have a noreturn style function in the library
itself, as such a function would prevent the calling application
from handling error conditions the way it wants.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-11-03 18:42:54 -08:00
Shawn O. Pearce
15bffce9f7 Create a basic test suite for the library and test oid functions
This is a horribly simple test suite that makes it fairly easy to
put together some basic function level unit tests on the library.
Its patterned somewhat after the test suite in git.git, but also
after the "Check" test library.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-11-01 18:24:39 -07:00