diff options
author | Bert Vermeulen <bert@biot.com> | 2013-12-22 23:07:23 +0100 |
---|---|---|
committer | Bert Vermeulen <bert@biot.com> | 2013-12-22 23:07:23 +0100 |
commit | 919ace16e7100fccd51fda16c6d40fc3ad9915e2 (patch) | |
tree | 01c28dac258ff4e3a17bbe1fbf68811a83879824 /tests | |
parent | 83411834eec29f08443908b7d2a427e7fb130573 (diff) | |
download | libsigrokdecode-919ace16e7100fccd51fda16c6d40fc3ad9915e2.tar.gz libsigrokdecode-919ace16e7100fccd51fda16c6d40fc3ad9915e2.zip |
runtc: Fix conditional build on non-Linux systems.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 2 | ||||
-rw-r--r-- | tests/runtc.c | 33 |
2 files changed, 1 insertions, 34 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index a3df6b3..bd0858f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -34,7 +34,7 @@ check_main_CPPFLAGS = $(CPPFLAGS_PYTHON) \ -DDECODERS_DIR='"$(abs_top_builddir)/decoders"' endif -if HAVE_LIBSIGROK +if BUILD_RUNTC noinst_PROGRAMS = runtc runtc_SOURCES = runtc.c runtc_CPPFLAGS = $(CPPFLAGS_PYTHON) $(LIBSIGROK_CFLAGS) \ diff --git a/tests/runtc.c b/tests/runtc.c index 33cc8f2..9ba51f4 100644 --- a/tests/runtc.c +++ b/tests/runtc.c @@ -307,39 +307,6 @@ static void sr_cb(const struct sr_dev_inst *sdi, } -int get_stats(int stats[2]) -{ - FILE *f; - size_t len; - int tmp; - char *buf; - - stats[0] = stats[1] = -1; - if (!(f = fopen("/proc/self/status", "r"))) - return FALSE; - len = 128; - buf = malloc(len); - while (getline(&buf, &len, f) != -1) { - if (strcasestr(buf, "vmpeak:")) { - stats[0] = strtoul(buf + 10, NULL, 10); - } else if (strcasestr(buf, "vmsize:")) { - tmp = strtoul(buf + 10, NULL, 10); - if (tmp > stats[0]) - stats[0] = tmp; - } else if (strcasestr(buf, "vmhwm:")) { - stats[1] = strtoul(buf + 6, NULL, 10); - } else if (strcasestr(buf, "vmrss:")) { - tmp = strtoul(buf + 10, NULL, 10); - if (tmp > stats[0]) - stats[0] = tmp; - } - } - free(buf); - fclose(f); - - return TRUE; -} - static int run_testcase(char *infile, GSList *pdlist, struct output *op) { struct srd_session *sess; |