Commit d02a7d83 by Vicent Marti

Update Clay

parent 35e9407c
......@@ -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
/*
* 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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment