[feedgnuplot] 32/42: added streaming tests

Dima Kogan dkogan-guest at alioth.debian.org
Sun Oct 20 08:04:09 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 f83d8db27ac9e7adc89c47beaf475233abc7e58e
Author: Dima Kogan <dima at secretsauce.net>
Date:   Sat Oct 19 22:34:03 2013 -0700

    added streaming tests
---
 t/plots.t |  673 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 672 insertions(+), 1 deletion(-)

diff --git a/t/plots.t b/t/plots.t
index 63c8826..cd1b690 100644
--- a/t/plots.t
+++ b/t/plots.t
@@ -15,7 +15,7 @@ BEGIN {
   }
 }
 
-use Test::More tests => 32;
+use Test::More tests => 42;
 use File::Temp 'tempfile';
 use IPC::Run 'run';
 use String::ShellQuote;
@@ -823,6 +823,677 @@ tryplot( testname => 'Monotonicity check',
 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");}'},
+         options  => [qw(--lines --points --stream)],
+         refplot  => <<'EOF' );
+

+
+    1 ++----+-----+-----+-----+----+A
+      +     +     +     +     +    *+
+      |                           * |
+      |                          *  |
+      |                          *  |
+      |                         *   |
+      |                        *    |
+  0.8 ++                      *    ++
+      |                      *      |
+      |                     *       |
+      |                    *        |
+      |                    *        |
+      |                   *         |
+      |                  *          |
+  0.6 ++                *          ++
+      |                *            |
+      |               *             |
+      |              *              |
+      |              *              |
+      |             *               |
+      |            *                |
+  0.4 ++          *                ++
+      |          *                  |
+      |         *                   |
+      |        *                    |
+      |        *                    |
+      |       *                     |
+      |      *                      |
+  0.2 ++    *                      ++
+      |    *                        |
+      |   *                         |
+      |  *                          |
+      |  *                          |
+      | *                           |
+      +*    +     +     +     +     +
+    0 A+----+-----+-----+-----+----++
+      1    1.2   1.4   1.6   1.8    2
+
+

+
+    2 ++------+------+-------+-----+A
+      +       +      +       +     *+
+      |                           * |
+      |                          *  |
+      |                         *   |
+      |                         *   |
+      |                        *    |
+      |                       *     |
+      |                      *      |
+  1.5 ++                    *      ++
+      |                    *        |
+      |                   *         |
+      |                  *          |
+      |                  *          |
+      |                 *           |
+      |                *            |
+      |               *             |
+    1 ++             A             ++
+      |             *               |
+      |            *                |
+      |            *                |
+      |           *                 |
+      |          *                  |
+      |         *                   |
+      |        *                    |
+      |       *                     |
+  0.5 ++      *                    ++
+      |      *                      |
+      |     *                       |
+      |    *                        |
+      |   *                         |
+      |  *                          |
+      |  *                          |
+      | *                           |
+      +*      +      +       +      +
+    0 A+------+------+-------+-----++
+      1      1.5     2      2.5     3
+
+EOF
+
+tryplot( testname => 'basic streaming test, twice as fast',
+         cmd      => q{seq 500 | awk 'BEGIN{ print 0; } {print (NR==3)? "exit" : $0; fflush(); system("sleep 0.6");}'},
+         options  => [qw(--lines --points --stream 0.4)],
+         refplot  => <<'EOF' );
+

+
+    1 ++----+-----+-----+-----+----+A
+      +     +     +     +     +    *+
+      |                           * |
+      |                          *  |
+      |                          *  |
+      |                         *   |
+      |                        *    |
+  0.8 ++                      *    ++
+      |                      *      |
+      |                     *       |
+      |                    *        |
+      |                    *        |
+      |                   *         |
+      |                  *          |
+  0.6 ++                *          ++
+      |                *            |
+      |               *             |
+      |              *              |
+      |              *              |
+      |             *               |
+      |            *                |
+  0.4 ++          *                ++
+      |          *                  |
+      |         *                   |
+      |        *                    |
+      |        *                    |
+      |       *                     |
+      |      *                      |
+  0.2 ++    *                      ++
+      |    *                        |
+      |   *                         |
+      |  *                          |
+      |  *                          |
+      | *                           |
+      +*    +     +     +     +     +
+    0 A+----+-----+-----+-----+----++
+      1    1.2   1.4   1.6   1.8    2
+
+

