projects
/
lttng-ust-java-tests.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Echo the commands being executed
[lttng-ust-java-tests.git]
/
src
/
test
/
java
/
org
/
lttng
/
ust
/
agent
/
utils
/
LttngSession.java
diff --git
a/src/test/java/org/lttng/ust/agent/utils/LttngSession.java
b/src/test/java/org/lttng/ust/agent/utils/LttngSession.java
index 9c77f59b8395ca8e7bdd41d58aa1afa8daaa9302..8869ef5da8c901acac2de140b3ee63772d394aa2 100644
(file)
--- a/
src/test/java/org/lttng/ust/agent/utils/LttngSession.java
+++ b/
src/test/java/org/lttng/ust/agent/utils/LttngSession.java
@@
-28,6
+28,7
@@
import java.nio.file.SimpleFileVisitor;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.Arrays;
import java.util.List;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.Arrays;
import java.util.List;
+import java.util.StringJoiner;
import java.util.UUID;
import java.util.stream.Collectors;
import java.util.UUID;
import java.util.stream.Collectors;
@@
-245,12
+246,20
@@
public class LttngSession implements AutoCloseable {
private static boolean executeCommand(List<String> command) {
try {
private static boolean executeCommand(List<String> command) {
try {
+ /* "echo" the command to stdout */
+ StringJoiner sj = new StringJoiner(" ", "$ ", "");
+ command.stream().forEach(sj::add);
+ System.out.println(sj.toString());
+
ProcessBuilder builder = new ProcessBuilder(command);
builder.redirectErrorStream(true);
builder.redirectOutput(Redirect.INHERIT);
Process p = builder.start();
int ret = p.waitFor();
ProcessBuilder builder = new ProcessBuilder(command);
builder.redirectErrorStream(true);
builder.redirectOutput(Redirect.INHERIT);
Process p = builder.start();
int ret = p.waitFor();
+
+ System.out.println("(returned from command)");
+
return (ret == 0);
} catch (IOException | InterruptedException e) {
return (ret == 0);
} catch (IOException | InterruptedException e) {
This page took
0.023126 seconds
and
4
git commands to generate.