diff --git a/src/main/java/de/hftstuttgart/modocot/Testrunner.java b/src/main/java/de/hftstuttgart/modocot/Testrunner.java index 8f8928421a563532b64d859d966e238fea517197..c0d61b36ce2d1e472e63cf6252b4a209b126c9c2 100644 --- a/src/main/java/de/hftstuttgart/modocot/Testrunner.java +++ b/src/main/java/de/hftstuttgart/modocot/Testrunner.java @@ -72,7 +72,6 @@ public class Testrunner libraryFolders = args[1].split(":"); resultFolder = args[2]; classFolder = Files.createTempDirectory("modocot-testrunner").toAbsolutePath().toString(); - classPathItems = buildClassPathItems(); // finding all source files Set<File> sourceFiles = new HashSet<>(); @@ -94,10 +93,14 @@ public class Testrunner writeResult(resultSummary); } - public static String[] buildClassPathItems() + public static String[] buildClassPathItems(boolean runtime) { Set<String> classPathItemsBuild = new HashSet<>(Arrays.asList(libraryFolders)); classPathItemsBuild.add(classFolder); + if (runtime) + { + classPathItemsBuild.addAll(Arrays.stream(sourceFolders).collect(Collectors.toSet())); + } return classPathItemsBuild.toArray(new String[0]); } @@ -140,6 +143,7 @@ public class Testrunner public static List<Diagnostic> compile(Set<File> files, File outputDir) { + classPathItems = buildClassPathItems(false); LOG.info("compilation started"); List<Diagnostic> compilationErrors = new LinkedList<>(); @@ -311,6 +315,7 @@ public class Testrunner public static ModocotResultSummary runTests() throws MalformedURLException { + classPathItems = buildClassPathItems(true); LOG.info("saving original class loader"); ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader(); // get custom one