+
+    2 ++------+------+-------+-----+A
+      +       +      +       +     *+
+      |                           * |
+      |                          *  |
+      |                         *   |
+      |                         *   |
+      |                        *    |
+      |                       *     |
+      |                      *      |
+  1.5 ++                    *      ++
+      |                    *        |
+      |                   *         |
+      |                  *          |
+      |                  *          |
+      |                 *           |
+      |                *            |
+      |               *             |
+    1 ++             A             ++
+      |             *               |
+      |            *                |
+      |            *                |
+      |           *                 |
+      |          *                  |
+      |         *                   |
+      |        *                    |
+      |       *                     |
+  0.5 ++      *                    ++
+      |      *                      |
+      |     *                       |
+      |    *                        |
+      |   *                         |
+      |  *                          |
+      |  *                          |
+      | *                           |
+      +*      +      +       +      +
+    0 A+------+------+-------+-----++
+      1      1.5     2      2.5     3
+
+EOF
+
+
+tryplot( testname => 'streaming with --xlen',
+         cmd      => q{seq 500 | awk 'BEGIN{ print 0; } {print (NR==3)? "exit" : $0; fflush(); system("sleep 0.6");}'},
+         options  => [qw(--lines --points --stream 0.4 --xlen 1.1)],
+         refplot  => <<'EOF' );
+

+
+    1 ++-+----+-----+----+-----+---+A
+      |  +    +     +    +     +   *+
+      |                           * |
+      |                           * |
+      |                          *  |
+      |                         *   |
+      |                        *    |
+  0.8 ++                       *   ++
+      |                       *     |
+      |                      *      |
+      |                     *       |
+      |                     *       |
+      |                    *        |
+      |                   *         |
+  0.6 ++                 *         ++
+      |                 *           |
+      |                 *           |
+      |                *            |
+      |               *             |
+      |              *              |
+      |              *              |
+  0.4 ++            *              ++
+      |            *                |
+      |           *                 |
+      |          *                  |
+      |          *                  |
+      |         *                   |
+      |        *                    |
+  0.2 ++      *                    ++
+      |       *                     |
+      |      *                      |
+      |     *                       |
+      |    *                        |
+      |    *                        |
+      |  +*   +     +    +     +    +
+    0 ++-A----+-----+----+-----+---++
+         1   1.2   1.4  1.6   1.8   2
+
+

+
+    2 ++-+----+-----+----+-----+---+A
+      |  +    +     +    +     +   *+
+      |                           * |
+      |                           * |
+      |                          *  |
+      |                         *   |
+      |                        *    |
+  1.8 ++                       *   ++
+      |                       *     |
+      |                      *      |
+      |                     *       |
+      |                     *       |
+      |                    *        |
+      |                   *         |
+  1.6 ++                 *         ++
+      |                 *           |
+      |                 *           |
+      |                *            |
+      |               *             |
+      |              *              |
+      |              *              |
+  1.4 ++            *              ++
+      |            *                |
+      |           *                 |
+      |          *                  |
+      |          *                  |
+      |         *                   |
+      |        *                    |
+  1.2 ++      *                    ++
+      |       *                     |
+      |      *                      |
+      |     *                       |
+      |    *                        |
+      |    *                        |
+      |  +*   +     +    +     +    +
+    1 ++-A----+-----+----+-----+---++
+         2   2.2   2.4  2.6   2.8   3
+
+EOF
+
+tryplot( testname => 'streaming with --monotonic',
+         cmd      => q{seq 500 | awk '{if(NR==11) {print "exit";} else {x=(NR-1)%5; if(x==0) {print -1,-1;} print x,NR;}; fflush(); system("sleep 0.6");}'},
+         options  => [qw(--lines --points --stream 0.4 --domain --monotonic)],
+         refplot  => <<'EOF' );
+

+
+    1 ++----+-----+-----+-----+----+A
+      +     +     +     +     +    *+
+      |                           * |
+      |                          *  |
+      |                          *  |
+      |                         *   |
+      |                        *    |
+      |                       *     |
+      |                      *      |
+  0.5 ++                    *      ++
+      |                    *        |
+      |                    *        |
+      |                   *         |
+      |                  *          |
+      |                 *           |
+      |                *            |
+      |               *             |
+    0 ++             *             ++
+      |              *              |
+      |             *               |
+      |            *                |
+      |           *                 |
+      |          *                  |
+      |         *                   |
+      |        *                    |
+      |        *                    |
+ -0.5 ++      *                    ++
+      |      *                      |
+      |     *                       |
+      |    *                        |
+      |   *                         |
+      |  *                          |
+      |  *                          |
+      | *                           |
+      +*    +     +     +     +     +
+   -1 A+----+-----+-----+-----+----++
+     -1   -0.8  -0.6  -0.4  -0.2    0
+
+

