[feedgnuplot] 36/42: added --timefmt tests

Dima Kogan dkogan-guest at alioth.debian.org
Sun Oct 20 08:04:10 UTC 2013


This is an automated email from the git hooks/post-receive script.

dkogan-guest pushed a commit to tag v1.25
in repository feedgnuplot.

commit 54862ec2fd90a58d16d8b1d34ae8840b845b5b84
Author: Dima Kogan <dima at secretsauce.net>
Date:   Sat Oct 19 23:55:47 2013 -0700

    added --timefmt tests
---
 t/plots.t |  643 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 641 insertions(+), 2 deletions(-)

diff --git a/t/plots.t b/t/plots.t
index cd1b690..57ec853 100644
--- a/t/plots.t
+++ b/t/plots.t
@@ -15,7 +15,7 @@ BEGIN {
   }
 }
 
-use Test::More tests => 42;
+use Test::More tests => 52;
 use File::Temp 'tempfile';
 use IPC::Run 'run';
 use String::ShellQuote;
@@ -823,13 +823,157 @@ tryplot( testname => 'Monotonicity check',
 EOF
 
 
+tryplot( testname => 'basic --timefmt plot',
+         cmd      => q{seq 5 | awk '{print strftime("%d %b %Y %T",1382249107+$1,1),$1}'},
+         options  => ['--domain', '--timefmt', '%d %b %Y %H:%M:%S'],
+         refplot  => <<'EOF' );
+

+
+    5 ++--+---+--+---+---+---+--+--+A
+      +   +   +  +   +   +   +  +   +
+      |                             |
+      |                             |
+  4.5 ++                           ++
+      |                             |
+      |                             |
+      |                             |
+      |                             |
+    4 ++                     A     ++
+      |                             |
+      |                             |
+      |                             |
+  3.5 ++                           ++
+      |                             |
+      |                             |
+      |                             |
+    3 ++             A             ++
+      |                             |
+      |                             |
+      |                             |
+      |                             |
+  2.5 ++                           ++
+      |                             |
+      |                             |
+      |                             |
+    2 ++      A                    ++
+      |                             |
+      |                             |
+      |                             |
+      |                             |
+  1.5 ++                           ++
+      |                             |
+      |                             |
+      +   +   +  +   +   +   +  +   +
+    1 A+--+---+--+---+---+---+--+--++
+    05:085:085:09:095:105:105:11:115:12
+
+EOF
+
+tryplot( testname => '--timefmt plot with bounds',
+         cmd      => q{seq 5 | awk '{print strftime("%d %b %Y %T",1382249107+$1,1),$1}'},
+         options  => ['--domain', '--timefmt', '%d %b %Y %H:%M:%S',
+                      '--xmin', '20 Oct 2013 06:05:00',
+                      '--xmax', '20 Oct 2013 06:05:20'],
+         refplot  => <<'EOF' );
+

+
+    5 ++++-++-++-++-++-+A-++-++-++-++
+      +       +      +       +      +
+      |                             |
+      |                             |
+  4.5 ++                           ++
+      |                             |
+      |                             |
+      |                             |
+      |                             |
+    4 ++               A           ++
+      |                             |
+      |                             |
+      |                             |
+  3.5 ++                           ++
+      |                             |
+      |                             |
+      |                             |
+    3 ++             A             ++
+      |                             |
+      |                             |
+      |                             |
+      |                             |
+  2.5 ++                           ++
+      |                             |
+      |                             |
+      |                             |
+    2 ++            A              ++
+      |                             |
+      |                             |
+      |                             |
+      |                             |
+  1.5 ++                           ++
+      |                             |
+      |                             |
+      +       +      +       +      +
+    1 ++++-++-++-+A-++-++-++-++-++-++
+    05:00   05:05  05:10   05:15  05:20
+
+EOF
+
+tryplot( testname => '--timefmt plot with --monotonic',
+         cmd      => q{seq 10 | awk '{x=(NR-1)%5; print strftime("%d %b %Y %T",1382249107+x,1),$1}'},
+         options  => ['--domain', '--timefmt', '%d %b %Y %H:%M:%S',
+                      '--monotonic'],
+         refplot  => <<'EOF' );
+

+
+   10 ++--+---+--+---+---+---+--+--+A
+      +   +   +  +   +   +   +  +   +
+      |                             |
+      |                             |
+  9.5 ++                           ++
+      |                             |
+      |                             |
+      |                             |
+      |                             |
+    9 ++                     A     ++
+      |                             |
+      |                             |
+      |                             |
+  8.5 ++                           ++
+      |                             |
+      |                             |
+      |                             |
+    8 ++             A             ++
+      |                             |
+      |                             |
+      |                             |
+      |                             |
+  7.5 ++                           ++
+      |                             |
+      |                             |
+      |                             |
+    7 ++      A                    ++
+      |                             |
+      |                             |
+      |                             |
+      |                             |
+  6.5 ++                           ++
+      |                             |
+      |                             |
+      +   +   +  +   +   +   +  +   +
+    6 A+--+---+--+---+---+---+--+--++
+    05:075:075:08:085:095:095:10:105:11
+
+EOF
+
+
+
+
 note( "Starting to run streaming tests. These will take several seconds each" );
 
 # replotting every 1.0 seconds. Data comes in every 1.1 seconds. Two data
 # points, and then "exit", so I should have two frames worth of data plotted. I
 # pre-send a 0 so that the gnuplot autoscaling is always well-defined
 tryplot( testname => 'basic streaming test',
-         cmd      => q{seq 500 | awk 'BEGIN{ print 0; } {print (NR==3)? "exit" : $0; fflush(); system("sleep 1.1");}'},
+         cmd      => q{seq 500 | awk 'BEGIN{ print 0; } {print (NR==3)? "exit" : $0; fflush(); system("sleep 1.2");}'},
          options  => [qw(--lines --points --stream)],
          refplot  => <<'EOF' );
 

@@ -1493,6 +1637,501 @@ tryplot( testname => 'streaming with --monotonic',
 
 EOF
 
+tryplot( testname => '--timefmt streaming plot with --xlen',
+         cmd      => q{seq 5 | awk 'BEGIN{ print strftime("%d %b %Y %T",1382249107-1,1),-4;} {if(NR==3) {print "exit";} else{ print strftime("%d %b %Y %T",1382249107+$1,1),$1;} fflush(); system("sleep 0.6")}'},
+         options  => ['--points', '--lines',
+                      '--domain', '--timefmt', '%d %b %Y %H:%M:%S',
+                      qw(--stream 0.4 --xlen 3)],
+         refplot  => <<'EOF' );
+

+
+  1 ++---+-----+----+----+-----+---+A
+    +    +     +    +    +     +   *+
+    |                              *|
+    |                             * |
+    |                             * |
+    |                            *  |
+    |                           *   |
+  0 ++                          *  ++
+    |                          *    |
+    |                          *    |
+    |                         *     |
+    |                        *      |
+    |                        *      |
+    |                       *       |
+ -1 ++                      *      ++
+    |                      *        |
+    |                     *         |
+    |                     *         |
+    |                    *          |
+    |                    *          |
+    |                   *           |
+ -2 ++                 *           ++
+    |                  *            |
+    |                 *             |
+    |                 *             |
+    |                *              |
+    |               *               |
+    |               *               |
+ -3 ++             *               ++
+    |              *                |
+    |             *                 |
+    |            *                  |
+    |            *                  |
+    |           *                   |
+    +    +     +*   +    +     +    +
+ -4 ++---+-----A----+----+-----+---++
+  05:0505:05 05:0605:0605:07 05:0705:08
+
+

+
+  2 ++---+-----+----+----+-----+---+A
+    +    +     +    +    +     +  **+
+    |                           **  |
+    |                         **    |
+    |                       **      |
+    |                     **        |
+  1 ++                   A         ++
+    |                   *           |
+    |                   *           |
+    |                  *            |
+    |                 *             |
+    |                *              |
+  0 ++               *             ++
+    |               *               |
+    |              *                |
+    |             *                 |
+    |             *                 |
+ -1 ++           *                 ++
+    |           *                   |
+    |           *                   |
+    |          *                    |
+    |         *                     |
+    |        *                      |
+ -2 ++       *                     ++
+    |       *                       |
+    |      *                        |
+    |      *                        |
+    |     *                         |
+    |    *                          |
+ -3 ++  *                          ++
+    |   *                           |
+    |  *                            |
+    | *                             |
+    |*                              |
+    +*   +     +    +    +     +    +
+ -4 A+---+-----+----+----+-----+---++
+  05:0605:06 05:0705:0705:08 05:0805:09
+
+EOF
+
+tryplot( testname => '--timefmt streaming plot with --monotonic',
+         cmd      => q{seq 10 | awk '{x=(NR-1)%5; if(x==0) {print strftime("%d %b %Y %T",1382249107-1,-4),-4;} print strftime("%d %b %Y %T",1382249107+x,1),NR; fflush(); system("sleep 0.6")}'},
+         options  => ['--points', '--lines',
+                      '--domain', '--timefmt', '%d %b %Y %H:%M:%S',
+                      qw(--stream 0.4 --monotonic)],
+         refplot  => <<'EOF' );
+

+
+  1 ++----+------+-----+------+----+A
+    +     +      +     +      +    *+
+    |                             * |
+    |                            *  |
+    |                           *   |
+    |                          *    |
+    |                          *    |
+  0 ++                        *    ++
+    |                        *      |
+    |                       *       |
+    |                      *        |
+    |                     *         |
+    |                    *          |
+    |                   *           |
+ -1 ++                 *           ++
+    |                 *             |
+    |                *              |
+    |               *               |
+    |               *               |
+    |              *                |
+    |             *                 |
+ -2 ++           *                 ++
+    |           *                   |
+    |          *                    |
+    |         *                     |
+    |        *                      |
+    |       *                       |
+    |      *                        |
+ -3 ++    *                        ++
+    |    *                          |
+    |    *                          |
+    |   *                           |
+    |  *                            |
+    | *                             |
+    +*    +      +     +      +     +
+ -4 A+----+------+-----+------+----++
+  05:06 05:06  05:06 05:06  05:06 05:07
+
+

+
+  2 ++------+-------+-------+------*A
+    +       +       +       +   *** +
+    |                         **    |
+    |                      ***      |
+    |                   ***         |
+    |                 **            |
+  1 ++              A*             ++
+    |              *                |
+    |              *                |
+    |             *                 |
+    |             *                 |
+    |            *                  |
+  0 ++           *                 ++
+    |           *                   |
+    |           *                   |
+    |          *                    |
+    |         *                     |
+ -1 ++        *                    ++
+    |        *                      |
+    |        *                      |
+    |       *                       |
+    |       *                       |
+    |      *                        |
+ -2 ++     *                       ++
+    |     *                         |
+    |     *                         |
+    |    *                          |
+    |   *                           |
+    |   *                           |
+ -3 ++ *                           ++
+    |  *                            |
+    | *                             |
+    | *                             |
+    |*                              |
+    +*      +       +       +       +
+ -4 A+------+-------+-------+------++
+  05:06   05:06   05:07   05:07   05:08
+
+

+
+  3 ++---+-----+----+----+-----+---*A
+    +    +     +    +    +     + ** +
+    |                          **   |
+    |                        **     |
+    |                      **       |
+  2 ++                  *A*        ++
+    |                 **            |
+    |               **              |
+    |             **                |
+    |           **                  |
+  1 ++         A                   ++
+    |          *                    |
+    |         *                     |
+    |         *                     |
+    |        *                      |
+  0 ++       *                     ++
+    |       *                       |
+    |       *                       |
+    |      *                        |
+    |      *                        |
+ -1 ++     *                       ++
+    |     *                         |
+    |     *                         |
+    |    *                          |
+    |    *                          |
+ -2 ++  *                          ++
+    |   *                           |
+    |   *                           |
+    |  *                            |
+    |  *                            |
+ -3 ++*                            ++
+    | *                             |
+    |*                              |
+    |*                              |
+    *    +     +    +    +     +    +
+ -4 A+---+-----+----+----+-----+---++
+  05:0605:06 05:0705:0705:08 05:0805:09
+
+

+
+  4 ++--+---+---+---+---+---+---+--*A
+    +   +   +   +   +   +   +   +** +
+    |                          **   |
+    |                        **     |
+  3 ++                      A      ++
+    |                     **        |
+    |                   **          |
+    |                  *            |
+    |                **             |
+  2 ++             *A              ++
+    |            **                 |
+    |          **                   |
+    |        **                     |
+  1 ++      A                      ++
+    |       *                       |
+    |      *                        |
+    |      *                        |
+  0 ++     *                       ++
+    |     *                         |
+    |     *                         |
+    |    *                          |
+    |    *                          |
+ -1 ++   *                         ++
+    |   *                           |
+    |   *                           |
+    |   *                           |
+ -2 ++ *                           ++
+    |  *                            |
+    |  *                            |
+    | *                             |
+    | *                             |
+ -3 +*                             ++
+    |*                              |
+    |*                              |
+    *   +   +   +   +   +   +   +   +
+ -4 A+--+---+---+---+---+---+---+--++
+  05:065:065:075:075:085:085:095:095:10
+
+

+
+  5 ++----+------+-----+------+----+A
+    +     +      +     +      +   **+
+    |                            *  |
+    |                          **   |
+  4 ++                        A    ++
+    |                       **      |
+    |                     **        |
+    |                   **          |
+  3 ++                 A           ++
+    |                **             |
+    |               *               |
+    |             **                |
+  2 ++           A                 ++
+    |          **                   |
+    |        **                     |
+    |      **                       |
+  1 ++    A                        ++
+    |     *                         |
+    |    *                          |
+  0 ++   *                         ++
+    |    *                          |
+    |   *                           |
+    |   *                           |
+ -1 ++  *                          ++
+    |  *                            |
+    |  *                            |
+    |  *                            |
+ -2 ++ *                           ++
+    | *                             |
+    | *                             |
+    | *                             |
+ -3 +*                             ++
+    |*                              |
+    |*                              |
+    *     +      +     +      +     +
+ -4 A+----+------+-----+------+----++
+  05:06 05:07  05:08 05:09  05:10 05:11
+
+

+
+  6 ++----+------+-----+------+----+A
+    +     +      +     +      +    *+
+    |                             * |
+    |                            *  |
+    |                           *   |
+    |                          *    |
+    |                          *    |
+  4 ++                        *    ++
+    |                        *      |
+    |                       *       |
+    |                      *        |
+    |                     *         |
+    |                    *          |
+    |                   *           |
+  2 ++                 *           ++
+    |                 *             |
+    |                *              |
+    |               *               |
+    |               *               |
+    |              *                |
+    |             *                 |
+  0 ++           *                 ++
+    |           *                   |
+    |          *                    |
+    |         *                     |
+    |        *                      |
+    |       *                       |
+    |      *                        |
+ -2 ++    *                        ++
+    |    *                          |
+    |    *                          |
+    |   *                           |
+    |  *                            |
+    | *                             |
+    +*    +      +     +      +     +
+ -4 A+----+------+-----+------+----++
+  05:06 05:06  05:06 05:06  05:06 05:07
+
+

+
+  8 ++------+-------+-------+------++
+    +       +       +       +       +
+    |                               |
+    |                             **A
+    |                       ******  |
+    |                  *****        |
+  6 ++              A**            ++
+    |              *                |
+    |              *                |
+    |             *                 |
+    |             *                 |
+    |            *                  |
+  4 ++           *                 ++
+    |           *                   |
+    |           *                   |
+    |          *                    |
+    |         *                     |
+  2 ++        *                    ++
+    |        *                      |
+    |        *                      |
+    |       *                       |
+    |       *                       |
+    |      *                        |
+  0 ++     *                       ++
+    |     *                         |
+    |     *                         |
+    |    *                          |
+    |   *                           |
+    |   *                           |
+ -2 ++ *                           ++
+    |  *                            |
+    | *                             |
+    | *                             |
+    |*                              |
+    +*      +       +       +       +
+ -4 A+------+-------+-------+------++
+  05:06   05:06   05:07   05:07   05:08
+
+

+
+  8 ++---+-----+----+----+-----+---*A
+    +    +     +    +    +     **** +
+    |                      ****     |
+    |                   *A*         |
+    |               ****            |
+    |            ***                |
+  6 ++         A*                  ++
+    |          *                    |
+    |         *                     |
+    |         *                     |
+    |        *                      |
+    |        *                      |
+  4 ++       *                     ++
+    |       *                       |
+    |       *                       |
+    |       *                       |
+    |      *                        |
+  2 ++     *                       ++
+    |     *                         |
+    |     *                         |
+    |     *                         |
+    |    *                          |
+    |    *                          |
+  0 ++   *                         ++
+    |   *                           |
+    |   *                           |
+    |  *                            |
+    |  *                            |
+    |  *                            |
+ -2 ++*                            ++
+    | *                             |
+    | *                             |
+    |*                              |
+    |*                              |
+    *    +     +    +    +     +    +
+ -4 A+---+-----+----+----+-----+---++
+  05:0605:06 05:0705:0705:08 05:0805:09
+
+

+
+  10 ++--+---+---+---+--+---+---+--++
+     +   +   +   +   +  +   +   +   +
+     |                             *A
+     |                          *** |
+     |                        **    |
+   8 ++                    *A*     ++
+     |                 ****         |
+     |              *A*             |
+     |           ***                |
+     |         **                   |
+   6 ++      A*                    ++
+     |       *                      |
+     |      *                       |
+     |      *                       |
+     |      *                       |
+   4 ++    *                       ++
+     |     *                        |
+     |     *                        |
+     |    *                         |
+     |    *                         |
+   2 ++   *                        ++
+     |   *                          |
+     |   *                          |
+     |   *                          |
+     |   *                          |
+   0 ++ *                          ++
+     |  *                           |
+     |  *                           |
+     | *                            |
+     | *                            |
+  -2 ++*                           ++
+     |*                             |
+     |*                             |
+     |*                             |
+     *   +   +   +   +  +   +   +   +
+  -4 A+--+---+---+---+--+---+---+--++
+   05:065:065:075:075:08:085:095:095:10
+
+

+
+  10 ++----+-----+------+-----+----*A
+     +     +     +      +     + *** +
+     |                       *A*    |
+     |                     **       |
+     |                   **         |
+   8 ++                *A          ++
+     |             ****             |
+     |          *A*                 |
+     |        **                    |
+     |      **                      |
+   6 ++    A                       ++
+     |     *                        |
+     |     *                        |
+     |    *                         |
+     |    *                         |
+   4 ++   *                        ++
+     |    *                         |
+     |   *                          |
+     |   *                          |
+     |   *                          |
+   2 ++  *                         ++
+     |  *                           |
+     |  *                           |
+     |  *                           |
+     |  *                           |
+   0 ++*                           ++
+     | *                            |
+     | *                            |
+     | *                            |
+     |*                             |
+  -2 +*                            ++
+     |*                             |
+     |*                             |
+     *                              |
+     *     +     +      +     +     +
+  -4 A+----+-----+------+-----+----++
+   05:06 05:07 05:08  05:09 05:10 05:11
+
+EOF
 
 
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/feedgnuplot.git



More information about the debian-science-commits mailing list