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
71ba28e3
Commit
71ba28e3
authored
Mar 28, 2014
by
Vicent Marti
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2214 from ethomson/sandbox_config
RFC: Sandbox HOME during test execution
parents
04d4d674
e0d61c7b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
4 deletions
+45
-4
tests/clar.c
+24
-3
tests/clar.h
+6
-0
tests/clar/sandbox.h
+5
-0
tests/main.c
+10
-1
No files found.
tests/clar.c
View file @
71ba28e3
...
...
@@ -353,8 +353,8 @@ clar_parse_args(int argc, char **argv)
}
}
int
clar_test
(
int
argc
,
char
**
argv
)
void
clar_test
_init
(
int
argc
,
char
**
argv
)
{
clar_print_init
(
(
int
)
_clar_callback_count
,
...
...
@@ -369,13 +369,23 @@ clar_test(int argc, char **argv)
if
(
argc
>
1
)
clar_parse_args
(
argc
,
argv
);
}
int
clar_test_run
()
{
if
(
!
_clar
.
suites_ran
)
{
size_t
i
;
for
(
i
=
0
;
i
<
_clar_suite_count
;
++
i
)
clar_run_suite
(
&
_clar_suites
[
i
],
NULL
);
}
return
_clar
.
total_errors
;
}
void
clar_test_shutdown
()
{
clar_print_shutdown
(
_clar
.
tests_ran
,
(
int
)
_clar_suite_count
,
...
...
@@ -383,7 +393,18 @@ clar_test(int argc, char **argv)
);
clar_unsandbox
();
return
_clar
.
total_errors
;
}
int
clar_test
(
int
argc
,
char
**
argv
)
{
int
errors
;
clar_test_init
(
argc
,
argv
);
errors
=
clar_test_run
();
clar_test_shutdown
();
return
errors
;
}
void
clar__fail
(
...
...
tests/clar.h
View file @
71ba28e3
...
...
@@ -9,8 +9,14 @@
#include <stdlib.h>
void
clar_test_init
(
int
argc
,
char
*
argv
[]);
int
clar_test_run
(
void
);
void
clar_test_shutdown
(
void
);
int
clar_test
(
int
argc
,
char
*
argv
[]);
const
char
*
clar_sandbox_path
(
void
);
void
cl_set_cleanup
(
void
(
*
cleanup
)(
void
*
),
void
*
opaque
);
void
cl_fs_cleanup
(
void
);
...
...
tests/clar/sandbox.h
View file @
71ba28e3
...
...
@@ -127,3 +127,8 @@ static int clar_sandbox(void)
return
0
;
}
const
char
*
clar_sandbox_path
(
void
)
{
return
_clar_path
;
}
tests/main.c
View file @
71ba28e3
...
...
@@ -6,12 +6,21 @@ int __cdecl main(int argc, char *argv[])
int
main
(
int
argc
,
char
*
argv
[])
#endif
{
const
char
*
sandbox_path
;
int
res
;
clar_test_init
(
argc
,
argv
);
git_threads_init
();
sandbox_path
=
clar_sandbox_path
();
git_libgit2_opts
(
GIT_OPT_SET_SEARCH_PATH
,
GIT_CONFIG_LEVEL_GLOBAL
,
sandbox_path
);
git_libgit2_opts
(
GIT_OPT_SET_SEARCH_PATH
,
GIT_CONFIG_LEVEL_XDG
,
sandbox_path
);
/* Run the test suite */
res
=
clar_test
(
argc
,
argv
);
res
=
clar_test_run
();
clar_test_shutdown
();
giterr_clear
();
git_threads_shutdown
();
...
...
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