Commit a014a083d9010e7f1ad0a00e6b48b75d6616edde

Vicent Martí 2011-10-14T16:32:00

Merge pull request #459 from brodie/test-improvements tests: propagate errors from open_temp_repo() instead of exiting

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/tests/test_helpers.c b/tests/test_helpers.c
index 0900430..cb95607 100644
--- a/tests/test_helpers.c
+++ b/tests/test_helpers.c
@@ -217,10 +217,9 @@ int copydir_recurs(const char *source_directory_path, const char *destination_di
 
 int open_temp_repo(git_repository **repo, const char *path)
 {
-	if (copydir_recurs(path, TEMP_REPO_FOLDER) < GIT_SUCCESS) {
-		printf("\nFailed to create temporary folder. Aborting test suite.\n");
-		exit(-1);
-	}
+	int error;
+	if ((error = copydir_recurs(path, TEMP_REPO_FOLDER)) < GIT_SUCCESS)
+		return error;
 
 	return git_repository_open(repo, TEMP_REPO_FOLDER);
 }