Skip to content

Commit

Permalink
Fix Mtev Includes In Test Suite (#927)
Browse files Browse the repository at this point in the history
Make the test suite use quotation marks for mtev includes instead of <>. Make sure the Makefile looks for local headers first when running the test suite.
  • Loading branch information
pamaddox committed Feb 29, 2024
1 parent a206733 commit 9d1efee
Show file tree
Hide file tree
Showing 19 changed files with 88 additions and 85 deletions.
2 changes: 1 addition & 1 deletion test/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ifeq ($(V),)
endif

CC=@CC@
CPPFLAGS=@CPPFLAGS@ -DHIDE_EVENTER_ABI -I../src/utils -I../src -I../src/json-lib
CPPFLAGS=-DHIDE_EVENTER_ABI -I../src/utils -I../src -I../src/json-lib @CPPFLAGS@
CFLAGS=@CFLAGS@ @CFLAGSEXTRAS@ -Wno-error=unused-parameter
LDFLAGS=@LDFLAGS@
AR=@AR@
Expand Down
26 changes: 13 additions & 13 deletions test/async-pingpong/test.c
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#include <mtev_defines.h>
#include <mtev_conf.h>
#include <mtev_console.h>
#include <mtev_dso.h>
#include <mtev_listener.h>
#include <mtev_main.h>
#include <mtev_memory.h>
#include <mtev_rest.h>
#include <mtev_capabilities_listener.h>
#include <mtev_events_rest.h>
#include <mtev_stats.h>
#include <mtev_perftimer.h>
#include "mtev_defines.h"
#include "mtev_conf.h"
#include "mtev_console.h"
#include "mtev_dso.h"
#include "mtev_listener.h"
#include "mtev_main.h"
#include "mtev_memory.h"
#include "mtev_rest.h"
#include "mtev_capabilities_listener.h"
#include "mtev_events_rest.h"
#include "mtev_stats.h"
#include "mtev_perftimer.h"
#include <circllhist.h>
#include <eventer/eventer.h>
#include "eventer/eventer.h"
#include <inttypes.h>

#include <stdio.h>
Expand Down
2 changes: 1 addition & 1 deletion test/dyn_buffer_test.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <mtev_dyn_buffer.h>
#include "mtev_dyn_buffer.h"

int chkmem(mtev_dyn_buffer_t *buff, size_t len, char exp) {
const char *cp;
Expand Down
22 changes: 11 additions & 11 deletions test/flowreg/test.c
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#include <mtev_capabilities_listener.h>
#include <mtev_conf.h>
#include <mtev_console.h>
#include <mtev_defines.h>
#include <mtev_dso.h>
#include <mtev_flow_regulator.h>
#include <mtev_listener.h>
#include <mtev_main.h>
#include <mtev_memory.h>
#include <mtev_stats.h>
#include <eventer/eventer.h>
#include "mtev_capabilities_listener.h"
#include "mtev_conf.h"
#include "mtev_console.h"
#include "mtev_defines.h"
#include "mtev_dso.h"
#include "mtev_flow_regulator.h"
#include "mtev_listener.h"
#include "mtev_main.h"
#include "mtev_memory.h"
#include "mtev_stats.h"
#include "eventer/eventer.h"
#include <inttypes.h>

#include <getopt.h>
Expand Down
8 changes: 4 additions & 4 deletions test/frrh_test.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <mtev_defines.h>
#include <mtev_memory.h>
#include <mtev_frrh.h>
#include <mtev_perftimer.h>
#include "mtev_defines.h"
#include "mtev_memory.h"
#include "mtev_frrh.h"
#include "mtev_perftimer.h"
#include <openssl/sha.h>
#include <openssl/evp.h>

Expand Down
4 changes: 2 additions & 2 deletions test/geturllz4f.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <stdio.h>
#include <mtev_defines.h>
#include <mtev_compress.h>
#include "mtev_defines.h"
#include "mtev_compress.h"
#include <curl/curl.h>

static size_t print_data(void *buff, size_t s, size_t n, void *vd) {
Expand Down
2 changes: 1 addition & 1 deletion test/hash_test.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <mtev_hash.h>
#include "mtev_hash.h"
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
Expand Down
4 changes: 2 additions & 2 deletions test/hll_test.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <mtev_hyperloglog.h>
#include <mtev_time.h>
#include "mtev_hyperloglog.h"
#include "mtev_time.h"
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
Expand Down
2 changes: 1 addition & 1 deletion test/huge_hash_test.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <mtev_huge_hash.h>
#include "mtev_huge_hash.h"
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
Expand Down
4 changes: 2 additions & 2 deletions test/lfu_test.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <mtev_lfu.h>
#include <mtev_time.h>
#include "mtev_lfu.h"
#include "mtev_time.h"
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
Expand Down
4 changes: 2 additions & 2 deletions test/lru_test.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <mtev_lru.h>
#include <mtev_time.h>
#include "mtev_lru.h"
#include "mtev_time.h"
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
Expand Down
2 changes: 1 addition & 1 deletion test/maybe_alloc_test.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <mtev_maybe_alloc.h>
#include "mtev_maybe_alloc.h"

int chkmem(const char *ptr, size_t len, char exp) {
const char *cp;
Expand Down
24 changes: 12 additions & 12 deletions test/pool-shift-async/test.c
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#include <mtev_defines.h>
#include <mtev_conf.h>
#include <mtev_console.h>
#include <mtev_dso.h>
#include <mtev_listener.h>
#include <mtev_main.h>
#include <mtev_memory.h>
#include <mtev_rest.h>
#include <mtev_capabilities_listener.h>
#include <mtev_events_rest.h>
#include <mtev_stats.h>
#include <eventer/eventer.h>
#include "mtev_defines.h"
#include "mtev_conf.h"
#include "mtev_console.h"
#include "mtev_dso.h"
#include "mtev_listener.h"
#include "mtev_main.h"
#include "mtev_memory.h"
#include "mtev_rest.h"
#include "mtev_capabilities_listener.h"
#include "mtev_events_rest.h"
#include "mtev_stats.h"
#include "eventer/eventer.h"
#include <inttypes.h>

#include <stdio.h>
Expand Down
4 changes: 2 additions & 2 deletions test/sort_test.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <mtev_sort.h>
#include <mtev_time.h>
#include "mtev_sort.h"
#include "mtev_time.h"
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
Expand Down
4 changes: 2 additions & 2 deletions test/speculatelog_test.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <mtev_defines.h>
#include <mtev_log.h>
#include "mtev_defines.h"
#include "mtev_log.h"
#include <stdio.h>

int main(int argc, char *argv[])
Expand Down
22 changes: 11 additions & 11 deletions test/subqueues/test.c
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#include <mtev_capabilities_listener.h>
#include <mtev_conf.h>
#include <mtev_console.h>
#include <mtev_defines.h>
#include <mtev_dso.h>
#include <mtev_listener.h>
#include <mtev_main.h>
#include <mtev_memory.h>
#include <mtev_stats.h>
#include <mtev_perftimer.h>
#include <eventer/eventer.h>
#include "mtev_capabilities_listener.h"
#include "mtev_conf.h"
#include "mtev_console.h"
#include "mtev_defines.h"
#include "mtev_dso.h"
#include "mtev_listener.h"
#include "mtev_main.h"
#include "mtev_memory.h"
#include "mtev_stats.h"
#include "mtev_perftimer.h"
#include "eventer/eventer.h"
#include <inttypes.h>
#include <ck_pr.h>

Expand Down
29 changes: 16 additions & 13 deletions test/test_http_server.c
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#include <mtev_defines.h>
#include <mtev_conf.h>
#include <mtev_console.h>
#include <mtev_dso.h>
#include <mtev_listener.h>
#include <mtev_main.h>
#include <mtev_memory.h>
#include <mtev_http.h>
#include <mtev_rest.h>
#include <mtev_cluster.h>
#include <mtev_capabilities_listener.h>
#include <mtev_events_rest.h>
#include <eventer/eventer.h>
#include "mtev_defines.h"
#include "mtev_conf.h"
#include "mtev_console.h"
#include "mtev_dso.h"
#include "mtev_listener.h"
#include "mtev_main.h"
#include "mtev_memory.h"
#include "mtev_http.h"
#include "mtev_rest.h"
#include "mtev_cluster.h"
#include "mtev_capabilities_listener.h"
#include "mtev_events_rest.h"
#include "eventer/eventer.h"
#include "mtev_stacktrace.h"

#include <errno.h>
Expand Down Expand Up @@ -128,6 +128,9 @@ static int my_post_handler(mtev_http_rest_closure_t *restc, int npats, char **pa
return EVENTER_READ | EVENTER_WRITE | EVENTER_EXCEPTION;
}
static int my_safe_handler(mtev_http_rest_closure_t *restc, int npats, char **pats) {
(void)npats;
(void)pats;

mtev_http_session_ctx *ctx = restc->http_ctx;
mtev_http_response_standard(ctx, 200, "OK", "text/plain");
mtev_http_response_append_str(ctx, "contents\n");
Expand Down
4 changes: 2 additions & 2 deletions test/time_test.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <mtev_time.h>
#include <mtev_thread.h>
#include "mtev_time.h"
#include "mtev_thread.h"
#include <pthread.h>
#include <stdio.h>
#include <stdint.h>
Expand Down
4 changes: 2 additions & 2 deletions test/uuid_test.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <uuid/uuid.h>
#include <mtev_uuid.h>
#include <mtev_time.h>
#include "mtev_uuid.h"
#include "mtev_time.h"
#include <pthread.h>
#include <stdio.h>
#include <stdint.h>
Expand Down

0 comments on commit 9d1efee

Please sign in to comment.