Skip to content

Commit

Permalink
Update test/coverage-checker
Browse files Browse the repository at this point in the history
Added proper attribution.
  • Loading branch information
EvanDotPro committed Dec 6, 2012
1 parent db964a1 commit 22b77be
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions test/coverage-checker
Original file line number Diff line number Diff line change
@@ -1,7 +1,32 @@
#!/usr/bin/env php
<?php
// Source https://github.com/RWOverdijk/AssetManager/blob/master/coverage-checker.php
// Modified for colorized output by Evan
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license.
*/

/**
* Code coverage checker. Analyzes a given `clover.xml` report produced
* by PHPUnit and checks if coverage fits expected ratio
*
* Usage:
* php coverage-checker <path-to-clover> <pass-percentage>
*
* @author Marco Pivetta <[email protected]>
* Modified for colorized output by Evan Coury <[email protected]>
*/

$inputFile = $argv[1];
$percentage = min(100, max(0, (int) $argv[2]));
Expand Down

0 comments on commit 22b77be

Please sign in to comment.