Skip to content

Commit

Permalink
chore: Add a script to update pom.xml for running pit-descartes (#1820)
Browse files Browse the repository at this point in the history
  • Loading branch information
surli authored and monperrus committed Jan 31, 2018
1 parent 0d92415 commit 8ede7d2
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
44 changes: 44 additions & 0 deletions doc/jenkins/pit-descartes/descartes-config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<plugin>
<version>1.2.0</version>
<configuration>
<mutationEngine>descartes</mutationEngine>
<mutators>
<mutator>void</mutator>
<mutator>null</mutator>
<mutator>true</mutator>
<mutator>false</mutator>
<mutator>empty</mutator>
<mutator>0</mutator>
<mutator>1</mutator>
<mutator>(byte)0</mutator>
<mutator>(byte)1</mutator>
<mutator>(short)1</mutator>
<mutator>(short)2</mutator>
<mutator>0L</mutator>
<mutator>1L</mutator>
<mutator>0.0</mutator>
<mutator>1.0</mutator>
<mutator>0.0f</mutator>
<mutator>1.0f</mutator>
<mutator>'\40'</mutator>
<mutator>'A'</mutator>
<mutator>""</mutator>
<mutator>"A"</mutator>
</mutators>
<excludedClasses>
<excludedClass>spoon.test.intercession.IntercessionTest</excludedClass>
<excludedClass>spoon.test.template.TemplateTest</excludedClass>
<excludedClass>spoon.test.main.MainTest</excludedClass>
</excludedClasses>
<timestampedReports>false</timestampedReports>
</configuration>
<dependencies>
<dependency>
<groupId>fr.inria.stamp</groupId>
<artifactId>descartes</artifactId>
<version>0.2-SNAPSHOT</version>
</dependency>
</dependencies>
</plugin>
</project>
19 changes: 19 additions & 0 deletions doc/jenkins/pit-descartes/update-pom.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env python
import xml.etree.ElementTree as et

pom_file = "pom.xml"
descartes_file = "descartes-config.xml"

spaces={'xmlns':'http://maven.apache.org/POM/4.0.0','schemaLocation':'http://maven.apache.org/xsd/maven-4.0.0.xsd'}

pomTree = et.parse(pom_file)
descartesTree = et.parse(descartes_file)

rootDescartes = descartesTree.getroot()

pomPitPlugin = pomTree.find(".//{http://maven.apache.org/POM/4.0.0}plugins/{http://maven.apache.org/POM/4.0.0}plugin[{http://maven.apache.org/POM/4.0.0}artifactId='pitest-maven']")

for element in descartesTree.findall('*/'):
pomPitPlugin.append(element)

pomTree.write(pom_file, encoding="UTF-8", default_namespace=spaces['xmlns'], xml_declaration=False)

0 comments on commit 8ede7d2

Please sign in to comment.