Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve build errors on linux #49

Merged
merged 6 commits into from
Oct 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@

name: Java CI with Maven

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
on: push

jobs:
build:

runs-on: windows-latest
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>org.tzi.use</groupId>
<artifactId>use</artifactId>
<packaging>pom</packaging>
<version>7.0.1</version>
<version>7.1.0</version>
<modules>
<module>use-core</module>
<module>use-gui</module>
Expand Down
2 changes: 1 addition & 1 deletion use-assembly/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>use</artifactId>
<groupId>org.tzi.use</groupId>
<version>7.0.1</version>
<version>7.1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion use-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>use</artifactId>
<groupId>org.tzi.use</groupId>
<version>7.0.1</version>
<version>7.1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion use-core/src/main/java/org/tzi/use/config/Options.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
public class Options {

// the release version
public static final String RELEASE_VERSION = "7.0.1";
public static final String RELEASE_VERSION = "7.1.0";

// the copyright
public static final String COPYRIGHT = "Copyright (C) 1999-2021 University of Bremen";
Expand Down
2 changes: 1 addition & 1 deletion use-gui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>use</artifactId>
<groupId>org.tzi.use</groupId>
<version>7.0.1</version>
<version>7.1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
25 changes: 20 additions & 5 deletions use-gui/src/it/java/org/tzi/use/main/ShellIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import com.github.difflib.patch.Patch;
import org.junit.jupiter.api.DynamicTest;
import org.junit.jupiter.api.TestFactory;
import org.tzi.use.config.Options;

import java.io.*;
import java.net.URISyntaxException;
Expand Down Expand Up @@ -135,8 +134,15 @@ private void assertShellExpressions(Path testFile, Path useFile) {
*/
private void validateOutput(Path testFile, List<String> expectedOutput, List<String> actualOutput) {
Patch<String> patch = DiffUtils.diff(expectedOutput, actualOutput);
boolean nonWhitespaceChange = false;

if (!patch.getDeltas().isEmpty()) {
// Check if non whitespace diffs are present
nonWhitespaceChange = patch.getDeltas().stream().anyMatch(
(delta) -> delta.getSource().getLines().stream().anyMatch(line -> !line.isBlank()) ||
delta.getTarget().getLines().stream().anyMatch(line -> !line.isBlank())
);

if (nonWhitespaceChange) {
StringBuilder diffMsg = new StringBuilder("USE output does not match expected output!").append(System.lineSeparator());

diffMsg.append("Testfile: ").append(testFile).append(System.lineSeparator());
Expand All @@ -146,7 +152,14 @@ private void validateOutput(Path testFile, List<String> expectedOutput, List<Str

//simple output the computed patch to console
for (AbstractDelta<String> delta : patch.getDeltas()) {
diffMsg.append(delta.toString()).append(System.lineSeparator());
diffMsg.append("Diff [")
.append(delta.getType())
.append("] Source: '")
.append(delta.getSource().toString())
.append("' Target: '" )
.append(delta.getTarget().toString())
.append("'")
.append(System.lineSeparator());
}

writeToFile(expectedOutput, testFile.getParent().resolve(testFile.getFileName().toString() + ".expected" ));
Expand Down Expand Up @@ -210,7 +223,7 @@ private List<String> createCommandFile(Path inFile, Path cmdFile) {

try {
cmdWriter.write(inputLine);
cmdWriter.write(Options.LINE_SEPARATOR);
cmdWriter.write(System.lineSeparator());

expectedOutput.add((prompt + inputLine).trim());
} catch (IOException e1) {
Expand Down Expand Up @@ -319,7 +332,9 @@ private List<String> runUSE(Path useFile, Path cmdFile) {

if (proc.isAlive()) {
line = line == null ? "" : line.trim();
actualOutput.add(line);
if (!line.equals("")) {
actualOutput.add(line);
}
}
}

Expand Down