test: factor out fsevents skip explanation

Factor out a dedicated test macro for use on platforms that
do not support fsevents instead of duplicating the os390
platform condition and explanation text.

PR-URL: https://github.com/libuv/libuv/pull/1312
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
This commit is contained in:
Brad King 2017-02-20 22:03:11 -05:00 committed by Ben Noordhuis
parent 470b0258b0
commit f4f1f57e7c
3 changed files with 32 additions and 28 deletions

View File

@ -209,4 +209,8 @@ UNUSED static int can_ipv6(void) {
return supported; return supported;
} }
#if defined(__MVS__)
# define NO_FS_EVENTS "Filesystem watching not supported on this platform."
#endif
#endif /* TASK_H_ */ #endif /* TASK_H_ */

View File

@ -394,8 +394,8 @@ static void timer_cb_watch_twice(uv_timer_t* handle) {
} }
TEST_IMPL(fs_event_watch_dir) { TEST_IMPL(fs_event_watch_dir) {
#if defined(__MVS__) #if defined(NO_FS_EVENTS)
RETURN_SKIP("Filesystem watching not supported on this platform."); RETURN_SKIP(NO_FS_EVENTS);
#endif #endif
uv_loop_t* loop = uv_default_loop(); uv_loop_t* loop = uv_default_loop();
@ -477,8 +477,8 @@ TEST_IMPL(fs_event_watch_dir_recursive) {
TEST_IMPL(fs_event_watch_file) { TEST_IMPL(fs_event_watch_file) {
#if defined(__MVS__) #if defined(NO_FS_EVENTS)
RETURN_SKIP("Filesystem watching not supported on this platform."); RETURN_SKIP(NO_FS_EVENTS);
#endif #endif
uv_loop_t* loop = uv_default_loop(); uv_loop_t* loop = uv_default_loop();
@ -522,8 +522,8 @@ TEST_IMPL(fs_event_watch_file_exact_path) {
"file.js". The test verifies that no events occur for file.jsx. "file.js". The test verifies that no events occur for file.jsx.
*/ */
#if defined(__MVS__) #if defined(NO_FS_EVENTS)
RETURN_SKIP("Filesystem watching not supported on this platform."); RETURN_SKIP(NO_FS_EVENTS);
#endif #endif
uv_loop_t* loop; uv_loop_t* loop;
@ -561,8 +561,8 @@ TEST_IMPL(fs_event_watch_file_exact_path) {
} }
TEST_IMPL(fs_event_watch_file_twice) { TEST_IMPL(fs_event_watch_file_twice) {
#if defined(__MVS__) #if defined(NO_FS_EVENTS)
RETURN_SKIP("Filesystem watching not supported on this platform."); RETURN_SKIP(NO_FS_EVENTS);
#endif #endif
const char path[] = "test/fixtures/empty_file"; const char path[] = "test/fixtures/empty_file";
uv_fs_event_t watchers[2]; uv_fs_event_t watchers[2];
@ -585,8 +585,8 @@ TEST_IMPL(fs_event_watch_file_twice) {
} }
TEST_IMPL(fs_event_watch_file_current_dir) { TEST_IMPL(fs_event_watch_file_current_dir) {
#if defined(__MVS__) #if defined(NO_FS_EVENTS)
RETURN_SKIP("Filesystem watching not supported on this platform."); RETURN_SKIP(NO_FS_EVENTS);
#endif #endif
uv_timer_t timer; uv_timer_t timer;
uv_loop_t* loop; uv_loop_t* loop;
@ -658,8 +658,8 @@ TEST_IMPL(fs_event_watch_file_root_dir) {
#endif #endif
TEST_IMPL(fs_event_no_callback_after_close) { TEST_IMPL(fs_event_no_callback_after_close) {
#if defined(__MVS__) #if defined(NO_FS_EVENTS)
RETURN_SKIP("Filesystem watching not supported on this platform."); RETURN_SKIP(NO_FS_EVENTS);
#endif #endif
uv_loop_t* loop = uv_default_loop(); uv_loop_t* loop = uv_default_loop();
@ -696,8 +696,8 @@ TEST_IMPL(fs_event_no_callback_after_close) {
} }
TEST_IMPL(fs_event_no_callback_on_close) { TEST_IMPL(fs_event_no_callback_on_close) {
#if defined(__MVS__) #if defined(NO_FS_EVENTS)
RETURN_SKIP("Filesystem watching not supported on this platform."); RETURN_SKIP(NO_FS_EVENTS);
#endif #endif
uv_loop_t* loop = uv_default_loop(); uv_loop_t* loop = uv_default_loop();
@ -747,8 +747,8 @@ static void timer_cb(uv_timer_t* handle) {
TEST_IMPL(fs_event_immediate_close) { TEST_IMPL(fs_event_immediate_close) {
#if defined(__MVS__) #if defined(NO_FS_EVENTS)
RETURN_SKIP("Filesystem watching not supported on this platform."); RETURN_SKIP(NO_FS_EVENTS);
#endif #endif
uv_timer_t timer; uv_timer_t timer;
uv_loop_t* loop; uv_loop_t* loop;
@ -772,8 +772,8 @@ TEST_IMPL(fs_event_immediate_close) {
TEST_IMPL(fs_event_close_with_pending_event) { TEST_IMPL(fs_event_close_with_pending_event) {
#if defined(__MVS__) #if defined(NO_FS_EVENTS)
RETURN_SKIP("Filesystem watching not supported on this platform."); RETURN_SKIP(NO_FS_EVENTS);
#endif #endif
uv_loop_t* loop; uv_loop_t* loop;
int r; int r;
@ -818,8 +818,8 @@ static void fs_event_cb_close(uv_fs_event_t* handle, const char* filename,
} }
TEST_IMPL(fs_event_close_in_callback) { TEST_IMPL(fs_event_close_in_callback) {
#if defined(__MVS__) #if defined(NO_FS_EVENTS)
RETURN_SKIP("Filesystem watching not supported on this platform."); RETURN_SKIP(NO_FS_EVENTS);
#endif #endif
uv_loop_t* loop; uv_loop_t* loop;
int r; int r;
@ -857,8 +857,8 @@ TEST_IMPL(fs_event_close_in_callback) {
} }
TEST_IMPL(fs_event_start_and_close) { TEST_IMPL(fs_event_start_and_close) {
#if defined(__MVS__) #if defined(NO_FS_EVENTS)
RETURN_SKIP("Filesystem watching not supported on this platform."); RETURN_SKIP(NO_FS_EVENTS);
#endif #endif
uv_loop_t* loop; uv_loop_t* loop;
uv_fs_event_t fs_event1; uv_fs_event_t fs_event1;
@ -892,8 +892,8 @@ TEST_IMPL(fs_event_start_and_close) {
} }
TEST_IMPL(fs_event_getpath) { TEST_IMPL(fs_event_getpath) {
#if defined(__MVS__) #if defined(NO_FS_EVENTS)
RETURN_SKIP("Filesystem watching not supported on this platform."); RETURN_SKIP(NO_FS_EVENTS);
#endif #endif
uv_loop_t* loop = uv_default_loop(); uv_loop_t* loop = uv_default_loop();
int r; int r;
@ -1029,8 +1029,8 @@ TEST_IMPL(fs_event_error_reporting) {
#endif /* defined(__APPLE__) */ #endif /* defined(__APPLE__) */
TEST_IMPL(fs_event_watch_invalid_path) { TEST_IMPL(fs_event_watch_invalid_path) {
#if defined(__MVS__) #if defined(NO_FS_EVENTS)
RETURN_SKIP("Filesystem watching not supported on this platform."); RETURN_SKIP(NO_FS_EVENTS);
#endif #endif
uv_loop_t* loop; uv_loop_t* loop;

View File

@ -194,8 +194,8 @@ TEST_IMPL(timer_ref2) {
TEST_IMPL(fs_event_ref) { TEST_IMPL(fs_event_ref) {
#if defined(__MVS__) #if defined(NO_FS_EVENTS)
RETURN_SKIP("Filesystem watching not supported on this platform."); RETURN_SKIP(NO_FS_EVENTS);
#endif #endif
uv_fs_event_t h; uv_fs_event_t h;
uv_fs_event_init(uv_default_loop(), &h); uv_fs_event_init(uv_default_loop(), &h);