From 9b049b0dbd8a80fe34cb8f7665175f3468d6c4c6 Mon Sep 17 00:00:00 2001 From: Greg Bowyer Date: Tue, 4 Sep 2012 23:54:13 +0000 Subject: [PATCH] LUCENE-4332: Integrate PiTest mutation coverage git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1380938 13f79535-47bb-0310-9956-ffa450edef68 --- build.xml | 9 +++ lucene/build.xml | 8 +++ lucene/common-build.xml | 97 +++++++++++++++++++++++++++++- lucene/tools/build.xml | 1 + lucene/tools/junit4/tests.policy | 10 ++- solr/build.xml | 19 ++++++ solr/example/build.xml | 3 + solr/example/example-DIH/build.xml | 3 + 8 files changed, 147 insertions(+), 3 deletions(-) diff --git a/build.xml b/build.xml index 5bcd84ee6b5..46e33ab9d48 100644 --- a/build.xml +++ b/build.xml @@ -33,6 +33,15 @@ + + + + + + + + + diff --git a/lucene/build.xml b/lucene/build.xml index 7f394e3eefb..ceef56e587d 100644 --- a/lucene/build.xml +++ b/lucene/build.xml @@ -55,6 +55,10 @@ description="Runs all unit tests (core, modules and back-compat)" /> + + @@ -478,6 +482,10 @@ + + + + diff --git a/lucene/common-build.xml b/lucene/common-build.xml index 002788468b6..13193122975 100644 --- a/lucene/common-build.xml +++ b/lucene/common-build.xml @@ -106,7 +106,7 @@ - + @@ -218,6 +218,15 @@ + + + + + + + + + @@ -1102,6 +1111,16 @@ ${tests-output}/junit4-*.suites - per-JVM executed suites + + Code coverage with pitest enabled. + + + + @@ -1705,4 +1724,80 @@ ${tests-output}/junit4-*.suites - per-JVM executed suites + + + + + + + + + + + + + + + + + + + + +PiTest mutation coverage can take a *long* time on even large hardware. +(EC2 32core sandy bridge takes at least 12 hours to run PiTest for the lucene test cases) + +The following arguments can be provided to ant to alter its behaviour and target specific tests:: + +-Dpitest.report.dir (@{pitest.report.dir}) - Change where PiTest writes output reports + +-Dpitest.distance (@{pitest.distance}) - How far away from the test class should be mutated + 0 being immeditate callees only + +-Dpitest.threads (@{pitest.threads}) - How many threads to use in PiTest + (note this is independent of junit threads) + +-Dpitest.testCases (@{pitest.testCases}) - Glob of testcases to run + +-Dpitest.maxMutations (@{pitest.maxMutations}) - Maximum number of mutations per class under test + 0 being unlimited + +-Dpitest.timeoutFactor (@{pitest.timeoutFactor}) - Tunable factor used to determine + if a test is potentially been mutated to be an infinate loop or O(n!) (or similar) + +-Dpitest.timeoutConst (@{pitest.timeoutConst}) - Base constant used for working out timeouts + +-Dpitest.targetClasses (@{pitest.targetClasses}) - Classes to consider for mutation + + + + + + + + + + + + + + + + + + diff --git a/lucene/tools/build.xml b/lucene/tools/build.xml index 106c2da6f19..60f9c517fa3 100644 --- a/lucene/tools/build.xml +++ b/lucene/tools/build.xml @@ -45,4 +45,5 @@ + diff --git a/lucene/tools/junit4/tests.policy b/lucene/tools/junit4/tests.policy index c0a69c02281..5b0ec0a7a2e 100644 --- a/lucene/tools/junit4/tests.policy +++ b/lucene/tools/junit4/tests.policy @@ -45,11 +45,17 @@ grant { permission java.util.PropertyPermission "*", "read,write"; permission java.lang.reflect.ReflectPermission "*"; permission java.lang.RuntimePermission "*"; - + + // Needed for some things in DNS caching in the JVM + permission java.security.SecurityPermission "*", "read,write"; + + // These two *have* to be spelled out a seperate + permission java.lang.management.ManagementPermission "control"; + permission java.lang.management.ManagementPermission "monitor"; + // Solr needs those: permission java.net.NetPermission "*"; permission java.util.logging.LoggingPermission "control"; - permission java.lang.management.ManagementPermission "monitor"; permission javax.management.MBeanPermission "*", "*"; permission javax.management.MBeanServerPermission "*"; permission javax.management.MBeanTrustPermission "*"; diff --git a/solr/build.xml b/solr/build.xml index 6fab138d640..87cf22bc491 100644 --- a/solr/build.xml +++ b/solr/build.xml @@ -133,6 +133,8 @@ depends="test-core, test-contrib"/> + + + + + + + + + + + + + + + + + + diff --git a/solr/example/build.xml b/solr/example/build.xml index fdfbe95b829..91ef7b4a3c4 100644 --- a/solr/example/build.xml +++ b/solr/example/build.xml @@ -33,6 +33,9 @@ + + + diff --git a/solr/example/example-DIH/build.xml b/solr/example/example-DIH/build.xml index b48b1496123..fb82edf96f5 100644 --- a/solr/example/example-DIH/build.xml +++ b/solr/example/example-DIH/build.xml @@ -35,4 +35,7 @@ + + +