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
d02a7d83
Commit
d02a7d83
authored
Sep 28, 2011
by
Vicent Marti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Clay
parent
35e9407c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
52 deletions
+46
-52
tests-clay/clay
+0
-0
tests-clay/clay.h
+36
-1
tests-clay/clay_main.c
+10
-51
No files found.
tests-clay/clay
View file @
d02a7d83
This diff is collapsed.
Click to expand it.
tests-clay/clay.h
View file @
d02a7d83
...
...
@@ -48,11 +48,46 @@ void cl_fixture_cleanup(const char *fixture_name);
#define cl_check_fail(expr) cl_check_fail_((expr), NULL)
#define cl_check(expr) cl_check_((expr), NULL)
/**
* Forced failure/warning
*/
#define cl_fail(desc) clay__assert(0, __FILE__, __LINE__, "Test failed.", desc, 1)
#define cl_warning(desc) clay__assert(0, __FILE__, __LINE__, "Warning during test execution:", desc, 0)
/**
* Test method declarations
*/
extern
void
test_core_dirent__dont_traverse_dot
(
void
);
extern
void
test_core_dirent__traverse_subfolder
(
void
);
extern
void
test_core_dirent__traverse_slash_terminated_folder
(
void
);
extern
void
test_core_dirent__dont_traverse_empty_folders
(
void
);
extern
void
test_core_dirent__traverse_weird_filenames
(
void
);
extern
void
test_core_filebuf__0
(
void
);
extern
void
test_core_filebuf__1
(
void
);
extern
void
test_core_filebuf__2
(
void
);
extern
void
test_core_path__0
(
void
);
extern
void
test_core_path__1
(
void
);
extern
void
test_core_path__2
(
void
);
extern
void
test_core_path__5
(
void
);
extern
void
test_core_path__6
(
void
);
extern
void
test_core_rmdir__initialize
(
void
);
extern
void
test_core_rmdir__delete_recursive
(
void
);
extern
void
test_core_rmdir__fail_to_delete_non_empty_dir
(
void
);
extern
void
test_core_string__0
(
void
);
extern
void
test_core_string__1
(
void
);
extern
void
test_core_vector__0
(
void
);
extern
void
test_core_vector__1
(
void
);
extern
void
test_core_vector__2
(
void
);
extern
void
test_network_remotes__initialize
(
void
);
extern
void
test_network_remotes__cleanup
(
void
);
extern
void
test_network_remotes__parsing
(
void
);
extern
void
test_network_remotes__refspec_parsing
(
void
);
extern
void
test_network_remotes__fnmatch
(
void
);
extern
void
test_network_remotes__transform
(
void
);
extern
void
test_status_single__hash_single_file
(
void
);
extern
void
test_status_worktree__initialize
(
void
);
extern
void
test_status_worktree__cleanup
(
void
);
extern
void
test_status_worktree__whole_repository
(
void
);
extern
void
test_status_worktree__empty_repository
(
void
);
#endif
tests-clay/clay_main.c
View file @
d02a7d83
/*
* Clay v0.7.0
*
* This is an autogenerated file. Do not modify.
* To add new unit tests or suites, regenerate the whole
* file with `./clay`
*/
#define clay_print(...) printf(__VA_ARGS__)
#include <assert.h>
#include <setjmp.h>
#include <stdlib.h>
...
...
@@ -20,6 +9,8 @@
#include <sys/types.h>
#include <sys/stat.h>
#define clay_print(...) printf(__VA_ARGS__)
#ifdef _WIN32
# include <windows.h>
# include <io.h>
...
...
@@ -27,7 +18,7 @@
# include <direct.h>
# pragma comment(lib, "shell32")
# define _CC __cdecl
# define _
MAIN_
CC __cdecl
# define stat(path, st) _stat(path, st)
# define mkdir(path, mode) _mkdir(path)
...
...
@@ -42,8 +33,9 @@
# endif
typedef
struct
_stat
STAT_T
;
#else
# include <sys/wait.h>
/* waitpid(2) */
# include <unistd.h>
# define _CC
# define _
MAIN_
CC
typedef
struct
stat
STAT_T
;
#endif
...
...
@@ -455,8 +447,11 @@ static int build_sandbox_path(void)
#ifdef _MSC_VER
if
(
_mktemp_s
(
_clay_path
,
sizeof
(
_clay_path
))
!=
0
)
return
-
1
;
if
(
mkdir
(
_clay_path
,
0700
)
!=
0
)
return
-
1
;
#else
if
(
mktemp
(
_clay_path
)
==
NULL
)
if
(
mk
d
temp
(
_clay_path
)
==
NULL
)
return
-
1
;
#endif
...
...
@@ -468,9 +463,6 @@ static int clay_sandbox(void)
if
(
_clay_path
[
0
]
==
'\0'
&&
build_sandbox_path
()
<
0
)
return
-
1
;
if
(
mkdir
(
_clay_path
,
0700
)
!=
0
)
return
-
1
;
if
(
chdir
(
_clay_path
)
!=
0
)
return
-
1
;
...
...
@@ -665,39 +657,6 @@ cl_fs_cleanup(void)
#endif
extern
void
test_core_dirent__dont_traverse_dot
(
void
);
extern
void
test_core_dirent__traverse_subfolder
(
void
);
extern
void
test_core_dirent__traverse_slash_terminated_folder
(
void
);
extern
void
test_core_dirent__dont_traverse_empty_folders
(
void
);
extern
void
test_core_dirent__traverse_weird_filenames
(
void
);
extern
void
test_core_filebuf__0
(
void
);
extern
void
test_core_filebuf__1
(
void
);
extern
void
test_core_filebuf__2
(
void
);
extern
void
test_core_path__0
(
void
);
extern
void
test_core_path__1
(
void
);
extern
void
test_core_path__2
(
void
);
extern
void
test_core_path__5
(
void
);
extern
void
test_core_path__6
(
void
);
extern
void
test_core_rmdir__initialize
(
void
);
extern
void
test_core_rmdir__delete_recursive
(
void
);
extern
void
test_core_rmdir__fail_to_delete_non_empty_dir
(
void
);
extern
void
test_core_string__0
(
void
);
extern
void
test_core_string__1
(
void
);
extern
void
test_core_vector__0
(
void
);
extern
void
test_core_vector__1
(
void
);
extern
void
test_core_vector__2
(
void
);
extern
void
test_network_remotes__initialize
(
void
);
extern
void
test_network_remotes__cleanup
(
void
);
extern
void
test_network_remotes__parsing
(
void
);
extern
void
test_network_remotes__refspec_parsing
(
void
);
extern
void
test_network_remotes__fnmatch
(
void
);
extern
void
test_network_remotes__transform
(
void
);
extern
void
test_status_single__hash_single_file
(
void
);
extern
void
test_status_worktree__initialize
(
void
);
extern
void
test_status_worktree__cleanup
(
void
);
extern
void
test_status_worktree__whole_repository
(
void
);
extern
void
test_status_worktree__empty_repository
(
void
);
static
const
struct
clay_func
_all_callbacks
[]
=
{
{
"dont_traverse_dot"
,
&
test_core_dirent__dont_traverse_dot
,
0
},
{
"traverse_subfolder"
,
&
test_core_dirent__traverse_subfolder
,
0
},
...
...
@@ -787,7 +746,7 @@ static const struct clay_suite _all_suites[] = {
static
const
char
_suites_str
[]
=
"core::dirent, core::filebuf, core::path, core::rmdir, core::string, core::vector, network::remotes, status::single, status::worktree"
;
int
_CC
main
(
int
argc
,
char
*
argv
[])
int
_
MAIN_
CC
main
(
int
argc
,
char
*
argv
[])
{
return
clay_test
(
argc
,
argv
,
_suites_str
,
...
...
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