Commit d1f43974 authored by legoc's avatar legoc

Tests updated for stream review

parent 1a029040
......@@ -217,8 +217,12 @@
<start executable="build/bin/testconnectionchecker"/>
</application>
<application name="veryfastcpp" starting_time="0" retries="0" stopping_time="0" stream="yes" multiple="no" restart="no">
<start executable="build/bin/testveryfast"/>
<application name="faststreamcpp" starting_time="0" retries="0" stopping_time="0" stream="yes" multiple="no" restart="no">
<start executable="build/bin/testfaststream"/>
</application>
<application name="inputstreamcpp" starting_time="0" retries="0" stopping_time="0" stream="yes" multiple="no" restart="no">
<start executable="build/bin/testinputstream"/>
</application>
<application name="stoptimeoutcpp" starting_time="0" retries="0" stopping_time="1" stream="yes" multiple="no" restart="no">
......
......@@ -225,8 +225,12 @@
<start executable="build/bin/testconnectionchecker"/>
</application>
<application name="veryfastcpp" starting_time="0" retries="0" stopping_time="0" stream="yes" multiple="no" restart="no">
<start executable="build/bin/testveryfast"/>
<application name="faststreamcpp" starting_time="0" retries="0" stopping_time="0" stream="yes" multiple="no" restart="no">
<start executable="build/bin/testfaststream"/>
</application>
<application name="inputstreamcpp" starting_time="0" retries="0" stopping_time="0" stream="yes" multiple="no" restart="no">
<start executable="build/bin/testinputstream"/>
</application>
<application name="stoptimeoutcpp" starting_time="0" retries="0" stopping_time="1" stream="yes" multiple="no" restart="no">
......@@ -273,7 +277,7 @@
<application name="requester-client" starting_time="0" retries="0" stopping_time="1" stream="yes" log_directory="logs" multiple="no" restart="no">
<start executable="build/bin/testrequesterclient"/>
</application>
</applications>
</config>
......@@ -170,6 +170,14 @@
<start executable="msvc/x64/Release/reqrepcpp"/>
</application>
<application name="faststreamcpp" starting_time="0" retries="0" stopping_time="0" stream="yes" multiple="no" restart="no">
<start executable="msvc/x64/Release/testfaststream"/>
</application>
<application name="inputstreamcpp" starting_time="0" retries="0" stopping_time="0" stream="yes" multiple="no" restart="no">
<start executable="msvc/x64/Release/testinputstream"/>
</application>
<application name="startpubcpp" starting_time="0" retries="0" stopping_time="1" stream="yes" multiple="no" restart="no" environment="win-environment.properties">
<start executable="msvc/x64/Release/subpubcpp" args="pubcpp"/>
</application>
......
......@@ -23,7 +23,8 @@ bin_PROGRAMS = \
testcancel \
testtimeout \
testconnectionchecker \
testveryfast \
testfaststream \
testinputstream \
teststoptimeout \
requesterclient \
responderserver \
......@@ -211,12 +212,20 @@ testconnectionchecker_LDFLAGS = $(CT_LDFLAGS)
testconnectionchecker_LDADD = $(CT_LIBS)
testveryfast_SOURCES = \
TestVeryFast.cpp
testfaststream_SOURCES = \
TestFastStream.cpp
testveryfast_CPPFLAGS = $(CT_CXXFLAGS)
testveryfast_LDFLAGS = $(CT_LDFLAGS)
testveryfast_LDADD = $(CT_LIBS)
testfaststream_CPPFLAGS = $(CT_CXXFLAGS)
testfaststream_LDFLAGS = $(CT_LDFLAGS)
testfaststream_LDADD = $(CT_LIBS)
testinputstream_SOURCES = \
TestInputStream.cpp
testinputstream_CPPFLAGS = $(CT_CXXFLAGS)
testinputstream_LDFLAGS = $(CT_LDFLAGS)
testinputstream_LDADD = $(CT_LIBS)
teststoptimeout_SOURCES = \
......
/*
* Copyright 2015 Institut Laue-Langevin
*
* Licensed under the EUPL, Version 1.1 only (the "License");
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at:
*
* http://joinup.ec.europa.eu/software/page/eupl
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and
* limitations under the Licence.
*/
#include <iostream>
#include <string>
#include <chrono>
#include <thread>
using namespace std;
int main(int argc, char *argv[]) {
int t = 1E6;
int n = 5;
if (argc > 1) {
t = stoi(argv[1]);
}
if (argc > 2) {
n = stoi(argv[2]);
}
for (int i = 0; i < n; i++) {
cout << "line " << i << " ";
int c = i % 10;
for (int j = 0; j < c; ++j) {
cout << "*";
}
cout << endl;
if (c == 0) {
cout << endl;
}
this_thread::sleep_for(chrono::microseconds(t));
}
cout << "OOOO" << endl;
return 0;
}
......@@ -16,16 +16,18 @@
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <cameo/cameo.h>
using namespace std;
using namespace cameo;
int main(int argc, char *argv[]) {
cout << "Veryfast" << endl;
int x;
while (true) {
cout << "Enter a number:";
cin >> x;
cout << endl << "Thanks" << endl;
}
return 0;
}
package fr.ill.ics.cameo.test;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
public class TestProcessStream {
private static boolean running = true;
public static void main(String[] args) {
try {
System.out.println("Creating Process...");
Process p = Runtime.getRuntime().exec(args);
Thread t = new Thread() {
public void run() {
System.out.println("Thread started");
// get the input stream of the process and print it
InputStream in = p.getInputStream();
// try {
// for (int i = 0; i < in.available(); i++) {
// System.out.println("" + in.read());
// }
// } catch (IOException e) {
// System.err.println("Error stream");
// }
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
// test here
try {
while (running) {
if (reader.ready()) {
System.out.println("Reader ready");
// use read instead?
String line = reader.readLine();
System.out.println(">> " + line);
}
else {
Thread.sleep(100);
}
}
} catch (IOException e) {
System.err.println("Error stream");
} catch (Throwable e) {
System.err.println("Error " + e);
}
}
};
t.start();
//Thread.sleep(5000);
p.waitFor();
// wait has an influence?
//running = false;
System.out.println("Terminated process");
t.join();
System.out.println("Terminated thread");
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment