about summary refs log tree commit diff
path: root/cpu.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 /cpu.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 'cpu.c')
-rw-r--r--cpu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cpu.c b/cpu.c
index d8bed66..f8bc030 100644
--- a/cpu.c
+++ b/cpu.c
@@ -146,8 +146,8 @@ void cpu_collect(scrape_req *req, void *ctx_ptr) {
   }
 }
 
-// exposed only for testing
-
+#ifdef NANO_EXPORTER_TEST
 void cpu_test_override_tick(void *ctx, long tick) {
   ((struct cpu_context *) ctx)->clock_tick = tick;
 }
+#endif // NANO_EXPORTER_TEST