From: Tobias Oetiker Date: Thu, 3 Jan 2019 11:01:20 +0000 (+0100) Subject: add graph test X-Git-Tag: v1.7.1~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79af09e9408bb5934baa7c899ca22ee748e10cd8;p=thirdparty%2Frrdtool-1.x.git add graph test --- diff --git a/tests/Makefile.am b/tests/Makefile.am index 28909cec..d2230ca6 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,5 +1,5 @@ TESTS = modify1 modify2 modify3 modify4 modify5 \ - tune1 tune2 rpn1 rpn2 \ + tune1 tune2 graph1 rpn1 rpn2 \ rrdcreate \ dump-restore \ create-with-source-1 create-with-source-2 create-with-source-3 \ @@ -20,7 +20,7 @@ EXTRA_DIST = Makefile.am \ xport1.json.output xport1.xml.output # NB: AM_TESTS_ENVIRONMENT not available until automake 1.12 -TESTS_ENVIRONMENT = \ +AM_TESTS_ENVIRONMENT = \ BASEDIR=${abs_srcdir} ; export BASEDIR ; \ BUILDDIR=${abs_builddir} ; export BUILDDIR ; \ TOP_BUILDDIR=${abs_top_builddir} ; export TOP_BUILDDIR ; diff --git a/tests/Makefile.in b/tests/Makefile.in index 9ffa189b..21316f46 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -537,7 +537,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ TESTS = modify1 modify2 modify3 modify4 modify5 \ - tune1 tune2 rpn1 rpn2 \ + tune1 tune2 graph1 rpn1 rpn2 \ rrdcreate \ dump-restore \ create-with-source-1 create-with-source-2 create-with-source-3 \ @@ -559,7 +559,7 @@ EXTRA_DIST = Makefile.am \ # NB: AM_TESTS_ENVIRONMENT not available until automake 1.12 -TESTS_ENVIRONMENT = \ +AM_TESTS_ENVIRONMENT = \ BASEDIR=${abs_srcdir} ; export BASEDIR ; \ BUILDDIR=${abs_builddir} ; export BUILDDIR ; \ TOP_BUILDDIR=${abs_top_builddir} ; export TOP_BUILDDIR ; @@ -805,6 +805,13 @@ tune2.log: tune2 --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +graph1.log: graph1 + @p='graph1'; \ + b='graph1'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) rpn1.log: rpn1 @p='rpn1'; \ b='rpn1'; \ diff --git a/tests/graph1 b/tests/graph1 new file mode 100755 index 00000000..e0035d5e --- /dev/null +++ b/tests/graph1 @@ -0,0 +1,22 @@ +#!/bin/bash + +. $(dirname $0)/functions + +RRD=graph1.rrd + +$RRDTOOL create $RRD --start 920804400 DS:speed:COUNTER:600:U:U RRA:AVERAGE:0.5:1:24 RRA:AVERAGE:0.5:6:10 +report "create" +$RRDTOOL update $RRD 920804700:12345 920805000:12357 920805300:12363 +$RRDTOOL update $RRD 920805600:12363 920805900:12363 920806200:12373 +$RRDTOOL update $RRD 920806500:12383 920806800:12393 920807100:12399 +$RRDTOOL update $RRD 920807400:12405 920807700:12411 920808000:12415 +$RRDTOOL update $RRD 920808300:12420 920808600:12422 920808900:12423 +report "update" +# blank out any absolute coordinates, as they might differ +$BLANK < $BASEDIR/graph1.output > $BASEDIR/graph1.output.out +$RRDTOOL graphv $BASEDIR/graph1.out \ + --start 920804400 --end 920808000 \ + DEF:my-speed=$RRD:speed:AVERAGE \ + VDEF:o=my-speed,MAXIMUM \ + PRINT:o:'%lf' | $BLANK | $DIFF9 - $BASEDIR/graph1.output.out +report "graphv" diff --git a/tests/graph1.output b/tests/graph1.output new file mode 100644 index 00000000..ce3b606d --- /dev/null +++ b/tests/graph1.output @@ -0,0 +1 @@ +print[0] = "0.040000"