about summary refs log tree commit diff
path: root/uname.c
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 /uname.c
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 'uname.c')
-rw-r--r--uname.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/uname.c b/uname.c
index b5ac849..a9e4ade 100644
--- a/uname.c
+++ b/uname.c
@@ -76,8 +76,8 @@ static void uname_collect(scrape_req *req, void *ctx_ptr) {
   scrape_write(req, "node_uname_info", ctx->labels, 1.0);
 }
 
-// exposed only for testing
-
+#ifdef NANO_EXPORTER_TEST
 void uname_test_override_data(void *ctx, struct utsname *name) {
   uname_set_labels((struct uname_context *) ctx, name);
 }
+#endif // NANO_EXPORTER_TEST