Skip to content

Commit

Permalink
Support for additional test-to-main directory mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
roguexz committed Sep 26, 2020
1 parent 8ff9ed1 commit b069233
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.Map;
import java.util.stream.Stream;

import io.quarkus.runtime.util.ClassPathUtils;

Expand Down Expand Up @@ -99,6 +100,20 @@ public final class PathTestHelper {
File.separator + "test-classes",
File.separator + "classes");
//endregion

String mappings = System.getenv("ADDITIONAL_TEST_TO_MAIN_MAPPINGS");
if (mappings != null) {
Stream.of(mappings.split(","))
.filter(s -> !s.isEmpty())
.forEach(s -> {
String[] entry = s.split(":");
if (entry.length == 2) {
TEST_TO_MAIN_DIR_FRAGMENTS.put(entry[0], entry[1]);
} else {
System.err.println("Unable to parse additional test-to-main mapping: " + s);
}
});
}
}

private PathTestHelper() {
Expand Down

0 comments on commit b069233

Please sign in to comment.