diff options
author | Heikki Kallasjoki <fis@zem.fi> | 2018-12-16 02:35:57 +0000 |
---|---|---|
committer | Heikki Kallasjoki <fis+github@zem.fi> | 2018-12-16 02:39:15 +0000 |
commit | 93375dbc4be128988eac7916852dd6e23127e6e0 (patch) | |
tree | 134e97218d5b326f0196857b34d2424c4d9f98e0 /filesystem.c | |
parent | 4c77c338c2e016ebf12570ed5a73ba118f06342e (diff) | |
download | nano-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.c | 4 |
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 |