Skip to content

Commit

Permalink
fix problems when running test_verify_bugs with -A option (#597)
Browse files Browse the repository at this point in the history
  • Loading branch information
markro49 authored Sep 6, 2024
1 parent 6d21107 commit f450612
Show file tree
Hide file tree
Showing 22 changed files with 159 additions and 40 deletions.
17 changes: 17 additions & 0 deletions framework/core/Project/Cli.pm
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ sub determine_layout {
#
sub _post_checkout {
my ($self, $rev_id, $work_dir) = @_;
my $vid = $self->{_vcs}->lookup_vid($rev_id);

my $project_dir = "$PROJECTS_DIR/$self->{pid}";
# Check whether ant build file exists
Expand Down Expand Up @@ -145,6 +146,22 @@ sub _post_checkout {
print OUT $converted_file;
close(OUT);
}

# Fix compilation errors if necessary.
# Run this as the first step to ensure that patches are applicable to
# unmodified source files.
my $compile_errors = "$PROJECTS_DIR/$self->{pid}/compile-errors/";
opendir(DIR, $compile_errors) or die "Could not find compile-errors directory.";
my @entries = readdir(DIR);
closedir(DIR);
foreach my $file (@entries) {
if ($file =~ /-(\d+)-(\d+).diff/) {
if ($vid >= $1 && $vid <= $2) {
$self->apply_patch($work_dir, "$compile_errors/$file")
or confess("Couldn't apply patch ($file): $!");
}
}
}
}

#
Expand Down
33 changes: 33 additions & 0 deletions framework/projects/Cli/compile-errors/test-13-16.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
diff --git a/src/test/org/apache/commons/cli2/jdepend/JDependTest.java b/src/test/org/apache/commons/cli2/jdepend/JDependTest.java
index f018642..1b3ff61 100644
--- a/src/test/org/apache/commons/cli2/jdepend/JDependTest.java
+++ b/src/test/org/apache/commons/cli2/jdepend/JDependTest.java
@@ -65,7 +65,7 @@ public class JDependTest extends TestCase {
final String message = pkg.getName() + " too far from line: " + distance;
assertTrue(
message,
- distance < 0.21d);
+ distance < 0.26d);
}
}

diff --git a/src/test/org/apache/commons/cli2/validation/ClassValidatorTest.java b/src/test/org/apache/commons/cli2/validation/ClassValidatorTest.java
index 707ef1e..a4fd007 100644
--- a/src/test/org/apache/commons/cli2/validation/ClassValidatorTest.java
+++ b/src/test/org/apache/commons/cli2/validation/ClassValidatorTest.java
@@ -222,8 +222,8 @@ public class ClassValidatorTest extends TestCase {
resources.getMessage(
"ClassValidator.class.access",
className,
- "Class org.apache.commons.cli2.validation.ClassValidator " +
- "can not access a member of class " +
+ "class org.apache.commons.cli2.validation.ClassValidator " +
+ "cannot access a member of class " +
"org.apache.commons.cli2.validation.protect.ProtectedClass " +
"with modifiers \"protected\""),
ive.getMessage());





33 changes: 33 additions & 0 deletions framework/projects/Cli/compile-errors/test-21-21.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
diff --git a/src/test/org/apache/commons/cli2/jdepend/JDependTest.java b/src/test/org/apache/commons/cli2/jdepend/JDependTest.java
index f018642..1b3ff61 100644
--- a/src/test/org/apache/commons/cli2/jdepend/JDependTest.java
+++ b/src/test/org/apache/commons/cli2/jdepend/JDependTest.java
@@ -65,7 +65,7 @@ public class JDependTest extends TestCase {
final String message = pkg.getName() + " too far from line: " + distance;
assertTrue(
message,
- distance < 0.21d);
+ distance < 0.26d);
}
}

diff --git a/src/test/org/apache/commons/cli2/validation/ClassValidatorTest.java b/src/test/org/apache/commons/cli2/validation/ClassValidatorTest.java
index 707ef1e..a4fd007 100644
--- a/src/test/org/apache/commons/cli2/validation/ClassValidatorTest.java
+++ b/src/test/org/apache/commons/cli2/validation/ClassValidatorTest.java
@@ -222,8 +222,8 @@ public class ClassValidatorTest extends TestCase {
resources.getMessage(
"ClassValidator.class.access",
className,
- "Class org.apache.commons.cli2.validation.ClassValidator " +
- "can not access a member of class " +
+ "class org.apache.commons.cli2.validation.ClassValidator " +
+ "cannot access a member of class " +
"org.apache.commons.cli2.validation.protect.ProtectedClass " +
"with modifiers \"protected\""),
ive.getMessage());





33 changes: 33 additions & 0 deletions framework/projects/Cli/compile-errors/test-7-7.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
diff --git a/src/test/org/apache/commons/cli2/jdepend/JDependTest.java b/src/test/org/apache/commons/cli2/jdepend/JDependTest.java
index f018642..1b3ff61 100644
--- a/src/test/org/apache/commons/cli2/jdepend/JDependTest.java
+++ b/src/test/org/apache/commons/cli2/jdepend/JDependTest.java
@@ -65,7 +65,7 @@ public class JDependTest extends TestCase {
final String message = pkg.getName() + " too far from line: " + distance;
assertTrue(
message,
- distance < 0.21d);
+ distance < 0.26d);
}
}

