summaryrefslogtreecommitdiff
path: root/tests/test_tools_2.cc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_tools_2.cc')
-rw-r--r--tests/test_tools_2.cc26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/test_tools_2.cc b/tests/test_tools_2.cc
new file mode 100644
index 0000000..0cf4cad
--- /dev/null
+++ b/tests/test_tools_2.cc
@@ -0,0 +1,26 @@
+#include "simple_sink.hh"
+#include "testtools.hh"
+
+using namespace rtfl::tools;
+using namespace rtfl::tests;
+
+int main (int argc, char *argv[])
+{
+ int fd1 = openPipe ("echo Hello; sleep 2");
+ BlockingLinesSource s1 (fd1);
+ // Both commands start at the same time, even if fd2 is processed later; thus
+ // the "sleep" at the beginning of the second command.
+ int fd2 = openPipe ("sleep 2; echo World; sleep 2");
+ BlockingLinesSource s2 (fd2);
+
+ LinesSourceSequence lss (false);
+ lss.add (&s1);
+ lss.add (&s2);
+ lss.addTimeout(1, 123);
+ lss.addTimeout(3, 124);
+
+ SimpleSink sink;
+ lss.setup (&sink);
+
+ return 0;
+}