Browse Source

[tests] stub out config funcs in test_mod_*

personal/stbuehler/ci-build
Glenn Strauss 1 year ago
parent
commit
8b7e110973
  1. 18
      src/CMakeLists.txt
  2. 12
      src/Makefile.am
  3. 18
      src/meson.build
  4. 18
      src/t/test_mod_access.c
  5. 14
      src/t/test_mod_evhost.c
  6. 13
      src/t/test_mod_simple_vhost.c

18
src/CMakeLists.txt

@ -855,12 +855,6 @@ if(HAVE_PCRE_H)
add_target_properties(test_configfile COMPILE_FLAGS ${PCRE_CFLAGS})
target_link_libraries(test_keyvalue ${PCRE_LDFLAGS})
add_target_properties(test_keyvalue COMPILE_FLAGS ${PCRE_CFLAGS})
target_link_libraries(test_mod_access ${PCRE_LDFLAGS})
add_target_properties(test_mod_access COMPILE_FLAGS ${PCRE_CFLAGS})
target_link_libraries(test_mod_evhost ${PCRE_LDFLAGS})
add_target_properties(test_mod_evhost COMPILE_FLAGS ${PCRE_CFLAGS})
target_link_libraries(test_mod_simple_vhost ${PCRE_LDFLAGS})
add_target_properties(test_mod_simple_vhost COMPILE_FLAGS ${PCRE_CFLAGS})
endif()
if(WITH_PCRE AND (WITH_MEMCACHED OR WITH_GDBM))
@ -1066,12 +1060,12 @@ if(WITH_LIBUNWIND)
add_target_properties(test_configfile COMPILE_FLAGS ${PCRE_CFLAGS} ${LIBUNWIND_CFLAGS})
target_link_libraries(test_keyvalue ${PCRE_LDFLAGS} ${LIBUNWIND_LDFLAGS})
add_target_properties(test_keyvalue COMPILE_FLAGS ${PCRE_CFLAGS} ${LIBUNWIND_CFLAGS})
target_link_libraries(test_mod_access ${PCRE_LDFLAGS} ${LIBUNWIND_LDFLAGS})
add_target_properties(test_mod_access COMPILE_FLAGS ${PCRE_CFLAGS} ${LIBUNWIND_CFLAGS})
target_link_libraries(test_mod_evhost ${PCRE_LDFLAGS} ${LIBUNWIND_LDFLAGS})
add_target_properties(test_mod_evhost COMPILE_FLAGS ${PCRE_CFLAGS} ${LIBUNWIND_CFLAGS})
target_link_libraries(test_mod_simple_vhost ${PCRE_LDFLAGS} ${LIBUNWIND_LDFLAGS})
add_target_properties(test_mod_simple_vhost COMPILE_FLAGS ${PCRE_CFLAGS} ${LIBUNWIND_CFLAGS})
target_link_libraries(test_mod_access ${LIBUNWIND_LDFLAGS})
add_target_properties(test_mod_access COMPILE_FLAGS ${LIBUNWIND_CFLAGS})
target_link_libraries(test_mod_evhost ${LIBUNWIND_LDFLAGS})
add_target_properties(test_mod_evhost COMPILE_FLAGS ${LIBUNWIND_CFLAGS})
target_link_libraries(test_mod_simple_vhost ${LIBUNWIND_LDFLAGS})
add_target_properties(test_mod_simple_vhost COMPILE_FLAGS ${LIBUNWIND_CFLAGS})
target_link_libraries(test_request ${LIBUNWIND_LDFLAGS})
add_target_properties(test_request COMPILE_FLAGS ${LIBUNWIND_CFLAGS})
endif()

12
src/Makefile.am

