Skip to content
Snippets Groups Projects
Commit eb0da14a authored by dgelessus's avatar dgelessus
Browse files

Extract public_examples into build directory to fix Gradle warnings

Gradle 7 warns that extractPublicExamples could affect other tasks that
don't depend on it, presumably because the tar file might contain a
directory like src/main/java that might overwrite the project sources.
This will become an error in Gradle 8. The simplest fix is to extract
the tar into its own subdirectory that cannot conflict with anything
else.
parent 29ca24a3
No related branches found
No related tags found
No related merge requests found
......@@ -94,11 +94,11 @@ task downloadPublicExamples(type: Download) {
task extractPublicExamples(dependsOn: downloadPublicExamples, type: Copy) {
from tarTree(resources.gzip("${buildDir}/ProB_public_examples.tgz"))
into projectDir
into "${buildDir}/prob_examples"
}
clean {
delete "${projectDir}/public_examples"
delete "${projectDir}/public_examples" // now extracted into build, but previous versions placed it at top level
delete "${projectDir}/states"
delete "${projectDir}/temp"
}
......
......@@ -40,7 +40,7 @@ public class CoverageTest extends AbstractParseMachineTest {
public static Configuration getConfig() {
final ArrayList<String> list = new ArrayList<String>();
final ArrayList<String> ignoreList = new ArrayList<String>();
list.add("public_examples/TLC/");
list.add("build/prob_examples/public_examples/TLC/");
list.add("./src/test/resources/");
ignoreList.add("./src/test/resources/compound/");
......
package de.tlc4b.tlc.integration.probprivate;
import static de.tlc4b.tlc.TLCResults.TLCResult.*;
import static de.tlc4b.util.TestUtil.test;
import static org.junit.Assert.assertEquals;
import java.io.File;
import java.util.ArrayList;
import org.junit.Test;
import org.junit.runner.RunWith;
import de.tlc4b.tlc.TLCResults.TLCResult;
import de.tlc4b.util.AbstractParseMachineTest;
import de.tlc4b.util.PolySuite;
import de.tlc4b.util.TestPair;
import de.tlc4b.util.PolySuite.Config;
import de.tlc4b.util.PolySuite.Configuration;
import de.tlc4b.util.TestPair;
import org.junit.Test;
import org.junit.runner.RunWith;
import static de.tlc4b.tlc.TLCResults.TLCResult.AssertionError;
import static de.tlc4b.util.TestUtil.test;
import static org.junit.Assert.assertEquals;
@RunWith(PolySuite.class)
public class AssertionErrorTest extends AbstractParseMachineTest {
......@@ -37,7 +37,7 @@ public class AssertionErrorTest extends AbstractParseMachineTest {
@Config
public static Configuration getConfig() {
final ArrayList<TestPair> list = new ArrayList<TestPair>();
list.add(new TestPair(AssertionError, "public_examples/TLC/AssertionError"));
list.add(new TestPair(AssertionError, "build/prob_examples/public_examples/TLC/AssertionError"));
return getConfiguration(list);
}
}
......@@ -38,7 +38,7 @@ public class DeadlockTest extends AbstractParseMachineTest {
public static Configuration getConfig() {
final ArrayList<TestPair> list = new ArrayList<TestPair>();
list.add(new TestPair(Deadlock,
"public_examples/TLC/Deadlock"));
"build/prob_examples/public_examples/TLC/Deadlock"));
return getConfiguration(list);
}
}
......@@ -38,7 +38,7 @@ public class GoalTest extends AbstractParseMachineTest {
public static Configuration getConfig() {
final ArrayList<TestPair> list = new ArrayList<TestPair>();
list.add(new TestPair(Goal,
"public_examples/TLC/GOAL"));
"build/prob_examples/public_examples/TLC/GOAL"));
return getConfiguration(list);
}
}
......@@ -38,7 +38,7 @@ public class InvariantViolationTest extends AbstractParseMachineTest {
public static Configuration getConfig() {
final ArrayList<TestPair> list = new ArrayList<TestPair>();
list.add(new TestPair(InvariantViolation,
"public_examples/TLC/InvariantViolation"));
"build/prob_examples/public_examples/TLC/InvariantViolation"));
return getConfiguration(list);
}
}
package de.tlc4b.tlc.integration.probprivate;
import static de.tlc4b.tlc.TLCResults.TLCResult.*;
import static de.tlc4b.util.TestUtil.test;
import static org.junit.Assert.assertEquals;
import de.tlc4b.TLC4BGlobals;
import org.junit.Test;
import de.tlc4b.TLC4BGlobals;
import static de.tlc4b.tlc.TLCResults.TLCResult.Goal;
import static de.tlc4b.tlc.TLCResults.TLCResult.NoError;
import static de.tlc4b.util.TestUtil.test;
import static org.junit.Assert.assertEquals;
public class LawsTest {
@Test
public void BoolLaws() throws Exception {
TLC4BGlobals.setDeleteOnExit(true);
String[] a = new String[] { "public_examples/TLC/Laws/BoolLaws.mch"};
String[] a = new String[] { "build/prob_examples/public_examples/TLC/Laws/BoolLaws.mch"};
assertEquals(NoError, test(a));
}
@Test
public void BoolWithArithLaws() throws Exception {
TLC4BGlobals.setDeleteOnExit(true);
String[] a = new String[] { "public_examples/TLC/Laws/BoolWithArithLaws.mch", "-nodead"};
String[] a = new String[] { "build/prob_examples/public_examples/TLC/Laws/BoolWithArithLaws.mch", "-nodead"};
assertEquals(NoError, test(a));
}
@Test
public void FunLaws() throws Exception {
TLC4BGlobals.setDeleteOnExit(true);
String[] a = new String[] { "public_examples/TLC/Laws/FunLaws.mch"};
String[] a = new String[] { "build/prob_examples/public_examples/TLC/Laws/FunLaws.mch"};
assertEquals(NoError, test(a));
}
@Test
public void FunLawsWithLambda() throws Exception {
TLC4BGlobals.setDeleteOnExit(true);
String[] a = new String[] { "public_examples/TLC/Laws/FunLawsWithLambda.mch"};
String[] a = new String[] { "build/prob_examples/public_examples/TLC/Laws/FunLawsWithLambda.mch"};
assertEquals(NoError, test(a));
}
@Test
public void RelLaws_TLC() throws Exception {
TLC4BGlobals.setDeleteOnExit(true);
String[] a = new String[] { "public_examples/TLC/Laws/RelLaws_TLC.mch"};
String[] a = new String[] { "build/prob_examples/public_examples/TLC/Laws/RelLaws_TLC.mch"};
assertEquals(Goal, test(a));
}
@Test
public void BoolLaws_SetCompr() throws Exception {
TLC4BGlobals.setDeleteOnExit(true);
String[] a = new String[] { "public_examples/TLC/Laws/BoolLaws_SetCompr.mch"};
String[] a = new String[] { "build/prob_examples/public_examples/TLC/Laws/BoolLaws_SetCompr.mch"};
assertEquals(NoError, test(a));
}
@Test
public void BoolLaws_SetComprCLPFD() throws Exception {
TLC4BGlobals.setDeleteOnExit(true);
String[] a = new String[] { "public_examples/TLC/Laws/BoolLaws_SetComprCLPFD.mch"};
String[] a = new String[] { "build/prob_examples/public_examples/TLC/Laws/BoolLaws_SetComprCLPFD.mch"};
assertEquals(NoError, test(a));
}
@Test
public void CardinalityLaws_TLC() throws Exception {
TLC4BGlobals.setDeleteOnExit(true);
String[] a = new String[] { "public_examples/TLC/Laws/CardinalityLaws_TLC.mch", "-nodead"};
String[] a = new String[] { "build/prob_examples/public_examples/TLC/Laws/CardinalityLaws_TLC.mch", "-nodead"};
assertEquals(NoError, test(a));
}
@Test
public void EqualityLaws() throws Exception {
TLC4BGlobals.setDeleteOnExit(true);
String[] a = new String[] { "public_examples/TLC/Laws/EqualityLaws.mch", "-nodead"};
String[] a = new String[] { "build/prob_examples/public_examples/TLC/Laws/EqualityLaws.mch", "-nodead"};
assertEquals(NoError, test(a));
}
@Test
public void SubsetLaws() throws Exception {
TLC4BGlobals.setDeleteOnExit(true);
String[] a = new String[] { "public_examples/TLC/Laws/SubsetLaws.mch", "-nodead"};
String[] a = new String[] { "build/prob_examples/public_examples/TLC/Laws/SubsetLaws.mch", "-nodead"};
assertEquals(NoError, test(a));
}
}
......@@ -38,7 +38,7 @@ public class NoErrorTest extends AbstractParseMachineTest {
public static Configuration getConfig() {
final ArrayList<TestPair> list = new ArrayList<TestPair>();
list.add(new TestPair(NoError,
"public_examples/TLC/NoError"));
"build/prob_examples/public_examples/TLC/NoError"));
return getConfiguration(list);
}
......
package de.tlc4b.tlc.integration.probprivate;
import static de.tlc4b.tlc.TLCResults.TLCResult.*;
import static de.tlc4b.util.TestUtil.test;
import static org.junit.Assert.assertEquals;
import java.io.File;
import java.util.ArrayList;
import org.junit.Test;
import org.junit.runner.RunWith;
import de.tlc4b.tlc.TLCResults.TLCResult;
import de.tlc4b.util.AbstractParseMachineTest;
import de.tlc4b.util.PolySuite;
import de.tlc4b.util.TestPair;
import de.tlc4b.util.PolySuite.Config;
import de.tlc4b.util.PolySuite.Configuration;
import de.tlc4b.util.TestPair;
import org.junit.Test;
import org.junit.runner.RunWith;
import static de.tlc4b.tlc.TLCResults.TLCResult.WellDefinednessError;
import static de.tlc4b.util.TestUtil.test;
import static org.junit.Assert.assertEquals;
@RunWith(PolySuite.class)
public class WellDefinednessTest extends AbstractParseMachineTest {
......@@ -37,7 +37,7 @@ public class WellDefinednessTest extends AbstractParseMachineTest {
@Config
public static Configuration getConfig() {
final ArrayList<TestPair> list = new ArrayList<TestPair>();
list.add(new TestPair(WellDefinednessError, "public_examples/TLC/WellDefinednessError"));
list.add(new TestPair(WellDefinednessError, "build/prob_examples/public_examples/TLC/WellDefinednessError"));
return getConfiguration(list);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment