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

refactor(test): faster running of individual tests of MainTest #2144

Merged
merged 1 commit into from
Jul 1, 2018
Merged
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
13 changes: 12 additions & 1 deletion src/test/java/spoon/test/main/MainTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.junit.contrib.java.lang.system.Assertion;
import org.junit.contrib.java.lang.system.ExpectedSystemExit;
import spoon.Launcher;
import spoon.SpoonModelBuilder.InputType;
import spoon.reflect.code.CtArrayWrite;
import spoon.reflect.code.CtAssignment;
import spoon.reflect.code.CtExpression;
Expand Down Expand Up @@ -86,7 +87,7 @@ public static void loadModel() {

launcher = new Launcher();

launcher.run(new String[] {
launcher.setArgs(new String[] {
"-i", "src/main/java",
"-o", "target/spooned",
"--destination","target/spooned-build",
Expand All @@ -96,9 +97,19 @@ public static void loadModel() {
"--level", "OFF"
});

launcher.buildModel();

rootPackage = launcher.getFactory().Package().getRootPackage();
}

@Test
public void testMain_ModelPrintAndCompile() {
//contract: check that spoon sources can be printed
launcher.prettyprint();
//contract: check that spoon sources can be compiled
launcher.getModelBuilder().compile(InputType.CTTYPES);
}

@Test
public void testMain_checkGenericContracts() {
checkGenericContracts(rootPackage);
Expand Down