@ -573,14 +573,14 @@ t_test_configfile_LDADD = $(PCRE_LIB) $(LIBUNWIND_LIBS)
t_test_keyvalue_SOURCES = t/test_keyvalue.c burl.c buffer.c base64.c array.c data_integer.c data_string.c log.c
t_test_keyvalue_LDADD = $(PCRE_LIB) $(LIBUNWIND_LIBS)
t_test_mod_access_SOURCES = t/test_mod_access.c configfile-glue.c buffer.c array.c data_integer.c data_string.c http_header.c http_kv.c log.c sock_addr.c
t_test_mod_access_LDADD = $(PCRE_LIB) $(LIBUNWIND_LIBS)
t_test_mod_access_SOURCES = t/test_mod_access.c buffer.c array.c data_integer.c data_string.c log.c
t_test_mod_access_LDADD = $(LIBUNWIND_LIBS)
t_test_mod_evhost_SOURCES = t/test_mod_evhost.c configfile-glue.c buffer.c array.c data_integer.c data_string.c http_header.c http_kv.c log.c sock_addr.c
t_test_mod_evhost_LDADD = $(PCRE_LIB) $(LIBUNWIND_LIBS)
t_test_mod_evhost_SOURCES = t/test_mod_evhost.c buffer.c array.c data_integer.c data_string.c log.c
t_test_mod_evhost_LDADD = $(LIBUNWIND_LIBS)
t_test_mod_simple_vhost_SOURCES = t/test_mod_simple_vhost.c configfile-glue.c buffer.c array.c data_integer.c data_string.c http_header.c http_kv.c log.c sock_addr.c
t_test_mod_simple_vhost_LDADD = $(PCRE_LIB) $(LIBUNWIND_LIBS)
t_test_mod_simple_vhost_SOURCES = t/test_mod_simple_vhost.c buffer.c array.c data_integer.c data_string.c log.c
t_test_mod_simple_vhost_LDADD = $(LIBUNWIND_LIBS)
t_test_request_SOURCES = t/test_request.c request.c buffer.c array.c data_integer.c data_string.c http_header.c http_kv.c log.c sock_addr.c
t_test_request_LDADD = $(LIBUNWIND_LIBS)

18
src/meson.build

@ -786,51 +786,39 @@ test('test_keyvalue', executable('test_keyvalue',
test('test_mod_access', executable('test_mod_access',
sources: [
't/test_mod_access.c',
'configfile-glue.c',
'buffer.c',
'array.c',
'data_integer.c',
'data_string.c',
'http_header.c',
'http_kv.c',
'log.c',
'sock_addr.c',
],
dependencies: common_flags + libpcre + libunwind,
dependencies: common_flags + libunwind,
build_by_default: false,
))
test('test_mod_evhost', executable('test_mod_evhost',
sources: [
't/test_mod_evhost.c',
'configfile-glue.c',
'buffer.c',
'array.c',
'data_integer.c',
'data_string.c',
'http_header.c',
'http_kv.c',
'log.c',
'sock_addr.c',
],
dependencies: common_flags + libpcre + libunwind,
dependencies: common_flags + libunwind,
build_by_default: false,
))
test('test_mod_simple_vhost', executable('test_mod_simple_vhost',
sources: [
't/test_mod_simple_vhost.c',
'configfile-glue.c',
'buffer.c',
'array.c',
'data_integer.c',
'data_string.c',
'http_header.c',
'http_kv.c',
'log.c',
'sock_addr.c',
],
dependencies: common_flags + libpcre + libunwind,
dependencies: common_flags + libunwind,
build_by_default: false,
))

18
src/t/test_mod_access.c

@ -53,3 +53,21 @@ int main (void) {
return 0;
}
/*
* stub functions
*/
int config_plugin_values_init(server *srv, void *p_d, const config_plugin_keys_t *cpk, const char *mname) {
UNUSED(srv);
UNUSED(p_d);
UNUSED(cpk);
UNUSED(mname);
return 0;
}
int config_check_cond(request_st *r, int context_ndx) {
UNUSED(r);
UNUSED(context_ndx);
return 0;
}

14
src/t/test_mod_evhost.c

@ -79,3 +79,17 @@ stat_cache_entry * stat_cache_get_entry(const buffer *name) {
UNUSED(name);
return NULL;
}
int config_plugin_values_init(server *srv, void *p_d, const config_plugin_keys_t *cpk, const char *mname) {
UNUSED(srv);
UNUSED(p_d);
UNUSED(cpk);
UNUSED(mname);
return 0;
}
int config_check_cond(request_st *r, int context_ndx) {
UNUSED(r);
UNUSED(context_ndx);
return 0;
}

13
src/t/test_mod_simple_vhost.c

@ -48,3 +48,16 @@ stat_cache_entry * stat_cache_get_entry(const buffer *name) {
return NULL;
}
int config_plugin_values_init(server *srv, void *p_d, const config_plugin_keys_t *cpk, const char *mname) {
UNUSED(srv);
UNUSED(p_d);
UNUSED(cpk);
UNUSED(mname);
return 0;
}
int config_check_cond(request_st *r, int context_ndx) {
UNUSED(r);
UNUSED(context_ndx);
return 0;
}
Loading…
Cancel
Save