+
+    2 ++------+------+-------+-----+A
+      +       +      +       +     *+
+      |                          ** |
+      |                         *   |
+      |                        *    |
+      |                       *     |
+  1.5 ++                    **     ++
+      |                    *        |
+      |                   *         |
+      |                  *          |
+      |                **           |
+      |               *             |
+    1 ++             A             ++
+      |             *               |
+      |             *               |
+      |            *                |
+      |           *                 |
+  0.5 ++          *                ++
+      |          *                  |
+      |         *                   |
+      |         *                   |
+      |        *                    |
+      |       *                     |
+    0 ++      *                    ++
+      |      *                      |
+      |      *                      |
+      |     *                       |
+      |    *                        |
+      |    *                        |
+ -0.5 ++  *                        ++
+      |  *                          |
+      |  *                          |
+      | *                           |
+      |*                            |
+      +*      +      +       +      +
+   -1 A+------+------+-------+-----++
+     -1     -0.5     0      0.5     1
+
+

+
+    3 ++---+----+----+----+----+---+A
+      +    +    +    +    +    +   *+
+      |                           * |
+      |                          *  |
+  2.5 ++                       **  ++
+      |                       *     |
+      |                      *      |
+      |                     *       |
+      |                    *        |
+    2 ++                  A        ++
+      |                  *          |
+      |                **           |
+      |               *             |
+  1.5 ++             *             ++
+      |             *               |
+      |           **                |
+      |          *                  |
+    1 ++        A                  ++
+      |        *                    |
+      |        *                    |
+      |       *                     |
+      |       *                     |
+  0.5 ++     *                     ++
+      |      *                      |
+      |     *                       |
+      |     *                       |
+    0 ++   *                       ++
+      |   *                         |
+      |   *                         |
+      |  *                          |
+      |  *                          |
+ -0.5 ++*                          ++
+      | *                           |
+      |*                            |
+      +*   +    +    +    +    +    +
+   -1 A+---+----+----+----+----+---++
+     -1  -0.5   0   0.5   1   1.5   2
+
+

+
+  4 ++--+---+---+---+---+---+---+--+A
+    +   +   +   +   +   +   +   +  *+
+    |                             * |
+    |                           **  |
+    |                          *    |
+    |                         *     |
+    |                        *      |
+  3 ++                      A      ++
+    |                      *        |
+    |                     *         |
+    |                   **          |
+    |                  *            |
+    |                 *             |
+    |                *              |
+  2 ++              A              ++
+    |              *                |
+    |             *                 |
+    |           **                  |
+    |          *                    |
+    |         *                     |
+    |        *                      |
+  1 ++      A                      ++
+    |      *                        |
+    |      *                        |
+    |     *                         |
+    |     *                         |
+    |    *                          |
+    |    *                          |
+  0 ++  *                          ++
+    |  *                            |
+    |  *                            |
+    | *                             |
+    | *                             |
+    |*                              |
+    +*  +   +   +   +   +   +   +   +
+ -1 A+--+---+---+---+---+---+---+--++
+   -1 -0.5  0  0.5  1  1.5  2  2.5  3
+
+

+
+  5 ++----+------+-----+------+----+A
+    +     +      +     +      +    *+
+    |                             * |
+    |                            *  |
+    |                           *   |
+    |                          *    |
+  4 ++                        A    ++
+    |                        *      |
+    |                       *       |
+    |                     **        |
+    |                    *          |
+    |                   *           |
+  3 ++                 A           ++
+    |                 *             |
+    |               **              |
+    |              *                |
+    |             *                 |
+  2 ++           A                 ++
+    |           *                   |
+    |          *                    |
+    |        **                     |
+    |       *                       |
+    |      *                        |
+  1 ++    A                        ++
+    |     *                         |
+    |    *                          |
+    |    *                          |
+    |   *                           |
+    |   *                           |
+  0 ++ *                           ++
+    |  *                            |
+    | *                             |
+    | *                             |
+    |*                              |
+    +*    +      +     +      +     +
+ -1 A+----+------+-----+------+----++
+   -1     0      1     2      3     4
+
+

+
+  6 ++----+------+-----+------+----+A
+    +     +      +     +      +    *+
+    |                             * |
+    |                            *  |
+    |                           *   |
+  5 ++                         *   ++
+    |                          *    |
+    |                         *     |
+    |                        *      |
+    |                       *       |
+  4 ++                     *       ++
+    |                     *         |
+    |                    *          |
+    |                   *           |
+    |                  *            |
+  3 ++                *            ++
+    |                *              |
+    |               *               |
+    |               *               |
+    |              *                |
+  2 ++            *                ++
+    |            *                  |
+    |           *                   |
+    |          *                    |
+    |         *                     |
+  1 ++       *                     ++
+    |       *                       |
+    |      *                        |
+    |     *                         |
+    |    *                          |
+  0 ++   *                         ++
+    |   *                           |
+    |  *                            |
+    | *                             |
+    +*    +      +     +      +     +
+ -1 A+----+------+-----+------+----++
+   -1   -0.8   -0.6  -0.4   -0.2    0
+
+

