mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
Port the HTTP unit tests. Most are still legacy (since they use test_ok so much), but at least they no longer exit(1) on failure
svn:r1076
This commit is contained in:
parent
241690b230
commit
153093ecc3
@ -2314,9 +2314,6 @@ end:
|
|||||||
event_config_free(cfg);
|
event_config_free(cfg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* All the flags we set */
|
|
||||||
#define TT_ISOLATED TT_FORK|TT_NEED_SOCKETPAIR|TT_NEED_BASE
|
|
||||||
|
|
||||||
struct testcase_t legacy_testcases[] = {
|
struct testcase_t legacy_testcases[] = {
|
||||||
/* Some converted-over tests */
|
/* Some converted-over tests */
|
||||||
{ "methods", test_methods, TT_FORK, NULL, NULL },
|
{ "methods", test_methods, TT_FORK, NULL, NULL },
|
||||||
@ -2392,8 +2389,6 @@ legacy_main(void)
|
|||||||
regress_zlib();
|
regress_zlib();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
http_suite();
|
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
rpc_suite();
|
rpc_suite();
|
||||||
#endif
|
#endif
|
||||||
|
@ -37,12 +37,10 @@ extern "C" {
|
|||||||
extern struct testcase_t legacy_testcases[];
|
extern struct testcase_t legacy_testcases[];
|
||||||
extern struct testcase_t util_testcases[];
|
extern struct testcase_t util_testcases[];
|
||||||
extern struct testcase_t signal_testcases[];
|
extern struct testcase_t signal_testcases[];
|
||||||
|
extern struct testcase_t http_testcases[];
|
||||||
|
|
||||||
int legacy_main(void);
|
int legacy_main(void);
|
||||||
|
|
||||||
void http_suite(void);
|
|
||||||
void http_basic_test(void);
|
|
||||||
|
|
||||||
void rpc_suite(void);
|
void rpc_suite(void);
|
||||||
|
|
||||||
void dns_suite(void);
|
void dns_suite(void);
|
||||||
@ -66,6 +64,9 @@ void run_legacy_test_fn(void *ptr);
|
|||||||
#define TT_NEED_SOCKETPAIR TT_FIRST_USER_FLAG
|
#define TT_NEED_SOCKETPAIR TT_FIRST_USER_FLAG
|
||||||
#define TT_NEED_BASE (TT_FIRST_USER_FLAG<<1)
|
#define TT_NEED_BASE (TT_FIRST_USER_FLAG<<1)
|
||||||
|
|
||||||
|
/* All the flags that a legacy test needs. */
|
||||||
|
#define TT_ISOLATED TT_FORK|TT_NEED_SOCKETPAIR|TT_NEED_BASE
|
||||||
|
|
||||||
#define LEGACY(name,flags) \
|
#define LEGACY(name,flags) \
|
||||||
{ #name, run_legacy_test_fn, flags, &legacy_setup, \
|
{ #name, run_legacy_test_fn, flags, &legacy_setup, \
|
||||||
test_## name }
|
test_## name }
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -100,9 +100,9 @@ legacy_test_setup(const struct testcase_t *testcase)
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (testcase->flags & TT_NEED_BASE) {
|
if (testcase->flags & TT_NEED_BASE) {
|
||||||
global_base = event_init();
|
global_base = event_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
return testcase->setup_data;
|
return testcase->setup_data;
|
||||||
}
|
}
|
||||||
@ -165,6 +165,7 @@ struct testgroup_t testgroups[] = {
|
|||||||
{ "main/", legacy_testcases },
|
{ "main/", legacy_testcases },
|
||||||
{ "signal/", signal_testcases },
|
{ "signal/", signal_testcases },
|
||||||
{ "util/", util_testcases },
|
{ "util/", util_testcases },
|
||||||
|
{ "http/", http_testcases },
|
||||||
END_OF_GROUPS
|
END_OF_GROUPS
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user