summaryrefslogtreecommitdiff
path: root/src/test/java/org/zwobble/hobgoblin/compiler/testing/ExecutionResult.java
blob: 553e41b8a7d0c2f703be554a9fcd50114bfe9721 (plain)
1
2
3
4
5
6
7
8
9
10
11
package org.zwobble.hobgoblin.compiler.testing;

public record ExecutionResult(int exitCode, String stdout, String stderr) {
    public ExecutionResult throwOnError() {
        if (exitCode == 0) {
            return this;
        } else {
            throw new AssertionError("exit code was " + exitCode + "\nstdout:\n" + stdout + "\nstderr:\n" + stderr);
        }
    }
}