Files
wiosna-dev_common-library/phing/tests.xml
2022-02-12 14:46:47 +01:00

124 lines
3.9 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<project name="Meritoo Package" basedir="." default="build:main" phingVersion="2.16.0">
<autoloader />
<!-- Properties -->
<if>
<available file="${project.basedir}/phing/properties" property="custom.properties.available" />
<then>
<property file="${project.basedir}/phing/properties" />
</then>
<else>
<property file="${project.basedir}/phing/properties.dist" />
</else>
</if>
<!-- Filesets -->
<fileset id="sourcecode" dir="${dir.src}">
<include name="**/*.php" />
<exclude name="*Test.php" />
<exclude name="**/*Test.php" />
<exclude name="**/Resources/**" />
<exclude name="**/DataFixtures/**" />
<exclude name="**/Tests/**" />
</fileset>
<fileset id="tests" dir="${dir.tests}">
<include name="**/*Test*.php" />
</fileset>
<!-- Default / main target -->
<target name="build:main"
depends="build:fix-coding-standards,
build:check,
build:test,
app:checkout"
/>
<!-- Fixing coding standards using the PHP Coding Standards Fixer (http://cs.sensiolabs.org) -->
<target name="build:fix-coding-standards">
<exec command="${tests.cs_fixer.command}" passthru="true" />
</target>
<!-- Check target -->
<target name="build:check"
depends="check:cs,
check:cpd,
check:phpstan,
check:psalm,
check:coveralls"
/>
<!-- Test target -->
<target name="build:test"
depends="test:phpunit,
test:infection"
/>
<!-- PHP_CodeSniffer -->
<target name="check:cs" depends="build:prepare">
<exec command="${tests.code_sniffer.command}" passthru="true" />
</target>
<!-- copy/paste detector -->
<target name="check:cpd" depends="build:prepare">
<phpcpd>
<fileset refid="sourcecode" />
<formatter type="pmd" outfile="${dir.reports}/copy-paste-detector.xml" />
</phpcpd>
</target>
<!-- Run static analysis -->
<target name="check:phpstan" depends="build:prepare">
<exec command="${check.phpstan.command}" passthru="true" />
</target>
<!-- Run static analysis -->
<target name="check:psalm" depends="build:prepare">
<exec command="${check.psalm.command}" passthru="true" />
</target>
<!-- Run analysis of code coverage -->
<target name="check:coveralls" depends="test:phpunit">
<exec command="${check.php_coveralls.command}" passthru="true" />
</target>
<!-- PHPUnit tests -->
<target name="test:phpunit" depends="build:prepare">
<exec command="${tests.phpunit.command}" passthru="true" />
</target>
<!-- Run mutation testing -->
<target name="test:infection" depends="test:phpunit">
<exec command="${tests.mutation.command}" passthru="true" />
</target>
<!-- Project build clean -->
<target name="build:clean">
<if>
<available file="${dir.reports}" type="dir" property="dir_is_available" />
<then>
<delete dir="${dir.reports}" />
</then>
</if>
</target>
<!-- Project build prepare -->
<target name="build:prepare" depends="build:clean">
<mkdir dir="${dir.reports}" />
<mkdir dir="${dir.reports.coverage}" />
<mkdir dir="${dir.reports.code_sniffer}" />
</target>
<!-- Checkout and finalization -->
<target name="app:checkout">
<tstamp>
<format property="date_end" pattern="%Y-%m-%d %H:%M" />
</tstamp>
<echo msg="--------------------------------------------" />
<echo msg="Build tests finished at: ${date_end}" />
<echo msg="--------------------------------------------" />
</target>
</project>