diff options
author | Vicent Marti <tanoku@gmail.com> | 2011-09-28 18:57:32 +0200 |
---|---|---|
committer | Vicent Marti <tanoku@gmail.com> | 2011-09-28 18:57:32 +0200 |
commit | d02a7d833083518353ede8c940410d5229e83e48 (patch) | |
tree | 0383712b04e1352e780703c285e8d4aafa4ab143 /tests-clay/clay_main.c | |
parent | 35e9407c4698080b29f2bcb3d379454bb0ae62bb (diff) | |
download | libgit2-d02a7d833083518353ede8c940410d5229e83e48.tar.gz |
Update Clay
Diffstat (limited to 'tests-clay/clay_main.c')
-rw-r--r-- | tests-clay/clay_main.c | 61 |
1 files changed, 10 insertions, 51 deletions
diff --git a/tests-clay/clay_main.c b/tests-clay/clay_main.c index 25342e7ee..602ca1c63 100644 --- a/tests-clay/clay_main.c +++ b/tests-clay/clay_main.c @@ -1,14 +1,3 @@ - -/* - * 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 (mkdtemp(_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, |