Skip to content

Commit 63358cf

Browse files
committed
Merge with #54 and #55
1 parent c22c8db commit 63358cf

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

liquidjava-verifier/src/main/java/liquidjava/api/CommandLineLauncher.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
import java.io.File;
44
import java.util.Arrays;
55
import java.util.List;
6-
76
import liquidjava.errors.ErrorEmitter;
87
import liquidjava.processor.RefinementProcessor;
98
import spoon.Launcher;
109
import spoon.processing.ProcessingManager;
10+
import spoon.reflect.declaration.CtPackage;
1111
import spoon.reflect.factory.Factory;
1212
import spoon.support.QueueProcessingManager;
1313

@@ -31,11 +31,6 @@ public static void main(String[] args) {
3131
System.out.println(ee.foundError() ? (ee.getFullMessage()) : ("Correct! Passed Verification."));
3232
}
3333

34-
public static ErrorEmitter launchTest(String path) {
35-
ErrorEmitter ee = launch(path);
36-
return ee;
37-
}
38-
3934
public static ErrorEmitter launch(String... paths) {
4035
System.out.println("Running LiquidJava on: " + Arrays.toString(paths).replaceAll("[\\[\\]]", ""));
4136

@@ -63,7 +58,6 @@ public static ErrorEmitter launch(String... paths) {
6358

6459
final Factory factory = launcher.getFactory();
6560
final ProcessingManager processingManager = new QueueProcessingManager(factory);
66-
6761
final RefinementProcessor processor = new RefinementProcessor(factory, ee);
6862
processingManager.addProcessor(processor);
6963

@@ -79,4 +73,13 @@ public static ErrorEmitter launch(String... paths) {
7973

8074
return ee;
8175
}
76+
77+
/**
78+
* Launch the LiquidJava verifier on the given file or directory path (for testing purposes)
79+
* @param path Path to to be verified
80+
* @return ErrorEmitter containing any errors found during verification
81+
*/
82+
public static ErrorEmitter launchTest(String path) {
83+
return launch(path);
84+
}
8285
}

0 commit comments

Comments
 (0)