+
+  7 ++------+-------+-------+-----**A
+    +       +       +       + ****  +
+    |                     ****      |
+    |                 ****          |
+  6 ++              A*             ++
+    |              *                |
+    |              *                |
+    |             *                 |
+    |             *                 |
+  5 ++           *                 ++
+    |            *                  |
+    |           *                   |
+    |           *                   |
+  4 ++         *                   ++
+    |          *                    |
+    |         *                     |
+    |         *                     |
+  3 ++       *                     ++
+    |        *                      |
+    |       *                       |
+    |       *                       |
+    |      *                        |
+  2 ++     *                       ++
+    |     *                         |
+    |     *                         |
+    |    *                          |
+  1 ++   *                         ++
+    |   *                           |
+    |   *                           |
+    |  *                            |
+    |  *                            |
+  0 ++*                            ++
+    | *                             |
+    |*                              |
+    +*      +       +       +       +
+ -1 A+------+-------+-------+------++
+   -1     -0.5      0      0.5      1
+
+

+
+  8 ++---+-----+----+----+-----+---*A
+    +    +     +    +    +     +*** +
+    |                         **    |
+    |                      ***      |
+  7 ++                  *A*        ++
+    |                 **            |
+    |              ***              |
+    |            **                 |
+  6 ++         A*                  ++
+    |          *                    |
+    |         *                     |
+    |         *                     |
+  5 ++       *                     ++
+    |        *                      |
+    |        *                      |
+    |       *                       |
+  4 ++      *                      ++
+    |      *                        |
+    |      *                        |
+  3 ++     *                       ++
+    |     *                         |
+    |     *                         |
+    |    *                          |
+  2 ++   *                         ++
+    |   *                           |
+    |   *                           |
+    |   *                           |
+  1 ++ *                           ++
+    |  *                            |
+    | *                             |
+    | *                             |
+  0 ++*                            ++
+    |*                              |
+    |*                              |
+    *    +     +    +    +     +    +
+ -1 A+---+-----+----+----+-----+---++
+   -1  -0.5    0   0.5   1    1.5   2
+
+

+
+  10 ++--+---+---+---+--+---+---+--++
+     +   +   +   +   +  +   +   +   +
+     |                              |
+     |                             *A
+     |                          *** |
+     |                        **    |
+   8 ++                    *A*     ++
+     |                   **         |
+     |                 **           |
+     |              *A*             |
+     |           ***                |
+     |         **                   |
+   6 ++      A*                    ++
+     |       *                      |
+     |      *                       |
+     |      *                       |
+     |     *                        |
+   4 ++    *                       ++
+     |     *                        |
+     |    *                         |
+     |    *                         |
+     |   *                          |
+     |   *                          |
+   2 ++  *                         ++
+     |  *                           |
+     |  *                           |
+     | *                            |
+     | *                            |
+     | *                            |
+   0 +*                            ++
+     |*                             |
+     *                              |
+     A                              |
+     |                              |
+     +   +   +   +   +  +   +   +   +
+  -2 ++--+---+---+---+--+---+---+--++
+    -1 -0.5  0  0.5  1 1.5  2  2.5  3
+
+

+
+  10 ++----+-----+------+-----+----*A
+     +     +     +      +     +  ** +
+     |                         **   |
+     |                       *A     |
+     |                     **       |
+     |                   **         |
+   8 ++                *A          ++
+     |               **             |
+     |             **               |
+     |          *A*                 |
+     |        **                    |
+     |      **                      |
+   6 ++    A                       ++
+     |     *                        |
+     |    *                         |
+     |    *                         |
+     |    *                         |
+   4 ++   *                        ++
+     |   *                          |
+     |   *                          |
+     |   *                          |
+     |  *                           |
+     |  *                           |
+   2 ++ *                          ++
+     | *                            |
+     | *                            |
+     | *                            |
+     | *                            |
+     |*                             |
+   0 +*                            ++
+     |*                             |
+     *                              |
+     A                              |
+     |                              |
+     +     +     +      +     +     +
+  -2 ++----+-----+------+-----+----++
+    -1     0     1      2     3     4
+
+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