Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
87d82994
Commit
87d82994
authored
Feb 02, 2011
by
Vicent Marti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the test return an error code on failure
Signed-off-by: Vicent Marti <tanoku@gmail.com>
parent
b02c371e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
6 deletions
+10
-6
tests/test_lib.c
+3
-1
tests/test_lib.h
+2
-2
tests/test_main.c
+5
-3
No files found.
tests/test_lib.c
View file @
87d82994
...
@@ -157,7 +157,7 @@ static void print_details(git_testsuite *ts)
...
@@ -157,7 +157,7 @@ static void print_details(git_testsuite *ts)
}
}
}
}
void
git_testsuite_run
(
git_testsuite
*
ts
)
int
git_testsuite_run
(
git_testsuite
*
ts
)
{
{
int
i
;
int
i
;
...
@@ -175,5 +175,7 @@ void git_testsuite_run(git_testsuite *ts)
...
@@ -175,5 +175,7 @@ void git_testsuite_run(git_testsuite *ts)
}
}
printf
(
"
\n
"
);
printf
(
"
\n
"
);
print_details
(
ts
);
print_details
(
ts
);
return
ts
->
fail_count
;
}
}
tests/test_lib.h
View file @
87d82994
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
#include <git2.h>
#include <git2.h>
#define ADD_TEST(SUITE, MODULE, TEST) \
#define ADD_TEST(SUITE, MODULE, TEST) \
git_testsuite_add(SUITE, git_test_new(
#TEST " (" MODULE ")"
, &_gittest__##TEST))
git_testsuite_add(SUITE, git_test_new(
MODULE "::" #TEST
, &_gittest__##TEST))
#define BEGIN_TEST(MODULE, TEST) \
#define BEGIN_TEST(MODULE, TEST) \
void _gittest__##TEST(git_test *_gittest) \
void _gittest__##TEST(git_test *_gittest) \
...
@@ -38,7 +38,7 @@ void git_testsuite_free(git_testsuite *ts);
...
@@ -38,7 +38,7 @@ void git_testsuite_free(git_testsuite *ts);
void
git_testsuite_add
(
git_testsuite
*
ts
,
git_test
*
tc
);
void
git_testsuite_add
(
git_testsuite
*
ts
,
git_test
*
tc
);
void
git_testsuite_addsuite
(
git_testsuite
*
ts
,
git_testsuite
*
ts2
);
void
git_testsuite_addsuite
(
git_testsuite
*
ts
,
git_testsuite
*
ts2
);
void
git_testsuite_run
(
git_testsuite
*
ts
);
int
git_testsuite_run
(
git_testsuite
*
ts
);
#endif
#endif
tests/test_main.c
View file @
87d82994
...
@@ -87,18 +87,20 @@ void libgit2_free_suites(git_testsuite **suites)
...
@@ -87,18 +87,20 @@ void libgit2_free_suites(git_testsuite **suites)
int
main
(
int
GIT_UNUSED
(
argc
),
char
*
GIT_UNUSED
(
argv
[]))
int
main
(
int
GIT_UNUSED
(
argc
),
char
*
GIT_UNUSED
(
argv
[]))
{
{
unsigned
int
i
;
unsigned
int
i
,
failures
;
git_testsuite
**
suites
;
git_testsuite
**
suites
;
GIT_UNUSED_ARG
(
argc
);
GIT_UNUSED_ARG
(
argc
);
GIT_UNUSED_ARG
(
argv
);
GIT_UNUSED_ARG
(
argv
);
suites
=
libgit2_get_suites
();
suites
=
libgit2_get_suites
();
failures
=
0
;
for
(
i
=
0
;
i
<
GIT_SUITE_COUNT
;
++
i
)
for
(
i
=
0
;
i
<
GIT_SUITE_COUNT
;
++
i
)
git_testsuite_run
(
suites
[
i
]);
failures
+=
git_testsuite_run
(
suites
[
i
]);
libgit2_free_suites
(
suites
);
libgit2_free_suites
(
suites
);
return
0
;
return
failures
?
-
1
:
0
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment