Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2011-07-07 03:04:14 +0400
committerVicent Marti <tanoku@gmail.com>2011-07-07 04:54:07 +0400
commitc63aa494595a6d6e6d97cfa1bbc1741a0b2e0cc6 (patch)
treed38fa1cb930c0f6cd2f40d2a33586fe151d5eb6f /tests
parentdbede305bfb434cdb90b6f7850ab9791bd94d739 (diff)
test: Abort when the temp workdir cannot be created
Diffstat (limited to 'tests')
-rw-r--r--tests/test_helpers.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/test_helpers.c b/tests/test_helpers.c
index d6c924212..0900430e1 100644
--- a/tests/test_helpers.c
+++ b/tests/test_helpers.c
@@ -217,9 +217,10 @@ int copydir_recurs(const char *source_directory_path, const char *destination_di
int open_temp_repo(git_repository **repo, const char *path)
{
- int error;
- if ((error = copydir_recurs(path, TEMP_REPO_FOLDER)) < GIT_SUCCESS)
- return error;
+ if (copydir_recurs(path, TEMP_REPO_FOLDER) < GIT_SUCCESS) {
+ printf("\nFailed to create temporary folder. Aborting test suite.\n");
+ exit(-1);
+ }
return git_repository_open(repo, TEMP_REPO_FOLDER);
}
@@ -227,7 +228,10 @@ int open_temp_repo(git_repository **repo, const char *path)
void close_temp_repo(git_repository *repo)
{
git_repository_free(repo);
- git_futils_rmdir_r(TEMP_REPO_FOLDER, 1);
+ if (git_futils_rmdir_r(TEMP_REPO_FOLDER, 1) < GIT_SUCCESS) {
+ printf("\nFailed to remove temporary folder. Aborting test suite.\n");
+ exit(-1);
+ }
}
static int remove_placeholders_recurs(void *filename, char *path)