libuv 1.45.0, #include cleanup, probably something else.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4308 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2023-05-21 21:36:51 +00:00
parent 1ccb9183b4
commit f421606e21
299 changed files with 7167 additions and 4918 deletions

View File

@ -33,19 +33,12 @@
# if defined(__APPLE__) || \
defined(__DragonFly__) || \
defined(__FreeBSD__) || \
defined(__FreeBSD_kernel__) || \
defined(__OpenBSD__) || \
defined(__NetBSD__)
# define HAVE_KQUEUE 1
# endif
#endif
#if defined(__arm__)/* Increase the timeout so the test passes on arm CI bots */
# define CREATE_TIMEOUT 100
#else
# define CREATE_TIMEOUT 1
#endif
static uv_fs_event_t fs_event;
static const char file_prefix[] = "fsevent-";
static const int fs_event_file_count = 16;
@ -163,10 +156,7 @@ static void fs_event_create_files(uv_timer_t* handle) {
if (++fs_event_created < fs_event_file_count) {
/* Create another file on a different event loop tick. We do it this way
* to avoid fs events coalescing into one fs event. */
ASSERT(0 == uv_timer_start(&timer,
fs_event_create_files,
CREATE_TIMEOUT,
0));
ASSERT_EQ(0, uv_timer_start(&timer, fs_event_create_files, 100, 0));
}
}
@ -242,7 +232,8 @@ static void fs_event_create_files_in_subdir(uv_timer_t* handle) {
if (++fs_event_created < fs_event_file_count) {
/* Create another file on a different event loop tick. We do it this way
* to avoid fs events coalescing into one fs event. */
ASSERT(0 == uv_timer_start(&timer, fs_event_create_files_in_subdir, 1, 0));
ASSERT_EQ(0,
uv_timer_start(&timer, fs_event_create_files_in_subdir, 100, 0));
}
}
@ -441,7 +432,7 @@ TEST_IMPL(fs_event_watch_dir) {
remove("watch_dir/file1");
remove("watch_dir/");
MAKE_VALGRIND_HAPPY();
MAKE_VALGRIND_HAPPY(loop);
return 0;
}
@ -503,7 +494,7 @@ TEST_IMPL(fs_event_watch_dir_recursive) {
remove("watch_dir/subdir");
remove("watch_dir/");
MAKE_VALGRIND_HAPPY();
MAKE_VALGRIND_HAPPY(loop);
return 0;
#else
RETURN_SKIP("Recursive directory watching not supported on this platform.");
@ -550,7 +541,7 @@ TEST_IMPL(fs_event_watch_dir_short_path) {
remove("watch_dir/file1");
remove("watch_dir/");
MAKE_VALGRIND_HAPPY();
MAKE_VALGRIND_HAPPY(loop);
if (!has_shortnames)
RETURN_SKIP("Was not able to address files with 8.3 short name.");
@ -596,7 +587,7 @@ TEST_IMPL(fs_event_watch_file) {
remove("watch_dir/file1");
remove("watch_dir/");
MAKE_VALGRIND_HAPPY();
MAKE_VALGRIND_HAPPY(loop);
return 0;
}
@ -623,7 +614,7 @@ TEST_IMPL(fs_event_watch_file_exact_path) {
create_file("watch_dir/file.js");
create_file("watch_dir/file.jsx");
#if defined(__APPLE__) && !defined(MAC_OS_X_VERSION_10_12)
/* Empirically, FSEvents seems to (reliably) report the preceeding
/* Empirically, FSEvents seems to (reliably) report the preceding
* create_file events prior to macOS 10.11.6 in the subsequent fs_watch
* creation, but that behavior hasn't been observed to occur on newer
* versions. Give a long delay here to let the system settle before running
@ -649,7 +640,7 @@ TEST_IMPL(fs_event_watch_file_exact_path) {
remove("watch_dir/file.jsx");
remove("watch_dir/");
MAKE_VALGRIND_HAPPY();
MAKE_VALGRIND_HAPPY(loop);
return 0;
}
@ -673,7 +664,7 @@ TEST_IMPL(fs_event_watch_file_twice) {
ASSERT(0 == uv_timer_start(&timer, timer_cb_watch_twice, 10, 0));
ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT));
MAKE_VALGRIND_HAPPY();
MAKE_VALGRIND_HAPPY(loop);
return 0;
}
@ -691,7 +682,7 @@ TEST_IMPL(fs_event_watch_file_current_dir) {
remove("watch_file");
create_file("watch_file");
#if defined(__APPLE__) && !defined(MAC_OS_X_VERSION_10_12)
/* Empirically, kevent seems to (sometimes) report the preceeding
/* Empirically, kevent seems to (sometimes) report the preceding
* create_file events prior to macOS 10.11.6 in the subsequent fs_event_start
* So let the system settle before running the test. */
uv_sleep(1100);
@ -728,7 +719,7 @@ TEST_IMPL(fs_event_watch_file_current_dir) {
/* Cleanup */
remove("watch_file");
MAKE_VALGRIND_HAPPY();
MAKE_VALGRIND_HAPPY(loop);
return 0;
}
@ -754,7 +745,7 @@ TEST_IMPL(fs_event_watch_file_root_dir) {
uv_close((uv_handle_t*) &fs_event, NULL);
MAKE_VALGRIND_HAPPY();
MAKE_VALGRIND_HAPPY(loop);
return 0;
}
#endif
@ -793,7 +784,7 @@ TEST_IMPL(fs_event_no_callback_after_close) {
remove("watch_dir/file1");
remove("watch_dir/");
MAKE_VALGRIND_HAPPY();
MAKE_VALGRIND_HAPPY(loop);
return 0;
}
@ -830,7 +821,7 @@ TEST_IMPL(fs_event_no_callback_on_close) {
remove("watch_dir/file1");
remove("watch_dir/");
MAKE_VALGRIND_HAPPY();
MAKE_VALGRIND_HAPPY(loop);
return 0;
}
@ -868,7 +859,7 @@ TEST_IMPL(fs_event_immediate_close) {
ASSERT(close_cb_called == 2);
MAKE_VALGRIND_HAPPY();
MAKE_VALGRIND_HAPPY(loop);
return 0;
}
@ -903,7 +894,7 @@ TEST_IMPL(fs_event_close_with_pending_event) {
remove("watch_dir/file");
remove("watch_dir/");
MAKE_VALGRIND_HAPPY();
MAKE_VALGRIND_HAPPY(loop);
return 0;
}
@ -941,7 +932,7 @@ TEST_IMPL(fs_event_close_with_pending_delete_event) {
/* Clean up */
remove("watch_dir/");
MAKE_VALGRIND_HAPPY();
MAKE_VALGRIND_HAPPY(loop);
return 0;
}
@ -982,7 +973,7 @@ TEST_IMPL(fs_event_close_in_callback) {
fs_event_unlink_files(NULL);
remove("watch_dir/");
MAKE_VALGRIND_HAPPY();
MAKE_VALGRIND_HAPPY(loop);
return 0;
}
@ -1017,7 +1008,7 @@ TEST_IMPL(fs_event_start_and_close) {
ASSERT(close_cb_called == 2);
remove("watch_dir/");
MAKE_VALGRIND_HAPPY();
MAKE_VALGRIND_HAPPY(loop);
return 0;
}
@ -1070,7 +1061,7 @@ TEST_IMPL(fs_event_getpath) {
}
remove("watch_dir/");
MAKE_VALGRIND_HAPPY();
MAKE_VALGRIND_HAPPY(loop);
return 0;
}
@ -1159,7 +1150,7 @@ TEST_IMPL(fs_event_error_reporting) {
} while (i-- != 0);
remove("watch_dir/");
MAKE_VALGRIND_HAPPY();
MAKE_VALGRIND_HAPPY(uv_default_loop());
return 0;
}
@ -1168,7 +1159,7 @@ TEST_IMPL(fs_event_error_reporting) {
TEST_IMPL(fs_event_error_reporting) {
/* No-op, needed only for FSEvents backend */
MAKE_VALGRIND_HAPPY();
MAKE_VALGRIND_HAPPY(uv_default_loop());
return 0;
}
@ -1191,7 +1182,7 @@ TEST_IMPL(fs_event_watch_invalid_path) {
r = uv_fs_event_start(&fs_event, fs_event_cb_file, "", 0);
ASSERT(r != 0);
ASSERT(uv_is_active((uv_handle_t*) &fs_event) == 0);
MAKE_VALGRIND_HAPPY();
MAKE_VALGRIND_HAPPY(loop);
return 0;
}
@ -1237,6 +1228,6 @@ TEST_IMPL(fs_event_stop_in_cb) {
remove(path);
MAKE_VALGRIND_HAPPY();
MAKE_VALGRIND_HAPPY(uv_default_loop());
return 0;
}