-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from Krinkle/test
Add test suite
- Loading branch information
Showing
5 changed files
with
47 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
sudo: false | ||
language: php | ||
php: | ||
- "7.2" | ||
- "7.1" | ||
- "7.0" | ||
- "5.6" | ||
- "5.5" | ||
script: ./test/run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
|
||
include 'vendor/rregeer/phpunit-coverage-check/coverage-check.php'; | ||
require dirname( __DIR__ ) . '/coverage-check.php'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<coverage generated="1001"> | ||
<project timestamp="1001"> | ||
<package name="Example"> | ||
<file name="/tmp/Example/String.php"> | ||
<class name="Example\String" namespace="Example"> | ||
<metrics complexity="15" methods="5" coveredmethods="4" conditionals="0" coveredconditionals="0" statements="33" coveredstatements="32" elements="38" coveredelements="36"/> | ||
</class> | ||
<metrics loc="129" ncloc="62" classes="1" methods="5" coveredmethods="4" conditionals="0" coveredconditionals="0" statements="33" coveredstatements="32" elements="38" coveredelements="36"/> | ||
</file> | ||
<file name="/tmp/Example/StringList.php"> | ||
<class name="Example\StringList" namespace="Example"> | ||
<metrics complexity="8" methods="5" coveredmethods="4" conditionals="0" coveredconditionals="0" statements="19" coveredstatements="16" elements="24" coveredelements="20"/> | ||
</class> | ||
<metrics loc="103" ncloc="45" classes="1" methods="5" coveredmethods="4" conditionals="0" coveredconditionals="0" statements="19" coveredstatements="16" elements="24" coveredelements="20"/> | ||
</file> | ||
</package> | ||
<metrics files="2" loc="232" ncloc="107" classes="2" methods="10" coveredmethods="8" conditionals="0" coveredconditionals="0" statements="52" coveredstatements="48" elements="62" coveredelements="56"/> | ||
</project> | ||
</coverage> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash -eu | ||
|
||
# Consistent CWD, regardless of which directory the script is run from. | ||
cd $(dirname $0)/.. | ||
|
||
# Expect pass | ||
bin/coverage-check test/clover.xml 0 | ||
bin/coverage-check test/clover.xml 90 | ||
|
||
# Expect fail | ||
! bin/coverage-check test/clover.xml 95 | ||
! bin/coverage-check test/clover.xml 100 |