diff --git a/.ci/jsoref-spellchecker/whitelist.words b/.ci/jsoref-spellchecker/whitelist.words index 30db6bc66a85..bf7e6b7654a3 100644 --- a/.ci/jsoref-spellchecker/whitelist.words +++ b/.ci/jsoref-spellchecker/whitelist.words @@ -862,6 +862,7 @@ multiplevariabledeclarations Multiset multithreading mutableexception +mutationtest MVC mvn mvnw diff --git a/.ci/pitest-suppressions/pitest-ant-suppressions.xml b/.ci/pitest-suppressions/pitest-ant-suppressions.xml new file mode 100644 index 000000000000..957ae7eb7303 --- /dev/null +++ b/.ci/pitest-suppressions/pitest-ant-suppressions.xml @@ -0,0 +1,47 @@ + + + + CheckstyleAntTask.java + com.puppycrawl.tools.checkstyle.ant.CheckstyleAntTask + execute + org.pitest.mutationtest.engine.gregor.mutators.MathMutator + Replaced long subtraction with addition + log("Total execution took " + (endTime - startTime) + TIME_SUFFIX, + + + + CheckstyleAntTask.java + com.puppycrawl.tools.checkstyle.ant.CheckstyleAntTask + processFiles + org.pitest.mutationtest.engine.gregor.mutators.MathMutator + Replaced long subtraction with addition + log("To locate the files took " + (endTime - startTime) + TIME_SUFFIX, + + + + CheckstyleAntTask.java + com.puppycrawl.tools.checkstyle.ant.CheckstyleAntTask + processFiles + org.pitest.mutationtest.engine.gregor.mutators.MathMutator + Replaced long subtraction with addition + log("To process the files took " + (processingEndTime - processingStartTime) + + + + CheckstyleAntTask.java + com.puppycrawl.tools.checkstyle.ant.CheckstyleAntTask$Formatter + createDefaultLogger + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + if (toFile == null || !useFile) { + + + + CheckstyleAntTask.java + com.puppycrawl.tools.checkstyle.ant.CheckstyleAntTask$Formatter + createXmlLogger + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + if (toFile == null || !useFile) { + + diff --git a/.ci/pitest-suppressions/pitest-coding-1-suppressions.xml b/.ci/pitest-suppressions/pitest-coding-1-suppressions.xml new file mode 100644 index 000000000000..9731532160be --- /dev/null +++ b/.ci/pitest-suppressions/pitest-coding-1-suppressions.xml @@ -0,0 +1,137 @@ + + + + UnnecessaryParenthesesCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.UnnecessaryParenthesesCheck + isLambdaSingleParameterSurrounded + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + if (firstChild != null && firstChild.getType() == TokenTypes.LPAREN) { + + + + UnnecessaryParenthesesCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.UnnecessaryParenthesesCheck + leaveToken + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_ELSE + removed conditional - replaced equality check with false + if (type != TokenTypes.ASSIGN + + + + UnnecessaryParenthesesCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.UnnecessaryParenthesesCheck + leaveToken + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + || parent.getType() != TokenTypes.ANNOTATION_MEMBER_VALUE_PAIR) { + + + + UnnecessaryParenthesesCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.UnnecessaryParenthesesCheck + visitToken + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + else if (type != TokenTypes.ASSIGN + + + + UnnecessaryParenthesesCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.UnnecessaryParenthesesCheck + visitToken + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + if (type == TokenTypes.LAMBDA && isLambdaSingleParameterSurrounded(ast)) { + + + + VariableDeclarationUsageDistanceCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationUsageDistanceCheck + calculateDistanceInSingleScope + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + && currentAst.getType() != TokenTypes.RCURLY) { + + + + VariableDeclarationUsageDistanceCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationUsageDistanceCheck + calculateDistanceInSingleScope + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_ELSE + removed conditional - replaced equality check with false + if (!firstUsageFound) { + + + + VariableDeclarationUsageDistanceCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationUsageDistanceCheck + getFirstNodeInsideForWhileDoWhileBlocks + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_ELSE + removed conditional - replaced equality check with false + if (currentNodeType == TokenTypes.SLIST) { + + + + VariableDeclarationUsageDistanceCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationUsageDistanceCheck + getFirstNodeInsideIfBlock + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_ELSE + removed conditional - replaced equality check with false + else if (isChild(currentNode, variable)) { + + + + VariableDeclarationUsageDistanceCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationUsageDistanceCheck + getFirstNodeInsideIfBlock + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_ELSE + removed conditional - replaced equality check with false + if (currentNode.getType() == TokenTypes.LITERAL_IF) { + + + + VariableDeclarationUsageDistanceCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationUsageDistanceCheck + getFirstNodeInsideTryCatchFinallyBlocks + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + && currentNode.getType() == TokenTypes.LITERAL_CATCH) { + + + + VariableDeclarationUsageDistanceCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationUsageDistanceCheck + isChild + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + if (curNode.getType() == ast.getType() && curNode.getText().equals(ast.getText())) { + + + + VariableDeclarationUsageDistanceCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationUsageDistanceCheck + isInitializationSequence + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + while (result + + + + VariableDeclarationUsageDistanceCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationUsageDistanceCheck + isVariableInOperatorExpr + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + if (!isVarInOperatorDeclaration && operator.getType() == TokenTypes.LITERAL_IF) { + + + + VariableDeclarationUsageDistanceCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationUsageDistanceCheck + searchVariableUsageExpressions + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + && currentStatementAst.getType() != TokenTypes.RCURLY) { + + diff --git a/.ci/pitest-suppressions/pitest-coding-2-suppressions.xml b/.ci/pitest-suppressions/pitest-coding-2-suppressions.xml new file mode 100644 index 000000000000..c8965df7c273 --- /dev/null +++ b/.ci/pitest-suppressions/pitest-coding-2-suppressions.xml @@ -0,0 +1,182 @@ + + + + FinalLocalVariableCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck + findLastChildWhichContainsSpecifiedToken + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + if (astIterator.getType() == childType + + + + FinalLocalVariableCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck + isCaseTokenWithAnotherCaseFollowing + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + result = findLastChildWhichContainsSpecifiedToken( + + + + FinalLocalVariableCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck + isIfTokenWithAnElseFollowing + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + return ast.getType() == TokenTypes.LITERAL_IF + + + + FinalLocalVariableCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck + isInTheSameLoop + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + return loop1 != null && loop1 == loop2; + + + + FinalLocalVariableCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck + updateUninitializedVariables + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + && isSameVariables(storedVariable, variable) + + + + FinalLocalVariableCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck + visitToken + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + == ast.getParent()) { + + + + FinalLocalVariableCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck + visitToken + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + if (ast.getParent().getType() == TokenTypes.SWITCH_RULE + + + + HiddenFieldCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.HiddenFieldCheck + isIgnoredParamOfAbstractMethod + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + && ast.getType() == TokenTypes.PARAMETER_DEF) { + + + + HiddenFieldCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.HiddenFieldCheck + isIgnoredParamOfAbstractMethod + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + if (method.getType() == TokenTypes.METHOD_DEF) { + + + + HiddenFieldCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.HiddenFieldCheck + isIgnoredSetterParam + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + && methodAST.getType() == TokenTypes.METHOD_DEF + + + + HiddenFieldCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.HiddenFieldCheck + isIgnoredSetterParam + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + if (ignoreSetter && ast.getType() == TokenTypes.PARAMETER_DEF) { + + + + HiddenFieldCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.HiddenFieldCheck + processLambda + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + && firstChild.getType() == TokenTypes.IDENT) { + + + + HiddenFieldCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.HiddenFieldCheck + visitOtherTokens + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_ELSE + removed conditional - replaced equality check with false + if (type == TokenTypes.CLASS_DEF + + + + HiddenFieldCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.HiddenFieldCheck + visitOtherTokens + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + if (type == TokenTypes.CLASS_DEF + + + + IllegalInstantiationCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.IllegalInstantiationCheck + isStandardClass + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + && illegal.startsWith(JAVA_LANG)) { + + + + OneStatementPerLineCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck + checkIfSemicolonIsInDifferentLineThanPrevious + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_ELSE + removed conditional - replaced equality check with false + && currentStatement.getPreviousSibling().getType() == TokenTypes.RESOURCES; + + + + OneStatementPerLineCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck + checkIfSemicolonIsInDifferentLineThanPrevious + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_ELSE + removed conditional - replaced equality check with false + currentStatement.getPreviousSibling() != null + + + + OneStatementPerLineCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck + checkIfSemicolonIsInDifferentLineThanPrevious + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + if (!hasResourcesPrevSibling && isMultilineStatement(currentStatement)) { + + + + OneStatementPerLineCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck + isMultilineStatement + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + multiline = !TokenUtil.areOnSameLine(prevSibling, ast) + + + + OneStatementPerLineCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck + leaveToken + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + if (countOfSemiInLambda.isEmpty()) { + + diff --git a/.ci/pitest-suppressions/pitest-coding-require-this-check-suppressions.xml b/.ci/pitest-suppressions/pitest-coding-require-this-check-suppressions.xml new file mode 100644 index 000000000000..8fe93fa408a8 --- /dev/null +++ b/.ci/pitest-suppressions/pitest-coding-require-this-check-suppressions.xml @@ -0,0 +1,92 @@ + + + + RequireThisCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.RequireThisCheck + beginTree + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + if (toVisit == null) { + + + + RequireThisCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.RequireThisCheck + canBeReferencedFromStaticContext + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_ELSE + removed conditional - replaced equality check with false + if (definitionToken.getType() == TokenTypes.STATIC_INIT) { + + + + RequireThisCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.RequireThisCheck + canBeReferencedFromStaticContext + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + if (variableDeclarationFrame.getType() == FrameType.CLASS_FRAME) { + + + + RequireThisCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.RequireThisCheck + collectDeclarations + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + && ast.getParent().getType() != TokenTypes.LITERAL_CATCH) { + + + + RequireThisCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.RequireThisCheck + endCollectingDeclarations + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_ELSE + removed conditional - replaced equality check with false + if (isAnonymousClassDef(ast)) { + + + + RequireThisCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.RequireThisCheck + getCodeBlockDefinitionToken + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + && parent.getType() != TokenTypes.CTOR_DEF + + + + RequireThisCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.RequireThisCheck + isAnonymousClassDef + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + && lastChild.getType() == TokenTypes.OBJBLOCK; + + + + RequireThisCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.RequireThisCheck + isAstSimilar + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + return left.getType() == right.getType() && left.getText().equals(right.getText()); + + + + RequireThisCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.RequireThisCheck + isInsideConstructorFrame + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + if (fieldUsageFrame.getType() == FrameType.BLOCK_FRAME) { + + + + RequireThisCheck.java + com.puppycrawl.tools.checkstyle.checks.coding.RequireThisCheck + isOverlappingByLocalVariable + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + if (sibling != null && isAssignToken(parent.getType())) { + + diff --git a/.ci/pitest-suppressions/pitest-common-suppressions.xml b/.ci/pitest-suppressions/pitest-common-suppressions.xml new file mode 100644 index 000000000000..ce756547da64 --- /dev/null +++ b/.ci/pitest-suppressions/pitest-common-suppressions.xml @@ -0,0 +1,92 @@ + + + + Checker.java + com.puppycrawl.tools.checkstyle.Checker + processFiles + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_ELSE + removed conditional - replaced equality check with false + if (cacheFile != null && cacheFile.isInCache(fileName, timestamp) + + + + Checker.java + com.puppycrawl.tools.checkstyle.Checker + processFiles + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + if (cacheFile != null && cacheFile.isInCache(fileName, timestamp) + + + + DefaultLogger.java + com.puppycrawl.tools.checkstyle.DefaultLogger + <init> + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + closeError = errorStreamOptions == OutputStreamOptions.CLOSE; + + + + DefaultLogger.java + com.puppycrawl.tools.checkstyle.DefaultLogger + <init> + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + closeInfo = infoStreamOptions == OutputStreamOptions.CLOSE; + + + + DefaultLogger.java + com.puppycrawl.tools.checkstyle.DefaultLogger + addError + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + if (severityLevel != SeverityLevel.IGNORE) { + + + + DefaultLogger.java + com.puppycrawl.tools.checkstyle.DefaultLogger + closeStreams + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + if (closeError) { + + + + DefaultLogger.java + com.puppycrawl.tools.checkstyle.DefaultLogger + closeStreams + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + if (closeInfo) { + + + + PackageObjectFactory.java + com.puppycrawl.tools.checkstyle.PackageObjectFactory + createModule + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + if (!name.contains(PACKAGE_SEPARATOR)) { + + + + PackageObjectFactory.java + com.puppycrawl.tools.checkstyle.PackageObjectFactory + createModule + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + if (instance == null + + + + PackageObjectFactory.java + com.puppycrawl.tools.checkstyle.PackageObjectFactory + createModule + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + if (thirdPartyNameToFullModuleNames == null) { + + diff --git a/.ci/pitest-suppressions/pitest-header-suppressions.xml b/.ci/pitest-suppressions/pitest-header-suppressions.xml new file mode 100644 index 000000000000..ae022fbc8533 --- /dev/null +++ b/.ci/pitest-suppressions/pitest-header-suppressions.xml @@ -0,0 +1,19 @@ + + + + RegexpHeaderCheck.java + com.puppycrawl.tools.checkstyle.checks.header.RegexpHeaderCheck + processFiltered + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_ELSE + removed conditional - replaced equality check with false + isMatch = headerLineNo == headerSize + + + RegexpHeaderCheck.java + com.puppycrawl.tools.checkstyle.checks.header.RegexpHeaderCheck + processFiltered + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + || isMatch(line, headerLineNo); + + diff --git a/.ci/pitest-suppressions/pitest-imports-suppressions.xml b/.ci/pitest-suppressions/pitest-imports-suppressions.xml new file mode 100644 index 000000000000..10b4c5b738e3 --- /dev/null +++ b/.ci/pitest-suppressions/pitest-imports-suppressions.xml @@ -0,0 +1,47 @@ + + + + ImportControlLoader.java + com.puppycrawl.tools.checkstyle.checks.imports.ImportControlLoader + startElement + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_ELSE + removed conditional - replaced equality check with false + else if (ALLOW_ELEMENT_NAME.equals(qName) || "disallow".equals(qName)) { + + + + ImportControlLoader.java + com.puppycrawl.tools.checkstyle.checks.imports.ImportControlLoader + startElement + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + else if (ALLOW_ELEMENT_NAME.equals(qName) || "disallow".equals(qName)) { + + + + PkgImportControl.java + com.puppycrawl.tools.checkstyle.checks.imports.PkgImportControl + <init> + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_ELSE + removed conditional - replaced equality check with false + if (regex || parent.regex) { + + + + PkgImportControl.java + com.puppycrawl.tools.checkstyle.checks.imports.PkgImportControl + <init> + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF + removed conditional - replaced equality check with true + if (regex || parent.regex) { + + + + PkgImportControl.java + com.puppycrawl.tools.checkstyle.checks.imports.PkgImportControl + matchesExactly + org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_ELSE + removed conditional - replaced equality check with false + if (regex) { + + diff --git a/.ci/pitest-suppressions/pitest-indentation-suppressions.xml b/.ci/pitest-suppressions/pitest-indentation-suppressions.xml new file mode 100644 index 000000000000..6321ac8b8473 --- /dev/null +++ b/.ci/pitest-suppressions/pitest-indentation-suppressions.xml @@ -0,0 +1,227 @@ + + + + AbstractExpressionHandler.java + com.puppycrawl.tools.checkstyle.checks.indentation.AbstractExpressionHandler + findSubtreeAst + org.pitest.mutationtest.engine.gregor.mutators.ConditionalsBoundaryMutator + changed conditional boundary + if (colNum == null || thisLineColumn < colNum) { + + + + AbstractExpressionHandler.java + com.puppycrawl.tools.checkstyle.checks.indentation.AbstractExpressionHandler + getFirstAstNode + org.pitest.mutationtest.engine.gregor.mutators.ConditionalsBoundaryMutator + changed conditional boundary + && curNode.getColumnNo() < realStart.getColumnNo()) { + + + + AbstractExpressionHandler.java + com.puppycrawl.tools.checkstyle.checks.indentation.AbstractExpressionHandler + getFirstToken + org.pitest.mutationtest.engine.gregor.mutators.ConditionalsBoundaryMutator + changed conditional boundary + if (toTest.getColumnNo() < first.getColumnNo()) { + + + + BlockParentHandler.java + com.puppycrawl.tools.checkstyle.checks.indentation.BlockParentHandler + getLineWrappingIndent + org.pitest.mutationtest.engine.gregor.mutators.ReturnValsMutator + replaced return of integer sized value with (x == 0 ? 1 : 0) + return getIndentCheck().getLineWrappingIndentation(); + + + + CommentsIndentationCheck.java + com.puppycrawl.tools.checkstyle.checks.indentation.CommentsIndentationCheck + findPreviousStatement + org.pitest.mutationtest.engine.gregor.mutators.NegateConditionalsMutator + negated conditional + if (root.getFirstChild().getType() == TokenTypes.LITERAL_NEW) { + + + + CommentsIndentationCheck.java + com.puppycrawl.tools.checkstyle.checks.indentation.CommentsIndentationCheck + findPreviousStatement + org.pitest.mutationtest.engine.gregor.mutators.ConditionalsBoundaryMutator + changed conditional boundary + if (root.getLineNo() >= comment.getLineNo()) { + + + + CommentsIndentationCheck.java + com.puppycrawl.tools.checkstyle.checks.indentation.CommentsIndentationCheck + findTokenWhichBeginsTheLine + org.pitest.mutationtest.engine.gregor.mutators.NegateConditionalsMutator + negated conditional + if (isUsingOfObjectReferenceToInvokeMethod(root)) { + + + + CommentsIndentationCheck.java + com.puppycrawl.tools.checkstyle.checks.indentation.CommentsIndentationCheck + getPrevStatementWhenCommentIsUnderCase + org.pitest.mutationtest.engine.gregor.mutators.NegateConditionalsMutator + negated conditional + if (isUsingOfObjectReferenceToInvokeMethod(blockBody)) { + + + + CommentsIndentationCheck.java + com.puppycrawl.tools.checkstyle.checks.indentation.CommentsIndentationCheck + isUsingOfObjectReferenceToInvokeMethod + org.pitest.mutationtest.engine.gregor.mutators.NegateConditionalsMutator + negated conditional + && root.getFirstChild().getFirstChild().getFirstChild().getNextSibling() != null; + + + + CommentsIndentationCheck.java + com.puppycrawl.tools.checkstyle.checks.indentation.CommentsIndentationCheck + isUsingOfObjectReferenceToInvokeMethod + org.pitest.mutationtest.engine.gregor.mutators.ReturnValsMutator + replaced return of integer sized value with (x == 0 ? 1 : 0) + return root.getFirstChild().getFirstChild().getFirstChild() != null + + + + CommentsIndentationCheck.java + com.puppycrawl.tools.checkstyle.checks.indentation.CommentsIndentationCheck + isUsingOfObjectReferenceToInvokeMethod + org.pitest.mutationtest.engine.gregor.mutators.returns.BooleanTrueReturnValsMutator + replaced boolean return with true for com/puppycrawl/tools/checkstyle/checks/indentation/CommentsIndentationCheck::isUsingOfObjectReferenceToInvokeMethod + return root.getFirstChild().getFirstChild().getFirstChild() != null + + + + HandlerFactory.java + com.puppycrawl.tools.checkstyle.checks.indentation.HandlerFactory + <init> + org.pitest.mutationtest.engine.gregor.mutators.VoidMethodCallMutator + removed call to com/puppycrawl/tools/checkstyle/checks/indentation/HandlerFactory::register + register(TokenTypes.INDEX_OP, IndexHandler.class); + + + + HandlerFactory.java + com.puppycrawl.tools.checkstyle.checks.indentation.HandlerFactory + clearCreatedHandlers + org.pitest.mutationtest.engine.gregor.mutators.VoidMethodCallMutator + removed call to java/util/Map::clear + createdHandlers.clear(); + + + + IndentationCheck.java + com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck + beginTree + org.pitest.mutationtest.engine.gregor.mutators.VoidMethodCallMutator + removed call to com/puppycrawl/tools/checkstyle/checks/indentation/HandlerFactory::clearCreatedHandlers + handlerFactory.clearCreatedHandlers(); + + + + IndentationCheck.java + com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck + beginTree + org.pitest.mutationtest.engine.gregor.mutators.VoidMethodCallMutator + removed call to java/util/Deque::clear + handlers.clear(); + + + + IndentationCheck.java + com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck + beginTree + org.pitest.mutationtest.engine.gregor.mutators.VoidMethodCallMutator + removed call to com/puppycrawl/tools/checkstyle/checks/indentation/PrimordialHandler::checkIndentation + primordialHandler.checkIndentation(); + + + + MethodDefHandler.java + com.puppycrawl.tools.checkstyle.checks.indentation.MethodDefHandler + getMethodDefLineStart + org.pitest.mutationtest.engine.gregor.mutators.ConditionalsBoundaryMutator + changed conditional boundary + if (node.getLineNo() < lineStart) { + + + + NewHandler.java + com.puppycrawl.tools.checkstyle.checks.indentation.NewHandler + shouldIncreaseIndent + org.pitest.mutationtest.engine.gregor.mutators.ReturnValsMutator + replaced return of integer sized value with (x == 0 ? 1 : 0) + return false; + + + + NewHandler.java + com.puppycrawl.tools.checkstyle.checks.indentation.NewHandler + shouldIncreaseIndent + org.pitest.mutationtest.engine.gregor.mutators.returns.BooleanTrueReturnValsMutator + replaced boolean return with true for com/puppycrawl/tools/checkstyle/checks/indentation/NewHandler::shouldIncreaseIndent + return false; + + + + SwitchHandler.java + com.puppycrawl.tools.checkstyle.checks.indentation.SwitchHandler + checkIndentation + org.pitest.mutationtest.engine.gregor.mutators.VoidMethodCallMutator + removed call to com/puppycrawl/tools/checkstyle/checks/indentation/SwitchHandler::checkSwitchExpr + checkSwitchExpr(); + + + + SwitchHandler.java + com.puppycrawl.tools.checkstyle.checks.indentation.SwitchHandler + checkSwitchExpr + org.pitest.mutationtest.engine.gregor.mutators.VoidMethodCallMutator + removed call to com/puppycrawl/tools/checkstyle/checks/indentation/SwitchHandler::checkExpressionSubtree + checkExpressionSubtree( + + + + SynchronizedHandler.java + com.puppycrawl.tools.checkstyle.checks.indentation.SynchronizedHandler + checkIndentation + org.pitest.mutationtest.engine.gregor.mutators.VoidMethodCallMutator + removed call to com/puppycrawl/tools/checkstyle/checks/indentation/SynchronizedHandler::checkSynchronizedExpr + checkSynchronizedExpr(); + + + + SynchronizedHandler.java + com.puppycrawl.tools.checkstyle.checks.indentation.SynchronizedHandler + checkIndentation + org.pitest.mutationtest.engine.gregor.mutators.VoidMethodCallMutator + removed call to com/puppycrawl/tools/checkstyle/checks/indentation/SynchronizedHandler::checkWrappingIndentation + checkWrappingIndentation(getMainAst(), + + + + SynchronizedHandler.java + com.puppycrawl.tools.checkstyle.checks.indentation.SynchronizedHandler + checkSynchronizedExpr + org.pitest.mutationtest.engine.gregor.mutators.VoidMethodCallMutator + removed call to com/puppycrawl/tools/checkstyle/checks/indentation/SynchronizedHandler::checkExpressionSubtree + checkExpressionSubtree(syncAst, expected, false, false); + + + + TryHandler.java + com.puppycrawl.tools.checkstyle.checks.indentation.TryHandler + checkIndentation + org.pitest.mutationtest.engine.gregor.mutators.VoidMethodCallMutator + removed call to com/puppycrawl/tools/checkstyle/checks/indentation/TryHandler::checkTryResParen + checkTryResParen(getTryResLparen(), "lparen"); + + diff --git a/.ci/pitest-suppressions/pitest-javadoc-suppressions.xml b/.ci/pitest-suppressions/pitest-javadoc-suppressions.xml new file mode 100644 index 000000000000..cf7aa494c9ef --- /dev/null +++ b/.ci/pitest-suppressions/pitest-javadoc-suppressions.xml @@ -0,0 +1,29 @@ + + + + AbstractJavadocCheck.java + com.puppycrawl.tools.checkstyle.checks.javadoc.AbstractJavadocCheck + processTree + org.pitest.mutationtest.engine.gregor.mutators.VoidMethodCallMutator + removed call to com/puppycrawl/tools/checkstyle/checks/javadoc/AbstractJavadocCheck::beginJavadocTree + beginJavadocTree(root); + + + + AbstractJavadocCheck.java + com.puppycrawl.tools.checkstyle.checks.javadoc.AbstractJavadocCheck + processTree + org.pitest.mutationtest.engine.gregor.mutators.VoidMethodCallMutator + removed call to com/puppycrawl/tools/checkstyle/checks/javadoc/AbstractJavadocCheck::finishJavadocTree + finishJavadocTree(root); + + + + TagParser.java + com.puppycrawl.tools.checkstyle.checks.javadoc.TagParser + getNextCharPos + org.pitest.mutationtest.engine.gregor.mutators.NegateConditionalsMutator + negated conditional + while (column < currentLineLength + + diff --git a/.ci/pitest.groovy b/.ci/pitest.groovy new file mode 100644 index 000000000000..9335035e4a87 --- /dev/null +++ b/.ci/pitest.groovy @@ -0,0 +1,302 @@ +import groovy.io.FileType +import groovy.transform.Field +import groovy.xml.XmlParser +import groovy.xml.XmlUtil + +@Field final static String SEPARATOR = System.getProperty("file.separator") + +@Field final static Set PROFILES = new HashSet<>(Arrays.asList( + "pitest-annotation", "pitest-design", "pitest-metrics", + "pitest-modifier", "pitest-naming", "pitest-sizes", + "pitest-whitespace", "pitest-api", "pitest-blocks", + "pitest-packagenamesloader", "pitest-common-2", "pitest-misc", + "pitest-xpath", "pitest-filters", "pitest-regexp", + "pitest-meta", "pitest-tree-walker", "pitest-utils", + "pitest-java-ast-visitor", "pitest-main", "pitest-header", + "pitest-imports", "pitest-common", "pitest-ant", "pitest-indentation", + "pitest-javadoc", "pitest-coding-1", "pitest-coding-2", + "pitest-coding-require-this-check" +)) + +System.exit(parseArgumentAndExecute(args[0])) + +private int parseArgumentAndExecute(String argument) { + + int exitCode = 0 + if (PROFILES.contains(argument)) { + generatePitestReport(argument) + exitCode = checkPitestReport(argument) + } + else if (argument == "--list") { + println "Supported profiles:" + PROFILES.each { println it } + } + else { + GString exceptionMessage = """ +Unexpected argument: ${argument} +Usage ./.ci/pitest.sh +To see the full list of supported profiles run './.ci/pitest.sh --list' +""" + throw new IllegalArgumentException(exceptionMessage) + } + return exitCode +} + +private static void generatePitestReport(String argument) { + String mavenCommand = 'mvn --no-transfer-progress -e -P"' + + argument + '" clean test-compile org.pitest:pitest-maven:mutationCoverage' + Process proc = mavenCommand.execute() + proc.in.eachLine { println it } +} + +private static int checkPitestReport(String profile) { + final XmlParser xmlParser = new XmlParser() + File mutationReportFile = null + final String suppressedMutationFileUri = + ".${SEPARATOR}.ci${SEPARATOR}pitest-suppressions${SEPARATOR}${profile}-suppressions.xml" + new File(".${SEPARATOR}target${SEPARATOR}pit-reports") + .eachFileRecurse(FileType.FILES) { + if (it.name == 'mutations.xml') { + mutationReportFile = it + } + } + Node mutationReportNode = xmlParser.parse(mutationReportFile) + Set survivedMutations = getSurvivedMutationsList(mutationReportNode) + + File suppressionFile = new File(suppressedMutationFileUri) + Set suppressedMutations = Collections. emptySet() + if (suppressionFile.exists()) { + Node suppressedMutationNode = xmlParser.parse(suppressedMutationFileUri) + suppressedMutations = getSuppressedMutationList(suppressedMutationNode) + } + return compareSurvivedAndSuppressedMutations(survivedMutations, suppressedMutations) +} + +private static Set getSurvivedMutationsList(Node mainNode) { + + def children = mainNode.children() + Set survivedMutations = new TreeSet<>() + + children.each { node -> + + Node mutationNode = node as Node + + String mutationStatus = mutationNode.attribute("status") + + if (mutationStatus == "SURVIVED") { + survivedMutations.add(getMutation(mutationNode)) + } + } + return survivedMutations +} + +private static Set getSuppressedMutationList(Node mainNode) { + def children = mainNode.children() + Set suppressedMutations = new TreeSet<>() + + children.each { node -> + Node mutationNode = node as Node + suppressedMutations.add(getMutation(mutationNode)) + } + return suppressedMutations +} + +private static Mutation getMutation(Node mutationNode) { + List childNodes = mutationNode.children() + + String sourceFile = null + String mutatedClass = null + String mutatedMethod = null + String mutator = null + String lineContent = null + String description = null + String mutationClassPackage = null + int lineNumber = 0 + childNodes.each { + Node childNode = it as Node + String text = childNode.name() + + String childNodeText = XmlUtil.escapeXml(childNode.text()) + switch (text) { + case "sourceFile": + sourceFile = childNodeText + break + case "mutatedClass": + mutatedClass = childNodeText + mutationClassPackage = mutatedClass.split("[A-Z]")[0] + break + case "mutatedMethod": + mutatedMethod = childNodeText + break + case "mutator": + mutator = childNodeText + break + case "description": + description = childNodeText + break + case "lineNumber": + lineNumber = Integer.parseInt(childNodeText) + break + case "lineContent": + lineContent = childNodeText + break + } + } + if (lineContent == null) { + String mutationFileName = mutationClassPackage + sourceFile + String startingPath = ".${SEPARATOR}src${SEPARATOR}main${SEPARATOR}java${SEPARATOR}" + String javaExtension = ".java" + mutationFileName = startingPath + mutationFileName + .substring(0, mutationFileName.length() - javaExtension.length()) + .replaceAll("\\.", SEPARATOR) + javaExtension + + File file = new File(mutationFileName) + lineContent = XmlUtil.escapeXml(file.readLines().get(lineNumber - 1).trim()) + } + if (lineNumber == 0) { + lineNumber = -1 + } + return new Mutation(sourceFile, mutatedClass, mutatedMethod, mutator, description, + lineContent, lineNumber) +} + +private static int compareSurvivedAndSuppressedMutations(Set survivedMutations, + Set suppressedMutations) { + + int exitCode = 0 + if (survivedMutations != suppressedMutations) { + Set survivedAndUnsuppressedMutations = + differenceBetweenSets(survivedMutations, suppressedMutations) + if (!survivedAndUnsuppressedMutations.isEmpty()) { + exitCode = 1 + println "Surviving mutation/s found:" + survivedAndUnsuppressedMutations.each { println it } + } + Set killedAndSuppressedMutations = + differenceBetweenSets(suppressedMutations, survivedMutations) + if (!killedAndSuppressedMutations.isEmpty()) { + exitCode = 1 + println "\nUnnecessary suppressed mutations/s found:" + killedAndSuppressedMutations.each { println it } + } + } + return exitCode +} + +private static Set differenceBetweenSets(final Set setOne, + final Set setTwo) { + Set result = new HashSet(setOne) + result.removeIf(mutation -> setTwo.contains(mutation)) + return result +} + +record Mutation(String sourceFile, String mutatedClass, + String mutatedMethod, String mutator, + String description, String lineContent, int lineNumber) + implements Comparable { + + private static final int LINE_NUMBER_NOT_PRESENT_VALUE = -1 + + boolean equals(o) { + if (this.is(o)) { + return true + } + if (!(o in Mutation)) { + return false + } + + Mutation mutation = (Mutation) o + + if (lineNumber() != LINE_NUMBER_NOT_PRESENT_VALUE + && mutation.lineNumber() != LINE_NUMBER_NOT_PRESENT_VALUE) { + if (lineNumber() != mutation.lineNumber()) { + return false + } + } + if (description() != mutation.description()) { + return false + } + if (lineContent() != mutation.lineContent()) { + return false + } + if (mutatedClass() != mutation.mutatedClass()) { + return false + } + if (mutatedMethod() != mutation.mutatedMethod()) { + return false + } + if (mutator() != mutation.mutator()) { + return false + } + + return sourceFile() == mutation.sourceFile() + } + + int hashCode() { + int result + result = sourceFile.hashCode() + int hashCodeMultiplier = 31 + result = hashCodeMultiplier * result + mutatedClass.hashCode() + result = hashCodeMultiplier * result + mutatedMethod.hashCode() + result = hashCodeMultiplier * result + mutator.hashCode() + result = hashCodeMultiplier * result + description.hashCode() + result = hashCodeMultiplier * result + lineContent.hashCode() + result = hashCodeMultiplier * result + lineNumber + return result + } + + @Override + String toString() { + String toString = """ +Source File: "${sourceFile()}" +Class: "${mutatedClass()}" +Method: "${mutatedMethod()}" +Line Contents: "${lineContent()}" +Mutator: "${mutator()}" +Description: "${description()}" +""" + if (lineNumber() != LINE_NUMBER_NOT_PRESENT_VALUE) { + toString += 'Line Number: ' + lineNumber() + } + return toString + } + + @Override + int compareTo(Mutation other) { + int i = sourceFile() <=> other.sourceFile() + if (i != 0) { + return i + } + + i = mutatedClass() <=> other.mutatedClass() + if (i != 0) { + return i + } + + i = mutatedMethod() <=> other.mutatedMethod() + if (i != 0) { + return i + } + + i = lineContent() <=> other.lineContent() + if (i != 0) { + return i + } + + i = mutator() <=> other.mutator() + if (i != 0) { + return i + } + + if (lineNumber() != LINE_NUMBER_NOT_PRESENT_VALUE + && other.lineNumber() != LINE_NUMBER_NOT_PRESENT_VALUE) { + i = lineNumber() <=> other.lineNumber() + if (i != 0) { + return i + } + } + + return description() <=> other.description() + } + +} diff --git a/.ci/pitest.sh b/.ci/pitest.sh deleted file mode 100755 index 41c086adb4ed..000000000000 --- a/.ci/pitest.sh +++ /dev/null @@ -1,245 +0,0 @@ -#!/bin/bash -# Attention, there is no "-x" to avoid problems on CircleCI -set -e - -############################### -function checkPitestReport() { - local -n ignored=$1 - fail=0 - SEARCH_REGEXP="(span class='survived'|class='uncovered'>
)"
-  grep -irE "$SEARCH_REGEXP" target/pit-reports \
-     | sed -E 's/.*\/([A-Za-z]+.java.html)/\1/' | LC_ALL=C sort > target/actual.txt
-  printf "%s\n" "${ignored[@]}" | sed '/^$/d' | LC_ALL=C sort > target/ignored.txt
-  if [ -n "$2" ] ; then
-      local -n unstableMutations=$2
-      printf "%s\n" "${unstableMutations[@]}" | sed '/^$/d' | LC_ALL=C sort > target/unstable.txt
-      if grep -Fxf target/unstable.txt target/actual.txt > target/unstableMatching.txt ; then
-          echo "Following unstable mutations were encountered:"
-          cat target/unstableMatching.txt
-          grep -xvFf target/unstableMatching.txt target/actual.txt > target/tempActual.txt
-          cat target/tempActual.txt > target/actual.txt
-      fi;
-  fi;
-  if [ "$(diff --unified -w target/ignored.txt target/actual.txt)" != "" ] ; then
-      fail=1
-      echo "Actual:" ;
-      grep -irE "$SEARCH_REGEXP" target/pit-reports \
-         | sed -E 's/.*\/([A-Za-z]+.java.html)/\1/' | sort
-      echo "Ignore:" ;
-      printf '%s\n' "${ignored[@]}"
-      echo "Diff:"
-      diff --unified -w target/ignored.txt target/actual.txt | cat
-  fi;
-  if [ "$fail" -ne "0" ]; then
-    echo "Difference between 'Actual' and 'Ignore' lists is detected, lists should be equal."
-    echo "build will be failed."
-  fi
-  sleep 5s
-  exit $fail
-}
-###############################
-
-case $1 in
-
-pitest-annotation|pitest-design \
-|pitest-metrics|pitest-modifier|pitest-naming \
-|pitest-sizes|pitest-whitespace \
-|pitest-api|pitest-blocks \
-|pitest-packagenamesloader \
-|pitest-common-2|pitest-misc|pitest-xpath \
-|pitest-filters \
-|pitest-regexp \
-|pitest-meta \
-|pitest-tree-walker \
-|pitest-utils \
-|pitest-java-ast-visitor)
-  mvn -e --no-transfer-progress -P"$1" clean test-compile org.pitest:pitest-maven:mutationCoverage;
-  declare -a ignoredItems=();
-  checkPitestReport ignoredItems
-  ;;
-
-pitest-main)
-  mvn -e --no-transfer-progress -P"$1" clean test-compile org.pitest:pitest-maven:mutationCoverage;
-  declare -a ignoredItems=(
-  "Main.java.html:
        }
" - ); - checkPitestReport ignoredItems - ;; - -pitest-header) - mvn -e --no-transfer-progress -P"$1" clean test-compile org.pitest:pitest-maven:mutationCoverage; - declare -a ignoredItems=( - "RegexpHeaderCheck.java.html:
                    isMatch = headerLineNo == headerSize
" - "RegexpHeaderCheck.java.html:
                            || isMatch(line, headerLineNo);
" - ); - checkPitestReport ignoredItems - ;; - -pitest-imports) - mvn -e --no-transfer-progress -P"$1" clean test-compile org.pitest:pitest-maven:mutationCoverage; - declare -a ignoredItems=( - "ImportControlLoader.java.html:
        else if (ALLOW_ELEMENT_NAME.equals(qName) || "disallow".equals(qName)) {
" - "PkgImportControl.java.html:
        if (regex || parent.regex) {
" - "PkgImportControl.java.html:
        if (regex) {
" - ); - checkPitestReport ignoredItems - ;; - -pitest-common) - mvn -e --no-transfer-progress -P"$1" clean test-compile org.pitest:pitest-maven:mutationCoverage; - declare -a ignoredItems=( - "Checker.java.html:
                if (cacheFile != null && cacheFile.isInCache(fileName, timestamp)
" - "DefaultLogger.java.html:
        closeError = errorStreamOptions == OutputStreamOptions.CLOSE;
" - "DefaultLogger.java.html:
        closeInfo = infoStreamOptions == OutputStreamOptions.CLOSE;
" - "DefaultLogger.java.html:
        if (closeError) {
" - "DefaultLogger.java.html:
        if (closeInfo) {
" - "DefaultLogger.java.html:
        if (severityLevel != SeverityLevel.IGNORE) {
" - "PackageObjectFactory.java.html:
        if (instance == null
" - "PackageObjectFactory.java.html:
        if (!name.contains(PACKAGE_SEPARATOR)) {
" - "PackageObjectFactory.java.html:
                if (thirdPartyNameToFullModuleNames == null) {
" - ); - checkPitestReport ignoredItems - ;; - - -pitest-ant) - mvn -e --no-transfer-progress -P"$1" clean test-compile org.pitest:pitest-maven:mutationCoverage; - declare -a ignoredItems=( - "CheckstyleAntTask.java.html:
            if (toFile == null || !useFile) {
" - "CheckstyleAntTask.java.html:
            if (toFile == null || !useFile) {
" - "CheckstyleAntTask.java.html:
            log("To process the files took " + (processingEndTime - processingStartTime)
" - "CheckstyleAntTask.java.html:
            log("Total execution took " + (endTime - startTime) + TIME_SUFFIX,
" - "CheckstyleAntTask.java.html:
        log("To locate the files took " + (endTime - startTime) + TIME_SUFFIX,
" - ); - checkPitestReport ignoredItems - ;; - -pitest-indentation) - mvn -e --no-transfer-progress -P"$1" clean test-compile org.pitest:pitest-maven:mutationCoverage; - declare -a ignoredItems=( - "AbstractExpressionHandler.java.html:
                    && curNode.getColumnNo() < realStart.getColumnNo()) {
" - "AbstractExpressionHandler.java.html:
            if (colNum == null || thisLineColumn < colNum) {
" - "AbstractExpressionHandler.java.html:
            if (toTest.getColumnNo() < first.getColumnNo()) {
" - "BlockParentHandler.java.html:
        return getIndentCheck().getLineWrappingIndentation();
" - "CommentsIndentationCheck.java.html:
            && root.getFirstChild().getFirstChild().getFirstChild().getNextSibling() != null;
" - "CommentsIndentationCheck.java.html:
                if (isUsingOfObjectReferenceToInvokeMethod(blockBody)) {
" - "CommentsIndentationCheck.java.html:
        if (isUsingOfObjectReferenceToInvokeMethod(root)) {
" - "CommentsIndentationCheck.java.html:
            if (root.getFirstChild().getType() == TokenTypes.LITERAL_NEW) {
" - "CommentsIndentationCheck.java.html:
        if (root.getLineNo() >= comment.getLineNo()) {
" - "CommentsIndentationCheck.java.html:
        return root.getFirstChild().getFirstChild().getFirstChild() != null
" - "HandlerFactory.java.html:
        createdHandlers.clear();
" - "HandlerFactory.java.html:
        register(TokenTypes.INDEX_OP, IndexHandler.class);
" - "IndentationCheck.java.html:
        handlerFactory.clearCreatedHandlers();
" - "IndentationCheck.java.html:
        handlers.clear();
" - "IndentationCheck.java.html:
        primordialHandler.checkIndentation();
" - "MethodDefHandler.java.html:
            if (node.getLineNo() < lineStart) {
" - "NewHandler.java.html:
        return false;
" - "SwitchHandler.java.html:
        checkExpressionSubtree(
" - "SwitchHandler.java.html:
        checkSwitchExpr();
" - "SynchronizedHandler.java.html:
        checkExpressionSubtree(syncAst, expected, false, false);
" - "SynchronizedHandler.java.html:
            checkSynchronizedExpr();
" - "SynchronizedHandler.java.html:
            checkWrappingIndentation(getMainAst(),
" - "TryHandler.java.html:
            checkTryResParen(getTryResLparen(), "lparen");
" - ); - checkPitestReport ignoredItems - ;; - -pitest-javadoc) - mvn -e --no-transfer-progress -P"$1" clean test-compile org.pitest:pitest-maven:mutationCoverage; - declare -a ignoredItems=( - "AbstractJavadocCheck.java.html:
        beginJavadocTree(root);
" - "AbstractJavadocCheck.java.html:
        finishJavadocTree(root);
" - "TagParser.java.html:
                while (column < currentLineLength
" - ); - checkPitestReport ignoredItems - ;; - -pitest-coding-1) - mvn -e --no-transfer-progress -P"$1" clean test-compile org.pitest:pitest-maven:mutationCoverage; - declare -a ignoredItems=( - "UnnecessaryParenthesesCheck.java.html:
            || parent.getType() != TokenTypes.ANNOTATION_MEMBER_VALUE_PAIR) {
" - "UnnecessaryParenthesesCheck.java.html:
        else if (type != TokenTypes.ASSIGN
" - "UnnecessaryParenthesesCheck.java.html:
        if (firstChild != null && firstChild.getType() == TokenTypes.LPAREN) {
" - "UnnecessaryParenthesesCheck.java.html:
        if (type != TokenTypes.ASSIGN
" - "UnnecessaryParenthesesCheck.java.html:
        if (type == TokenTypes.LAMBDA && isLambdaSingleParameterSurrounded(ast)) {
" - "VariableDeclarationUsageDistanceCheck.java.html:
                && currentAst.getType() != TokenTypes.RCURLY) {
" - "VariableDeclarationUsageDistanceCheck.java.html:
                && currentNode.getType() == TokenTypes.LITERAL_CATCH) {
" - "VariableDeclarationUsageDistanceCheck.java.html:
                && currentStatementAst.getType() != TokenTypes.RCURLY) {
" - "VariableDeclarationUsageDistanceCheck.java.html:
                else if (isChild(currentNode, variable)) {
" - "VariableDeclarationUsageDistanceCheck.java.html:
                if (currentNode.getType() == TokenTypes.LITERAL_IF) {
" - "VariableDeclarationUsageDistanceCheck.java.html:
            if (curNode.getType() == ast.getType() && curNode.getText().equals(ast.getText())) {
" - "VariableDeclarationUsageDistanceCheck.java.html:
            if (currentNodeType == TokenTypes.SLIST) {
" - "VariableDeclarationUsageDistanceCheck.java.html:
        if (!firstUsageFound) {
" - "VariableDeclarationUsageDistanceCheck.java.html:
        if (!isVarInOperatorDeclaration && operator.getType() == TokenTypes.LITERAL_IF) {
" - "VariableDeclarationUsageDistanceCheck.java.html:
        while (result
" - ); - checkPitestReport ignoredItems - ;; - -pitest-coding-2) - mvn -e --no-transfer-progress -P"$1" clean test-compile org.pitest:pitest-maven:mutationCoverage; - declare -a ignoredItems=( - "FinalLocalVariableCheck.java.html:
                            && isSameVariables(storedVariable, variable)
" - "FinalLocalVariableCheck.java.html:
                        == ast.getParent()) {
" - "FinalLocalVariableCheck.java.html:
                if (ast.getParent().getType() == TokenTypes.SWITCH_RULE
" - "FinalLocalVariableCheck.java.html:
            if (astIterator.getType() == childType
" - "FinalLocalVariableCheck.java.html:
            result = findLastChildWhichContainsSpecifiedToken(
" - "FinalLocalVariableCheck.java.html:
        return ast.getType() == TokenTypes.LITERAL_IF
" - "FinalLocalVariableCheck.java.html:
        return loop1 != null && loop1 == loop2;
" - "HiddenFieldCheck.java.html:
                && ast.getType() == TokenTypes.PARAMETER_DEF) {
" - "HiddenFieldCheck.java.html:
                && firstChild.getType() == TokenTypes.IDENT) {
" - "HiddenFieldCheck.java.html:
                && methodAST.getType() == TokenTypes.METHOD_DEF
" - "HiddenFieldCheck.java.html:
            if (method.getType() == TokenTypes.METHOD_DEF) {
" - "HiddenFieldCheck.java.html:
        if (ignoreSetter && ast.getType() == TokenTypes.PARAMETER_DEF) {
" - "HiddenFieldCheck.java.html:
        if (type == TokenTypes.CLASS_DEF
" - "IllegalInstantiationCheck.java.html:
            && illegal.startsWith(JAVA_LANG)) {
" - "OneStatementPerLineCheck.java.html:
                        && currentStatement.getPreviousSibling().getType() == TokenTypes.RESOURCES;
" - "OneStatementPerLineCheck.java.html:
                currentStatement.getPreviousSibling() != null
" - "OneStatementPerLineCheck.java.html:
                if (countOfSemiInLambda.isEmpty()) {
" - "OneStatementPerLineCheck.java.html:
            multiline = !TokenUtil.areOnSameLine(prevSibling, ast)
" - "OneStatementPerLineCheck.java.html:
        if (!hasResourcesPrevSibling && isMultilineStatement(currentStatement)) {
" - ); - checkPitestReport ignoredItems - ;; - -pitest-coding-require-this-check) - mvn -e --no-transfer-progress -P"$1" clean test-compile org.pitest:pitest-maven:mutationCoverage; - declare -a ignoredItems=( - "RequireThisCheck.java.html:
                        && ast.getParent().getType() != TokenTypes.LITERAL_CATCH) {
" - "RequireThisCheck.java.html:
                if (isAnonymousClassDef(ast)) {
" - "RequireThisCheck.java.html:
                if (toVisit == null) {
" - "RequireThisCheck.java.html:
               && parent.getType() != TokenTypes.CTOR_DEF
" - "RequireThisCheck.java.html:
            && lastChild.getType() == TokenTypes.OBJBLOCK;
" - "RequireThisCheck.java.html:
            if (definitionToken.getType() == TokenTypes.STATIC_INIT) {
" - "RequireThisCheck.java.html:
            if (variableDeclarationFrame.getType() == FrameType.CLASS_FRAME) {
" - "RequireThisCheck.java.html:
        if (fieldUsageFrame.getType() == FrameType.BLOCK_FRAME) {
" - "RequireThisCheck.java.html:
        if (sibling != null && isAssignToken(parent.getType())) {
" - "RequireThisCheck.java.html:
        return left.getType() == right.getType() && left.getText().equals(right.getText());
" - ); - checkPitestReport ignoredItems - ;; - -# pitesttyle-gui) -# mvn -e -P$1 clean test-compile org.pitest:pitest-maven:mutationCoverage; -# # post validation is skipped, we do not test gui throughly -# ;; - ---list) - echo "Supported profiles:" - pomXmlPath="$(dirname "${0}")/../pom.xml" - sed -n -e 's/^.*\(pitest-[^<]\+\)<\/id>.*$/\1/p' < "${pomXmlPath}" | sort - ;; - -*) - if [[ -n "$1" ]]; then - echo "Unexpected argument: $*" - fi - echo "Usage $0 " - echo "To see the full list of supported profiles run '$0 --list'" - sleep 5s - false - ;; - -esac - - diff --git a/.github/workflows/pitest.yml b/.github/workflows/pitest.yml index f41f83722bc8..ef80e7e64e3e 100644 --- a/.github/workflows/pitest.yml +++ b/.github/workflows/pitest.yml @@ -7,706 +7,68 @@ on: pull_request: jobs: - pitest-annotation: - runs-on: ubuntu-latest - steps: - - name: Setup local maven cache - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: checkstyle-maven-cache-${{ hashFiles('**/pom.xml') }} - - name: Checkout - uses: actions/checkout@v2 - - name: pitest-annotation - run: | - ./.ci/pitest.sh pitest-annotation - - name: Stage results - if: failure() || github.ref == 'refs/heads/master' - run: | - mkdir staging && cp -r target/pit-reports/ staging - - name: Archive code coverage results - if: failure() || github.ref == 'refs/heads/master' - uses: actions/upload-artifact@v2 - with: - name: pitest-annotation-coverage-report - path: staging - retention-days: 7 - - pitest-ant: - runs-on: ubuntu-latest - steps: - - name: Setup local maven cache - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: checkstyle-maven-cache-${{ hashFiles('**/pom.xml') }} - - name: Checkout - uses: actions/checkout@v2 - - name: pitest-ant - run: | - ./.ci/pitest.sh pitest-ant - - name: Stage results - if: failure() || github.ref == 'refs/heads/master' - run: | - mkdir staging && cp -r target/pit-reports/ staging - - name: Archive code coverage results - if: failure() || github.ref == 'refs/heads/master' - uses: actions/upload-artifact@v2 - with: - name: pitest-ant-coverage-report - path: staging - retention-days: 7 - - pitest-api: - runs-on: ubuntu-latest - steps: - - name: Setup local maven cache - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: checkstyle-maven-cache-${{ hashFiles('**/pom.xml') }} - - name: Checkout - uses: actions/checkout@v2 - - name: pitest-api - run: | - ./.ci/pitest.sh pitest-api - - name: Stage results - if: failure() || github.ref == 'refs/heads/master' - run: | - mkdir staging && cp -r target/pit-reports/ staging - - name: Archive code coverage results - if: failure() || github.ref == 'refs/heads/master' - uses: actions/upload-artifact@v2 - with: - name: pitest-api-coverage-report - path: staging - retention-days: 7 - - pitest-blocks: - runs-on: ubuntu-latest - steps: - - name: Setup local maven cache - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: checkstyle-maven-cache-${{ hashFiles('**/pom.xml') }} - - name: Checkout - uses: actions/checkout@v2 - - name: pitest-blocks - run: | - ./.ci/pitest.sh pitest-blocks - - name: Stage results - if: failure() || github.ref == 'refs/heads/master' - run: | - mkdir staging && cp -r target/pit-reports/ staging - - name: Archive code coverage results - if: failure() || github.ref == 'refs/heads/master' - uses: actions/upload-artifact@v2 - with: - name: pitest-blocks-coverage-report - path: staging - retention-days: 7 - - pitest-coding-1: - runs-on: ubuntu-latest - steps: - - name: Setup local maven cache - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: checkstyle-maven-cache-${{ hashFiles('**/pom.xml') }} - - name: Checkout - uses: actions/checkout@v2 - - name: pitest-Coding-1 - run: | - ./.ci/pitest.sh pitest-coding-1 - - name: Stage results - if: failure() || github.ref == 'refs/heads/master' - run: | - mkdir staging && cp -r target/pit-reports/ staging - - name: Archive code coverage results - if: failure() || github.ref == 'refs/heads/master' - uses: actions/upload-artifact@v2 - with: - name: pitest-coding-1-coverage-report - path: staging - retention-days: 7 - - pitest-coding-2: - runs-on: ubuntu-latest - steps: - - name: Setup local maven cache - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: checkstyle-maven-cache-${{ hashFiles('**/pom.xml') }} - - name: Checkout - uses: actions/checkout@v2 - - name: pitest-Coding-2 - run: | - ./.ci/pitest.sh pitest-coding-2 - - name: Stage results - if: failure() || github.ref == 'refs/heads/master' - run: | - mkdir staging && cp -r target/pit-reports/ staging - - name: Archive code coverage results - if: failure() || github.ref == 'refs/heads/master' - uses: actions/upload-artifact@v2 - with: - name: pitest-coding-2-coverage-report - path: staging - retention-days: 7 - - pitest-coding-require-this-check: - runs-on: ubuntu-latest - steps: - - name: Setup local maven cache - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: checkstyle-maven-cache-${{ hashFiles('**/pom.xml') }} - - name: Checkout - uses: actions/checkout@v2 - - name: pitest-Coding-require-this-check - run: | - ./.ci/pitest.sh pitest-coding-require-this-check - - name: Stage results - if: failure() || github.ref == 'refs/heads/master' - run: | - mkdir staging && cp -r target/pit-reports/ staging - - name: Archive code coverage results - if: failure() || github.ref == 'refs/heads/master' - uses: actions/upload-artifact@v2 - with: - name: pitest-coding-require-this-check-coverage-report - path: staging - retention-days: 7 - - pitest-common: - runs-on: ubuntu-latest - steps: - - name: Setup local maven cache - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: checkstyle-maven-cache-${{ hashFiles('**/pom.xml') }} - - name: Checkout - uses: actions/checkout@v2 - - name: pitest-common - run: | - ./.ci/pitest.sh pitest-common - - name: Stage results - if: failure() || github.ref == 'refs/heads/master' - run: | - mkdir staging && cp -r target/pit-reports/ staging - - name: Archive code coverage results - if: failure() || github.ref == 'refs/heads/master' - uses: actions/upload-artifact@v2 - with: - name: pitest-common-coverage-report - path: staging - retention-days: 7 - - pitest-common-2: - runs-on: ubuntu-latest - steps: - - name: Setup local maven cache - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: checkstyle-maven-cache-${{ hashFiles('**/pom.xml') }} - - name: Checkout - uses: actions/checkout@v2 - - name: pitest-common-2 - run: | - ./.ci/pitest.sh pitest-common-2 - - name: Stage results - if: failure() || github.ref == 'refs/heads/master' - run: | - mkdir staging && cp -r target/pit-reports/ staging - - name: Archive code coverage results - if: failure() || github.ref == 'refs/heads/master' - uses: actions/upload-artifact@v2 - with: - name: pitest-common-2-coverage-report - path: staging - retention-days: 7 - - pitest-design: - runs-on: ubuntu-latest - steps: - - name: Setup local maven cache - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: checkstyle-maven-cache-${{ hashFiles('**/pom.xml') }} - - name: Checkout - uses: actions/checkout@v2 - - name: pitest-design - run: | - ./.ci/pitest.sh pitest-design - - name: Stage results - if: failure() || github.ref == 'refs/heads/master' - run: | - mkdir staging && cp -r target/pit-reports/ staging - - name: Archive code coverage results - if: failure() || github.ref == 'refs/heads/master' - uses: actions/upload-artifact@v2 - with: - name: pitest-design-coverage-report - path: staging - retention-days: 7 - - pitest-filters: - runs-on: ubuntu-latest - steps: - - name: Setup local maven cache - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: checkstyle-maven-cache-${{ hashFiles('**/pom.xml') }} - - name: Checkout - uses: actions/checkout@v2 - - name: pitest-filters - run: | - ./.ci/pitest.sh pitest-filters - - name: Stage results - if: failure() || github.ref == 'refs/heads/master' - run: | - mkdir staging && cp -r target/pit-reports/ staging - - name: Archive code coverage results - if: failure() || github.ref == 'refs/heads/master' - uses: actions/upload-artifact@v2 - with: - name: pitest-filters-coverage-report - path: staging - retention-days: 7 - - pitest-header: - runs-on: ubuntu-latest - steps: - - name: Setup local maven cache - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: checkstyle-maven-cache-${{ hashFiles('**/pom.xml') }} - - name: Checkout - uses: actions/checkout@v2 - - name: pitest-header - run: | - ./.ci/pitest.sh pitest-header - - name: Stage results - if: failure() || github.ref == 'refs/heads/master' - run: | - mkdir staging && cp -r target/pit-reports/ staging - - name: Archive code coverage results - if: failure() || github.ref == 'refs/heads/master' - uses: actions/upload-artifact@v2 - with: - name: pitest-header-coverage-report - path: staging - retention-days: 7 - - pitest-imports: - runs-on: ubuntu-latest - steps: - - name: Setup local maven cache - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: checkstyle-maven-cache-${{ hashFiles('**/pom.xml') }} - - name: Checkout - uses: actions/checkout@v2 - - name: pitest-imports - run: | - ./.ci/pitest.sh pitest-imports - - name: Stage results - if: failure() || github.ref == 'refs/heads/master' - run: | - mkdir staging && cp -r target/pit-reports/ staging - - name: Archive code coverage results - if: failure() || github.ref == 'refs/heads/master' - uses: actions/upload-artifact@v2 - with: - name: pitest-imports-coverage-report - path: staging - retention-days: 7 - - pitest-indentation: - runs-on: ubuntu-latest - steps: - - name: Setup local maven cache - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: checkstyle-maven-cache-${{ hashFiles('**/pom.xml') }} - - name: Checkout - uses: actions/checkout@v2 - - name: pitest-indentation - run: | - ./.ci/pitest.sh pitest-indentation - - name: Stage results - if: failure() || github.ref == 'refs/heads/master' - run: | - mkdir staging && cp -r target/pit-reports/ staging - - name: Archive code coverage results - if: failure() || github.ref == 'refs/heads/master' - uses: actions/upload-artifact@v2 - with: - name: pitest-indentation-coverage-report - path: staging - retention-days: 7 - - pitest-javadoc: - runs-on: ubuntu-latest - steps: - - name: Setup local maven cache - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: checkstyle-maven-cache-${{ hashFiles('**/pom.xml') }} - - name: Checkout - uses: actions/checkout@v2 - - name: pitest-javadoc - run: | - ./.ci/pitest.sh pitest-javadoc - - name: Stage results - if: failure() || github.ref == 'refs/heads/master' - run: | - mkdir staging && cp -r target/pit-reports/ staging - - name: Archive code coverage results - if: failure() || github.ref == 'refs/heads/master' - uses: actions/upload-artifact@v2 - with: - name: pitest-javadoc-coverage-report - path: staging - retention-days: 7 - - pitest-main: - runs-on: ubuntu-latest - steps: - - name: Set up JDK 11 - uses: actions/setup-java@v1 - with: - java-version: 11 - - name: Setup local maven cache - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: checkstyle-maven-cache-${{ hashFiles('**/pom.xml') }} - - name: Checkout - uses: actions/checkout@v2 - - name: pitest-main - run: | - ./.ci/pitest.sh pitest-main - - name: Stage results - if: failure() || github.ref == 'refs/heads/master' - run: | - mkdir staging && cp -r target/pit-reports/ staging - - name: Archive code coverage results - if: failure() || github.ref == 'refs/heads/master' - uses: actions/upload-artifact@v2 - with: - name: pitest-main-coverage-report - path: staging - retention-days: 7 - - pitest-metrics: - runs-on: ubuntu-latest - steps: - - name: Setup local maven cache - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: checkstyle-maven-cache-${{ hashFiles('**/pom.xml') }} - - name: Checkout - uses: actions/checkout@v2 - - name: pitest-metrics - run: | - ./.ci/pitest.sh pitest-metrics - - name: Stage results - if: failure() || github.ref == 'refs/heads/master' - run: | - mkdir staging && cp -r target/pit-reports/ staging - - name: Archive code coverage results - if: failure() || github.ref == 'refs/heads/master' - uses: actions/upload-artifact@v2 - with: - name: pitest-metrics-coverage-report - path: staging - retention-days: 7 - - pitest-misc: - runs-on: ubuntu-latest - steps: - - name: Setup local maven cache - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: checkstyle-maven-cache-${{ hashFiles('**/pom.xml') }} - - name: Checkout - uses: actions/checkout@v2 - - name: pitest-misc - run: | - ./.ci/pitest.sh pitest-misc - - name: Stage results - if: failure() || github.ref == 'refs/heads/master' - run: | - mkdir staging && cp -r target/pit-reports/ staging - - name: Archive code coverage results - if: failure() || github.ref == 'refs/heads/master' - uses: actions/upload-artifact@v2 - with: - name: pitest-misc-coverage-report - path: staging - retention-days: 7 - - pitest-modifier: - runs-on: ubuntu-latest - steps: - - name: Setup local maven cache - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: checkstyle-maven-cache-${{ hashFiles('**/pom.xml') }} - - name: Checkout - uses: actions/checkout@v2 - - name: pitest-modifier - run: | - ./.ci/pitest.sh pitest-modifier - - name: Stage results - if: failure() || github.ref == 'refs/heads/master' - run: | - mkdir staging && cp -r target/pit-reports/ staging - - name: Archive code coverage results - if: failure() || github.ref == 'refs/heads/master' - uses: actions/upload-artifact@v2 - with: - name: pitest-modifier-coverage-report - path: staging - retention-days: 7 - - pitest-naming: - runs-on: ubuntu-latest - steps: - - name: Setup local maven cache - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: checkstyle-maven-cache-${{ hashFiles('**/pom.xml') }} - - name: Checkout - uses: actions/checkout@v2 - - name: pitest-naming - run: | - ./.ci/pitest.sh pitest-naming - - name: Stage results - if: failure() || github.ref == 'refs/heads/master' - run: | - mkdir staging && cp -r target/pit-reports/ staging - - name: Archive code coverage results - if: failure() || github.ref == 'refs/heads/master' - uses: actions/upload-artifact@v2 - with: - name: pitest-naming-coverage-report - path: staging - retention-days: 7 - - pitest-packagenamesloader: - runs-on: ubuntu-latest - steps: - - name: Setup local maven cache - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: checkstyle-maven-cache-${{ hashFiles('**/pom.xml') }} - - name: Checkout - uses: actions/checkout@v2 - - name: pitest-packagenamesloader - run: | - ./.ci/pitest.sh pitest-packagenamesloader - - name: Stage results - if: failure() || github.ref == 'refs/heads/master' - run: | - mkdir staging && cp -r target/pit-reports/ staging - - name: Archive code coverage results - if: failure() || github.ref == 'refs/heads/master' - uses: actions/upload-artifact@v2 - with: - name: pitest-packagenamesloader-coverage-report - path: staging - retention-days: 7 - - pitest-regexp: - runs-on: ubuntu-latest - steps: - - name: Setup local maven cache - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: checkstyle-maven-cache-${{ hashFiles('**/pom.xml') }} - - name: Checkout - uses: actions/checkout@v2 - - name: pitest-regexp - run: | - ./.ci/pitest.sh pitest-regexp - - name: Stage results - if: failure() || github.ref == 'refs/heads/master' - run: | - mkdir staging && cp -r target/pit-reports/ staging - - name: Archive code coverage results - if: failure() || github.ref == 'refs/heads/master' - uses: actions/upload-artifact@v2 - with: - name: pitest-regexp-coverage-report - path: staging - retention-days: 7 - - pitest-sizes: - runs-on: ubuntu-latest - steps: - - name: Setup local maven cache - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: checkstyle-maven-cache-${{ hashFiles('**/pom.xml') }} - - name: Checkout - uses: actions/checkout@v2 - - name: pitest-sizes - run: | - ./.ci/pitest.sh pitest-sizes - - name: Stage results - if: failure() || github.ref == 'refs/heads/master' - run: | - mkdir staging && cp -r target/pit-reports/ staging - - name: Archive code coverage results - if: failure() || github.ref == 'refs/heads/master' - uses: actions/upload-artifact@v2 - with: - name: pitest-sizes-coverage-report - path: staging - retention-days: 7 - - pitest-tree-walker: - runs-on: ubuntu-latest - steps: - - name: Setup local maven cache - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: checkstyle-maven-cache-${{ hashFiles('**/pom.xml') }} - - name: Checkout - uses: actions/checkout@v2 - - name: pitest-tree-walker - run: | - ./.ci/pitest.sh pitest-tree-walker - - name: Stage results - if: failure() || github.ref == 'refs/heads/master' - run: | - mkdir staging && cp -r target/pit-reports/ staging - - name: Archive code coverage results - if: failure() || github.ref == 'refs/heads/master' - uses: actions/upload-artifact@v2 - with: - name: pitest-tree-walker-coverage-report - path: staging - retention-days: 7 - - pitest-utils: - runs-on: ubuntu-latest - steps: - - name: Setup local maven cache - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: checkstyle-maven-cache-${{ hashFiles('**/pom.xml') }} - - name: Checkout - uses: actions/checkout@v2 - - name: pitest-utils - run: | - ./.ci/pitest.sh pitest-utils - - name: Stage results - if: failure() || github.ref == 'refs/heads/master' - run: | - mkdir staging && cp -r target/pit-reports/ staging - - name: Archive code coverage results - if: failure() || github.ref == 'refs/heads/master' - uses: actions/upload-artifact@v2 - with: - name: pitest-utils-coverage-report - path: staging - retention-days: 7 - - pitest-whitespace: - runs-on: ubuntu-latest - steps: - - name: Setup local maven cache - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: checkstyle-maven-cache-${{ hashFiles('**/pom.xml') }} - - name: Checkout - uses: actions/checkout@v2 - - name: pitest-whitespace - run: | - ./.ci/pitest.sh pitest-whitespace - - name: Stage results - if: failure() || github.ref == 'refs/heads/master' - run: | - mkdir staging && cp -r target/pit-reports/ staging - - name: Archive code coverage results - if: failure() || github.ref == 'refs/heads/master' - uses: actions/upload-artifact@v2 - with: - name: pitest-whitespace-coverage-report - path: staging - retention-days: 7 - - pitest-xpath: - runs-on: ubuntu-latest - steps: - - name: Setup local maven cache - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: checkstyle-maven-cache-${{ hashFiles('**/pom.xml') }} - - name: Checkout - uses: actions/checkout@v2 - - name: pitest-xpath - run: | - ./.ci/pitest.sh pitest-xpath - - name: Stage results - if: failure() || github.ref == 'refs/heads/master' - run: | - mkdir staging && cp -r target/pit-reports/ staging - - name: Archive code coverage results - if: failure() || github.ref == 'refs/heads/master' - uses: actions/upload-artifact@v2 - with: - name: pitest-xpath-coverage-report - path: staging - retention-days: 7 - - pitest-java-ast-visitor: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - ref: ${{ github.event.pull_request.head.sha }} - - name: Set up JDK 11 - uses: actions/setup-java@v1 - with: - java-version: 11 - - - name: Generate pitest report - run: ./.ci/pitest.sh pitest-java-ast-visitor - - name: Stage results - if: failure() || github.ref == 'refs/heads/master' - run: | - mkdir staging && cp -r target/pit-reports/ staging - - name: Archive code coverage results - if: failure() || github.ref == 'refs/heads/master' - uses: actions/upload-artifact@v2 - with: - name: pitest-report-java-ast-visitor - path: staging - retention-days: 7 + pitest: + runs-on: ubuntu-latest + strategy: + matrix: + profile: [ pitest-annotation, + pitest-ant, pitest-api, + pitest-blocks, + pitest-coding-1, + pitest-coding-2, + pitest-coding-require-this-check, + pitest-common, + pitest-common-2, + pitest-design, + pitest-filters, + pitest-header, + pitest-imports, + pitest-indentation, + pitest-javadoc, + pitest-main, + pitest-metrics, + pitest-misc, + pitest-modifier, + pitest-naming, + pitest-packagenamesloader, + pitest-regexp, + pitest-sizes, + pitest-tree-walker, + pitest-utils, + pitest-whitespace, + pitest-xpath, + pitest-java-ast-visitor ] + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Install Groovy 4.0.3 + run: | + GROOVY_LINK="https://groovy.jfrog.io/artifactory/dist-release-local/groovy-zips/apache-groovy-binary-4.0.3.zip" + wget -O ${{ runner.temp }}/groovy.zip $GROOVY_LINK; + unzip ${{ runner.temp }}/groovy.zip -d ${{ runner.temp }}; + mv ${{ runner.temp }}/groovy-4.0.3 ${{ runner.temp }}/groovy + GROOVY_HOME=${{ runner.temp }}/groovy + echo "GROOVY_HOME=${{ runner.temp }}/groovy" >> $GITHUB_ENV + echo "$GROOVY_HOME/bin" >> $GITHUB_PATH + - name: Setup local maven cache + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: checkstyle-maven-cache-${{ hashFiles('**/pom.xml') }} + - name: Checkout + uses: actions/checkout@v2 + - name: pitest-${{ matrix.profile }} + run: | + groovy ./.ci/pitest.groovy ${{ matrix.profile }} + - name: Stage results + if: failure() || github.ref == 'refs/heads/master' + run: | + mkdir staging && cp -r target/pit-reports/ staging + - name: Archive code coverage results + if: failure() || github.ref == 'refs/heads/master' + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.profile }}-coverage-report + path: staging + retention-days: 7 diff --git a/config/checkstyle_non_main_files_suppressions.xml b/config/checkstyle_non_main_files_suppressions.xml index 1fa3e6ec94b2..43608c4b52b3 100644 --- a/config/checkstyle_non_main_files_suppressions.xml +++ b/config/checkstyle_non_main_files_suppressions.xml @@ -87,6 +87,9 @@ + + + diff --git a/pom.xml b/pom.xml index 4081c73f37aa..78a4d43e44c0 100644 --- a/pom.xml +++ b/pom.xml @@ -216,6 +216,7 @@ 11 1.8.0 10 + HTML,XML 50000 4 0.16 @@ -2384,6 +2385,7 @@ ${pitest.plugin.timeout.factor} ${pitest.plugin.timeout.constant} ${pitest.plugin.threads} + ${pitest.plugin.output.formats} @@ -2428,6 +2430,7 @@ ${pitest.plugin.timeout.factor} ${pitest.plugin.timeout.constant} ${pitest.plugin.threads} + ${pitest.plugin.output.formats} @@ -2472,6 +2475,7 @@ ${pitest.plugin.timeout.factor} ${pitest.plugin.timeout.constant} ${pitest.plugin.threads} + ${pitest.plugin.output.formats} @@ -2561,6 +2565,7 @@ ${pitest.plugin.timeout.factor} ${pitest.plugin.timeout.constant} ${pitest.plugin.threads} + ${pitest.plugin.output.formats} @@ -2663,6 +2668,7 @@ ${pitest.plugin.timeout.factor} ${pitest.plugin.timeout.constant} ${pitest.plugin.threads} + ${pitest.plugin.output.formats} @@ -2707,6 +2713,7 @@ ${pitest.plugin.timeout.factor} ${pitest.plugin.timeout.constant} ${pitest.plugin.threads} + ${pitest.plugin.output.formats} @@ -2751,6 +2758,7 @@ ${pitest.plugin.timeout.factor} ${pitest.plugin.timeout.constant} ${pitest.plugin.threads} + ${pitest.plugin.output.formats} @@ -2795,6 +2803,7 @@ ${pitest.plugin.timeout.factor} ${pitest.plugin.timeout.constant} ${pitest.plugin.threads} + ${pitest.plugin.output.formats} @@ -2839,6 +2848,7 @@ ${pitest.plugin.timeout.factor} ${pitest.plugin.timeout.constant} ${pitest.plugin.threads} + ${pitest.plugin.output.formats} @@ -2884,6 +2894,7 @@ ${pitest.plugin.timeout.factor} ${pitest.plugin.timeout.constant} ${pitest.plugin.threads} + ${pitest.plugin.output.formats} @@ -2938,6 +2949,7 @@ ${pitest.plugin.timeout.factor} ${pitest.plugin.timeout.constant} ${pitest.plugin.threads} + ${pitest.plugin.output.formats} @@ -2982,6 +2994,7 @@ ${pitest.plugin.timeout.factor} ${pitest.plugin.timeout.constant} ${pitest.plugin.threads} + ${pitest.plugin.output.formats} @@ -3026,6 +3039,7 @@ ${pitest.plugin.timeout.factor} ${pitest.plugin.timeout.constant} ${pitest.plugin.threads} + ${pitest.plugin.output.formats} @@ -3070,6 +3084,7 @@ ${pitest.plugin.timeout.factor} ${pitest.plugin.timeout.constant} ${pitest.plugin.threads} + ${pitest.plugin.output.formats} @@ -3114,6 +3129,7 @@ ${pitest.plugin.timeout.factor} ${pitest.plugin.timeout.constant} ${pitest.plugin.threads} + ${pitest.plugin.output.formats} @@ -3158,6 +3174,7 @@ ${pitest.plugin.timeout.factor} ${pitest.plugin.timeout.constant} ${pitest.plugin.threads} + ${pitest.plugin.output.formats} @@ -3202,6 +3219,7 @@ ${pitest.plugin.timeout.factor} ${pitest.plugin.timeout.constant} ${pitest.plugin.threads} + ${pitest.plugin.output.formats} @@ -3247,6 +3265,7 @@ ${pitest.plugin.timeout.factor} ${pitest.plugin.timeout.constant} ${pitest.plugin.threads} + ${pitest.plugin.output.formats} @@ -3288,6 +3307,7 @@ ${pitest.plugin.timeout.factor} ${pitest.plugin.timeout.constant} ${pitest.plugin.threads} + ${pitest.plugin.output.formats} @@ -3373,6 +3393,7 @@ ${pitest.plugin.timeout.factor} ${pitest.plugin.timeout.constant} ${pitest.plugin.threads} + ${pitest.plugin.output.formats} @@ -3435,6 +3456,7 @@ ${pitest.plugin.timeout.factor} ${pitest.plugin.timeout.constant} ${pitest.plugin.threads} + ${pitest.plugin.output.formats} @@ -3476,6 +3498,7 @@ ${pitest.plugin.timeout.factor} ${pitest.plugin.timeout.constant} ${pitest.plugin.threads} + ${pitest.plugin.output.formats} @@ -3569,6 +3592,7 @@ ${pitest.plugin.timeout.factor} ${pitest.plugin.timeout.constant} ${pitest.plugin.threads} + ${pitest.plugin.output.formats} @@ -3626,6 +3650,7 @@ ${pitest.plugin.timeout.factor} ${pitest.plugin.timeout.constant} ${pitest.plugin.threads} + ${pitest.plugin.output.formats} @@ -3672,6 +3697,7 @@ ${pitest.plugin.timeout.factor} ${pitest.plugin.timeout.constant} ${pitest.plugin.threads} + ${pitest.plugin.output.formats} @@ -3781,6 +3807,7 @@ ${pitest.plugin.timeout.factor} ${pitest.plugin.timeout.constant} ${pitest.plugin.threads} + ${pitest.plugin.output.formats} @@ -3825,6 +3852,7 @@ ${pitest.plugin.timeout.factor} ${pitest.plugin.timeout.constant} ${pitest.plugin.threads} + ${pitest.plugin.output.formats} @@ -3899,6 +3927,7 @@ ${pitest.plugin.timeout.factor} ${pitest.plugin.timeout.constant} ${pitest.plugin.threads} + ${pitest.plugin.output.formats} @@ -3944,6 +3973,7 @@ ${pitest.plugin.timeout.factor} ${pitest.plugin.timeout.constant} ${pitest.plugin.threads} + ${pitest.plugin.output.formats}