This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
From e-mail from Julien: ------------------------------ You should be able to use it from the phar like this: $ php mageekguy.atoum.phar --use coverage --output clover.xml When using atoum sources, the command line is a bit different: $ php scripts/coverage.php --output clover.xml ------------------------------
Should be fixed now. Láďo, could you please test it with PHAR as well as with "atoum" file (from cloned repository)? Also, please test it on Windows as well as on Linux. Thanks a lot! Thanks Julien for all your help! http://hg.netbeans.org/web-main/rev/63ecbcb928f8 http://hg.netbeans.org/web-main/rev/0b676e4dea01 http://hg.netbeans.org/web-main/rev/a582bff57005
Sure, I'll try it but likely on sooner than on Thursday/Friday
Reopening based on email from Julien: The thing here is that Netbeans is passing CLI argument before the --use which does not work. For the command to work properly, we have to call the phar like this: "/usr/bin/php" "/home/vriha/phplib/mageekguy.atoum.phar" "--use" "coverage" "--output" "/tmp/nb-atoum-coverage.xml" "-d" "/tmp/Calculator-atoum/test" "-utr"
Julien, just to be sure, could you please provide also the command for the cloned repository (not PHAR file but plenty of files). Thanks!
For the record, here are the command to use when ruuning atoum from Phar or from sources: * From Phar: $ php mageekguy.atoum.phar --use 'coverage' --output "/tmp/nb-atoum-coverage.xml" "-d" "/tmp/Calculator-atoum/test" "-utr" * From sources: $ php <path/to/atoum/root>/scripts/coverage.php --output "/tmp/nb-atoum-coverage.xml" "-d" "/tmp/Calculator-atoum/test" "-utr" Both commands should produce the exact same output and reports.
And if we have bootstrap and/or configuration, we can add them as the first parameters (right after PHAR or "coverage" files), right? Thanks.
Looking into the code, I see that we use also Xdebug (-xc) and filter (-m) params - where to put these, please? Currently, we put them right before the "-d" parameter. Láďo, please, try to test at least some combinations once I fix it, thanks :)
(In reply to Tomas Mysik from comment #7) > Looking into the code, I see that we use also Xdebug (-xc) and filter (-m) > params - where to put these, please? Currently, we put them right before the > "-d" parameter. Apparently it does not work... :/ "/usr/bin/php" "/home/gapon/tmp/atoum/mageekguy.atoum.phar" "--use" "coverage" "--output" "/tmp/nb-atoum-coverage.xml" "-m" "tests\unit\Calculator::testMinus" "-d" "/home/gapon/NetBeansProjects/Calculator-atoum1/test" "-utr" Error: Argument '--output' is unknown, did you mean '-drt'?
Julien, one more issue - if I run [1], the tests are run OK but the coverage file is not generated at all (it does not exist on the disk). Any idea, please? Thanks. [1] "/usr/bin/php" "/home/gapon/tmp/atoum/mageekguy.atoum.phar" "--use" "coverage" "--output" "/tmp/nb-atoum-coverage.xml" "-d" "/home/gapon/NetBeansProjects/Calculator-atoum1/test" "-utr"
So, the NetBeans side should be fixed, I hope. But as I wrote (see my previous comments), no coverage file is generated and also one cannot use "-m" parameter (I did not try to debug any test). Julien, could you please look at it and help us? Or should not we return to the previous state - run 2 commands, one for test results and the other one for coverage? Please, let us know, thanks. http://hg.netbeans.org/web-main/rev/fcc8b6551b5f
I'm on it ;)
@Tomas @Vladimir I found the bug, it was on my side : I should be able to fix it quickly and provide an new, working Phar. I'll keep you updated. Sorry.
Ok, so I got everything working from sources: $ php vendor/atoum/atoum/scripts/coverage.php "--output" "clover.xml" "-d" "tests/" "-utr" # TAP report OK, coverage report OK in clover.xml $ php vendor/atoum/atoum/scripts/coverage.php "--output" "clover.xml" "-m" "tests\\units\\netbeans\\sample\\Calculator::testMultiply" "-d" "tests/" "-utr" # TAP report OK, coverage report OK in clover.xml, only the selected method is run We can also use the -c argument to include additional configuration files: $ php vendor/atoum/atoum/scripts/coverage.php "--output" "clover.xml" "-m" "tests\\units\\netbeans\\sample\\Calculator::testMultiply" "-d" "tests/" "-utr" -c /tmp/.atoum.php +verbose # TAP report OK, coverage report OK in clover.xml, only the selected method is run and the extra config. file is used Note that you can use the +verbose or ++verbose arguments so that atoum will let you know which config files, bootstrap files and tests files it uses. Now, it's time to build the phar :)
Perfect, simply attach the PHAR file here. Thanks! I will move the config/bootstrap files parameters to the end of the command. Thanks!
(In reply to Tomas Mysik from comment #14) > I will move the config/bootstrap files parameters to the end of the command. Done. Láďo, please do not forget to debug unit tests (it will add -xc parameter). Thanks. http://hg.netbeans.org/web-main/rev/ddabce0d8454
Integrated into 'main-silver', will be available in build *201407230001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/fcc8b6551b5f User: Tomas Mysik <tmysik@netbeans.org> Log: #245353 - Code coverage not available
Created attachment 148248 [details] mageekguy.atoum.phar Here is the new phar. I tested every command in my previous comment with the phar and some other combinations. Everything seemed to work ;)
Thanks a lot, Julien!
Thanks for the phar, I tried it works fine without debugging but once I try to debug file while code coverage is on, it doesn't work php "/home/vriha/phplib/mageekguy.atoum_nightly.phar" "--use" "coverage" "--output" "/tmp/nb-atoum-coverage.xml" "-xc" "idekey=netbeans-xdebug" "-f" "/home/vriha/Downloads/Calculator-atoum1/test/Calculator.php" "-utr" Error: Argument '--output' is unknown, did you mean '-drt'? Done. Product Version: NetBeans IDE Dev (Build 201407250001) Java: 1.8.0_05; Java HotSpot(TM) Client VM 25.5-b02 Runtime: Java(TM) SE Runtime Environment 1.8.0_05-b13 System: Linux version 3.13.0-32-generic running on i386; UTF-8; en_US (nb)
Julien, maybe the [1] param must be at the end of the command? Or should we disable coverage for debugging? Thanks. [1] "-xc" "idekey=netbeans-xdebug"
I tried the same with atoum file from cloned repository and it works fine in this case, code coverage is displayed even with debugging "/usr/bin/php" "/home/vriha/phplib/atoum/atoum/scripts/coverage.php" "--output" "/tmp/nb-atoum-coverage.xml" "-xc" "idekey=netbeans-xdebug" "-f" "/home/vriha/Downloads/Calculator-atoum1/test/Calculator.php" "-utr"
So it seems to me to be atoum issue - right, Julien? Thanks.
I'm checking this behavior on the atoum side. If it comes from atoum it should not be hard to fix. I'm on it and I'll try to provide a working phar and master asap ;)
I can't reproduce the bug with the last phar I provided. Here is what I have: I cloned github.com/jubianchi/atoum-sample inside my atoum (master) working copy: . ├── [ 782] atoum-master │ ├── [ 442] atoum-sample Then I cd'ed into atoum-sample and ran: $ php ../mageekguy.atoum.phar "--use" "coverage" "--output" "/tmp/nb-atoum-coverage.xml" "-xc" "idekey=netbeans-xdebug" -f tests/units/netbeans/sample/Calculator.php "-utr" Everything worked fine: 1..3 ok 1 # tests\units\netbeans\sample\Calculator::testMultiply() ok 2 # tests\units\netbeans\sample\Calculator::testDivide() ok 3 # tests\units\netbeans\sample\Calculator::testAdd() And the clover is OK: $ cat /tmp/nb-atoum-coverage.xml <?xml version="1.0" encoding="UTF-8"?> <coverage generated="1406309597" clover="53d294dd467db"> <project timestamp="1406309597" name="atoum code coverage"> <package name="atoumCodeCoverage"> <file name="Calculator.php" path="/Users/jubianchi/repositories/atoum/atoum-master/atoum-sample/src/netbeans/sample/Calculator.php"> <line num="8" type="stmt" complexity="0" count="1" falsecount="0" truecount="0" signature="" testduration="0" testsuccess="0"/> <line num="13" type="stmt" complexity="0" count="1" falsecount="0" truecount="0" signature="" testduration="0" testsuccess="0"/> <line num="14" type="stmt" complexity="0" count="1" falsecount="0" truecount="0" signature="" testduration="0" testsuccess="0"/> <line num="17" type="stmt" complexity="0" count="1" falsecount="0" truecount="0" signature="" testduration="0" testsuccess="0"/> <line num="22" type="stmt" complexity="0" count="1" falsecount="0" truecount="0" signature="" testduration="0" testsuccess="0"/> <class name="Calculator"> <metrics complexity="0" elements="5" coveredelements="5" conditionals="0" coveredconditionals="0" statements="5" coveredstatements="5" methods="3" coveredmethods="3" testduration="0" testfailures="0" testpasses="0" testruns="0"/> </class> <metrics complexity="0" elements="5" coveredelements="5" conditionals="0" coveredconditionals="0" statements="5" coveredstatements="5" methods="3" coveredmethods="3" testduration="0" testfailures="0" testpasses="0" testruns="0" classes="1" loc="5" ncloc="5"/> </file> <metrics complexity="0" elements="5" coveredelements="5" conditionals="0" coveredconditionals="0" statements="5" coveredstatements="5" methods="3" coveredmethods="3" testduration="0" testfailures="0" testpasses="0" testruns="0" classes="1" loc="5" ncloc="5" files="1"/> </package> <metrics complexity="0" elements="5" coveredelements="5" conditionals="0" coveredconditionals="0" statements="5" coveredstatements="5" methods="3" coveredmethods="3" testduration="0" testfailures="0" testpasses="0" testruns="0" classes="1" loc="5" ncloc="5" files="1" packages="1"/> </project> </coverage> To me, everything is OK. @Vladimir are you sure you used the pahr I pushed here ? https://netbeans.org/bugzilla/attachment.cgi?id=148248
Yes, I am using this one. MD5 hash is aac6180956790c10976dfa578920b9a8 . It doesn't work for me even from command line with the atoum-sample project. $ php -v PHP 5.5.12-2+deb.sury.org~precise+1 (cli) (built: May 12 2014 13:46:38) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies
(In reply to jubianchi from comment #17) > Created attachment 148248 [details] > mageekguy.atoum.phar > > Here is the new phar. I tested every command in my previous comment with the > phar and some other combinations. Everything seemed to work ;) Strange, I can confirm that it simply does not work for me, see [1]. Thanks. [1] "/usr/bin/php" "/home/gapon/Download/mageekguy.atoum.phar" "--use" "coverage" "--output" "/tmp/nb-atoum-coverage.xml" "-d" "/home/gapon/NetBeansProjects/Calculator-atoum/test" "-utr" Error: Argument '--output' is unknown, did you mean '-drt'?
I finally reproduced the bug. I'm working ont it.
@Tomas @Vladimir SHould be fixed : I pushed a commit on https://github.com/atoum/atoum I'll build the phar when I get home and upload it here after confirming that it works.