diff options
author | Vicent Marti <tanoku@gmail.com> | 2011-03-03 18:19:05 +0200 |
---|---|---|
committer | Vicent Marti <tanoku@gmail.com> | 2011-03-03 20:23:52 +0200 |
commit | 3dccfed16382c64370dd0fd88668c9d9accae6ed (patch) | |
tree | 21406b78ecda452244d9ceb64e5ac9ea8337ffd9 /tests/test_helpers.h | |
parent | 8fc050961c6f5d3bc8f2bc27799922bebae4b743 (diff) | |
download | libgit2-3dccfed16382c64370dd0fd88668c9d9accae6ed.tar.gz |
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>
Diffstat (limited to 'tests/test_helpers.h')
-rw-r--r-- | tests/test_helpers.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/test_helpers.h b/tests/test_helpers.h index af5a0a908..78538d51c 100644 --- a/tests/test_helpers.h +++ b/tests/test_helpers.h @@ -36,8 +36,9 @@ #define TEST_INDEX2_PATH (TEST_RESOURCES "/gitgit.index") #define TEST_INDEXBIG_PATH (TEST_RESOURCES "/big.index") -#define TEMP_DIR_WITHOUT_TRAILING_SLASH TEST_RESOURCES "/temp_working" -#define TEMP_DIR TEMP_DIR_WITHOUT_TRAILING_SLASH "/" +#define TEMP_FOLDER "./" +#define TEMP_REPO_FOLDER TEMP_FOLDER TEST_REPOSITORY_NAME "/" +#define TEMP_REPO_FOLDER_NS TEMP_FOLDER TEST_REPOSITORY_NAME typedef struct object_data { unsigned char *bytes; /* (compressed) bytes stored in object store */ @@ -62,8 +63,11 @@ extern int remove_loose_object(const char *odb_dir, git_object *object); extern int cmp_files(const char *a, const char *b); extern int copy_file(const char *source, const char *dest); -extern int rmdir_recurs(char *directory_path); -extern int copydir_recurs(char *source_directory_path, char *destination_directory_path); +extern int rmdir_recurs(const char *directory_path); +extern int copydir_recurs(const char *source_directory_path, const char *destination_directory_path); + +extern int open_temp_repo(git_repository **repo, const char *path); +extern void close_temp_repo(git_repository *repo); #endif /* INCLUDE_test_helpers_h__ */ |