diff --git a/src/test/org/apache/commons/cli2/validation/ClassValidatorTest.java b/src/test/org/apache/commons/cli2/validation/ClassValidatorTest.java
index 707ef1e..a4fd007 100644
--- a/src/test/org/apache/commons/cli2/validation/ClassValidatorTest.java
+++ b/src/test/org/apache/commons/cli2/validation/ClassValidatorTest.java
@@ -222,8 +222,8 @@ public class ClassValidatorTest extends TestCase {
resources.getMessage(
"ClassValidator.class.access",
className,
- "Class org.apache.commons.cli2.validation.ClassValidator " +
- "can not access a member of class " +
+ "class org.apache.commons.cli2.validation.ClassValidator " +
+ "cannot access a member of class " +
"org.apache.commons.cli2.validation.protect.ProtectedClass " +
"with modifiers \"protected\""),
ive.getMessage());





This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
## jackson-databind: 18dc249e793b15e40e67753ea5e988bd428b1a92 ##
--- com.fasterxml.jackson.databind.deser.DateDeserializationTest::testDateUtilISO8601_DateTimeMillis
--- com.fasterxml.jackson.databind.deser.DateDeserializationTest::testDateUtilISO8601_DateTime
--- com.fasterxml.jackson.databind.BaseMapTest
junit.framework.AssertionFailedError: Class com.fasterxml.jackson.databind.BaseMapTest has no public constructor TestCase(String name) or TestCase()
at junit.framework.Assert.fail(Assert.java:57)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
## jackson-databind: 755e3bc0cbea30de0102f6a88519a0c34d571bbd ##
--- com.fasterxml.jackson.databind.deser.DateDeserializationTest::testDateUtilISO8601_DateTimeMillis
--- com.fasterxml.jackson.databind.deser.DateDeserializationTest::testDateUtilISO8601_DateTime
--- com.fasterxml.jackson.databind.BaseMapTest
junit.framework.AssertionFailedError: Class com.fasterxml.jackson.databind.BaseMapTest has no public constructor TestCase(String name) or TestCase()
at junit.framework.Assert.fail(Assert.java:57)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
## jackson-databind: a1404d5684783ccf28dc1b0a2791ce7c0c311907 ##
--- com.fasterxml.jackson.databind.deser.DateDeserializationTest::testDateUtilISO8601_DateTimeMillis
--- com.fasterxml.jackson.databind.deser.DateDeserializationTest::testDateUtilISO8601_DateTime
--- com.fasterxml.jackson.databind.BaseMapTest
junit.framework.AssertionFailedError: Class com.fasterxml.jackson.databind.BaseMapTest has no public constructor TestCase(String name) or TestCase()
at junit.framework.Assert.fail(Assert.java:57)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
## jackson-databind: bc91126c55dc513735a2a95ace4c00a6021c76f4 ##
--- com.fasterxml.jackson.databind.deser.DateDeserializationTest::testDateUtilISO8601_DateTimeMillis
--- com.fasterxml.jackson.databind.deser.DateDeserializationTest::testDateUtilISO8601_DateTime
--- com.fasterxml.jackson.databind.BaseMapTest
junit.framework.AssertionFailedError: Class com.fasterxml.jackson.databind.BaseMapTest has no public constructor TestCase(String name) or TestCase()
at junit.framework.Assert.fail(Assert.java:57)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
## jackson-databind: dfaca81ae7a82b7c3018f265815e98a5138118f7 ##
--- com.fasterxml.jackson.databind.deser.DateDeserializationTest::testDateUtilISO8601_DateTimeMillis
--- com.fasterxml.jackson.databind.deser.DateDeserializationTest::testDateUtilISO8601_DateTime
--- com.fasterxml.jackson.databind.BaseMapTest
junit.framework.AssertionFailedError: Class com.fasterxml.jackson.databind.BaseMapTest has no public constructor TestCase(String name) or TestCase()
at junit.framework.Assert.fail(Assert.java:57)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
## jackson-databind: f2c445d6d2de988531dcda25da81fda129bc53f2 ##
--- com.fasterxml.jackson.databind.deser.DateDeserializationTest::testDateUtilISO8601_DateTimeMillis
--- com.fasterxml.jackson.databind.deser.DateDeserializationTest::testDateUtilISO8601_DateTime
--- com.fasterxml.jackson.databind.BaseMapTest
junit.framework.AssertionFailedError: Class com.fasterxml.jackson.databind.BaseMapTest has no public constructor TestCase(String name) or TestCase()
at junit.framework.Assert.fail(Assert.java:57)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## jsoup: 65553582d184e18de10e496b0eaa53fbe206ba17 ##
--- org.jsoup.helper.W3CDomTest::simpleConversion

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## jsoup: a229d7354da5210a728ce5d43158d5cd780772db ##
--- org.jsoup.helper.W3CDomTest::simpleConversion

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## commons-lang: 8e2f4ddb9a1ecd7a1bf7d752c2c891d630287036 ##
--- org.apache.commons.lang3.time.FastDateFormatTest::testShortDateStyleWithLocales
--- org.apache.commons.lang3.builder.ToStringBuilderTest::testReflectionHierarchyArrayList
junit.framework.ComparisonFailure: expected:<...770e40[elementData={[<null>,<null>,<null>,<null>,<null>,<null>,<null>,<null>,<null>,<null>]},size=0,modCount=0]> but was:<...770e40[elementData={[]},size=0,modCount=0]>
at junit.framework.Assert.assertEquals(Assert.java:100)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
--- org.joda.time.format.TestDateTimeFormat::testFormatParse_textHalfdayAM_UK
--- org.joda.time.format.TestDateTimeFormat::testFormat_halfdayOfDay
--- org.joda.time.format.TestDateTimeFormat::testFormatParse_textEraBC_France
--- org.joda.time.TestDateTimeZone::testGetName_berlin
junit.framework.ComparisonFailure: expected:<[Central European Time]> but was:<[+01:00]>
at junit.framework.Assert.assertEquals(Assert.java:100)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
--- org.joda.time.format.TestDateTimeFormat::testFormatParse_textHalfdayAM_UK
--- org.joda.time.format.TestDateTimeFormat::testFormat_halfdayOfDay
--- org.joda.time.format.TestDateTimeFormat::testFormatParse_textEraBC_France
--- org.joda.time.TestDateTimeZone::testGetName_berlin
junit.framework.ComparisonFailure: expected:<[Central European Time]> but was:<[+01:00]>
at junit.framework.Assert.assertEquals(Assert.java:100)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
--- org.joda.time.format.TestDateTimeFormat::testFormatParse_textHalfdayAM_UK
--- org.joda.time.format.TestDateTimeFormat::testFormat_halfdayOfDay
--- org.joda.time.format.TestDateTimeFormat::testFormatParse_textEraBC_France
--- org.joda.time.TestDateTimeZone::testGetShortName
junit.framework.ComparisonFailure: expected:<[BST]> but was:<[+01:00]>
at junit.framework.Assert.assertEquals(Assert.java:100)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
--- org.joda.time.format.TestDateTimeFormat::testFormatParse_textHalfdayAM_UK
--- org.joda.time.format.TestDateTimeFormat::testFormat_halfdayOfDay
--- org.joda.time.format.TestDateTimeFormat::testFormatParse_textEraBC_France
--- org.joda.time.TestDateTimeZone::testGetName_berlin
junit.framework.ComparisonFailure: expected:<[Central European Time]> but was:<[+01:00]>
at junit.framework.Assert.assertEquals(Assert.java:100)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
--- org.joda.time.format.TestDateTimeFormat::testFormatParse_textHalfdayAM_UK
--- org.joda.time.format.TestDateTimeFormat::testFormat_halfdayOfDay
--- org.joda.time.format.TestDateTimeFormat::testFormatParse_textEraBC_France
--- org.joda.time.TestDateTimeZone::testGetName_berlin
junit.framework.ComparisonFailure: expected:<[Central European Time]> but was:<[+01:00]>
at junit.framework.Assert.assertEquals(Assert.java:100)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
--- org.joda.time.format.TestDateTimeFormat::testFormatParse_textHalfdayAM_UK
--- org.joda.time.format.TestDateTimeFormat::testFormat_halfdayOfDay
--- org.joda.time.format.TestDateTimeFormat::testFormatParse_textEraBC_France
--- org.joda.time.TestDateTimeZone::testGetName_berlin
junit.framework.ComparisonFailure: expected:<[Central European Time]> but was:<[+01:00]>
at junit.framework.Assert.assertEquals(Assert.java:100)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
--- org.joda.time.format.TestDateTimeFormat::testFormatParse_textHalfdayAM_UK
--- org.joda.time.format.TestDateTimeFormat::testFormat_halfdayOfDay
--- org.joda.time.format.TestDateTimeFormat::testFormatParse_textEraBC_France
--- org.joda.time.TestDateTimeZone::testGetName_berlin
junit.framework.ComparisonFailure: expected:<[Central European Time]> but was:<[+01:00]>
at junit.framework.Assert.assertEquals(Assert.java:100)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
--- org.joda.time.format.TestDateTimeFormat::testFormatParse_textHalfdayAM_UK
--- org.joda.time.format.TestDateTimeFormat::testFormat_halfdayOfDay
--- org.joda.time.format.TestDateTimeFormat::testFormatParse_textEraBC_France
--- org.joda.time.TestDateTimeZone::testGetShortName
junit.framework.ComparisonFailure: expected:<[BST]> but was:<[+01:00]>
at junit.framework.Assert.assertEquals(Assert.java:100)
Expand Down

0 comments on commit f450612

Please sign in to comment.