about summary refs log tree commit diff
path: root/test
diff options
context:
space:
mode:
authorHeikki Kallasjoki <fis@zem.fi>2018-12-16 02:35:57 +0000
committerHeikki Kallasjoki <fis+github@zem.fi>2018-12-16 02:39:15 +0000
commit93375dbc4be128988eac7916852dd6e23127e6e0 (patch)
tree134e97218d5b326f0196857b34d2424c4d9f98e0 /test
parent4c77c338c2e016ebf12570ed5a73ba118f06342e (diff)
downloadnano-exporter-93375dbc4be128988eac7916852dd6e23127e6e0.tar.gz
nano-exporter-93375dbc4be128988eac7916852dd6e23127e6e0.tar.xz
nano-exporter-93375dbc4be128988eac7916852dd6e23127e6e0.zip
Predefine NANO_EXPORTER_TEST when compiling test code.
Also update the existing test-only "override X" functions in the cpu,
filesystem and uname collectors to only be defined when
NANO_EXPORTER_TEST is.
Diffstat (limited to 'test')
-rw-r--r--test/Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/Makefile b/test/Makefile
index c2bd981..7e9ab3e 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -31,7 +31,7 @@ $(COLLECTOR_TEST_OBJS): %.o: %.c harness.h mock_scrape.h
 	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
 
 $(COLLECTOR_TEST_IMPLS): %_test.impl.o: ../%.c stub.h
-	$(CC) $(CFLAGS) $(CPPFLAGS) -include stub.h -c -o $@ $<
+	$(CC) $(CFLAGS) $(CPPFLAGS) -include stub.h -DNANO_EXPORTER_TEST=1 -c -o $@ $<
 
 $(COLLECTOR_TEST_PROGS): %: %.o %.impl.o harness.o mock_scrape.o util.o
 	$(CC) -o $@ $^ $(LDFLAGS) $(LDLIBS)