about summary refs log tree commit diff
path: root/filesystem.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 /filesystem.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 'filesystem.c')
-rw-r--r--filesystem.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/filesystem.c b/filesystem.c
index aa16421..bda569a 100644
--- a/filesystem.c
+++ b/filesystem.c
@@ -159,8 +159,8 @@ static void filesystem_collect(scrape_req *req, void *ctx_ptr) {
   fclose(f);
 }
 
-// exposed only for testing
-
+#ifdef NANO_EXPORTER_TEST
 void filesystem_test_override_statvfs(void *ctx, int (*statvfs_func)(const char *path, struct statvfs *buf)) {
   ((struct filesystem_context *) ctx)->statvfs_func = statvfs_func;
 }
+#endif // NANO_EXPORTER_TEST