While using Devel::Cover in a test code which tests CodeA, does Devel::Cover have an option of switching the coverage off. Is there a way to switch the coverage module on or off as per user?
Test code tests CodeA.
Devel::Cover commands are embedded in Test code whenever CodeA commands get tested.
Does Devel::Cover include any provision where this coverage collection can be switched on or off?
There is a way to turn coverage on and off at runtime, but it seems that I have forgotten to document it. However, it is tested, so you can see how to use it there:
https://github.com/pjcj/Devel--Cover/blob/master/t/internal/criteria.t
This isn't exactly the same as if Devel::Cover had never been loaded, but rather it just stops Devel::Cover collecting coverage information for the criteria which are turned off.
Related
I've written some test scripts & run them using the test runner. This has worked great, but unfortunately I didn't record the bugs at the time, via the test runner (just failed the steps and added comments).
When I review the Test Run Results I can create a bug for the Dev Team, but the Repro Steps box doesn't get populated with anything meaningful (see image1). I've spotted that the DevTeam can get to the test results via the 'Links' tab on the Bug, but it's a bit clunky:
However if I'd created a bug direct from the test runner, the bugs Repro Steps box gets populated with exactly what the DevTeam needs:
Does anyone know how/if I can generate the same nicely formatted test runner Repro Steps if I create a bug from the Test Results after testing? (I've got a few to do, so would prefer not to re-run the tests....)
You can write some code that will read test run content and copy paste this in bugs because this is just html in content of bug.
The best approach would be to create bug, and later on link test run to created bug.
I am looking at karma's reporter configuration.
There are some possible reporters: progress, dots, growl, coverage. I don't find any detailed information explaining each of the options.
I tried progress and dots, they all print log to console, the result looks the same. What are the differences between them?
Growl, coverage need a little more configuration, so I didn't succeed testing them.
Progress will show the number of tests executed, skipped and total.
dots will print a dot for each test executed
growl will use the growl tool to report the progress of the testing.
Note: you need to install the plugin to use this guy.
coverage works together with the coverage pre-processor to generate an HTML Coverage report of your Javascript files.
Note: you need to install the plugin to use this guy.
I use karma to run jasmine specs. Every time a file changes the tests are run. This is awesome but it would be even better if the previous test output would be removed from the terminal.
Is there a way to clear the terminal before tests are run in karma?
It is not supported. I like this idea though. I created issue #1004 to support this.
The issue #Sylvain has created is still open, but there is a plugin karma-clear-screen-reporter which does the job. Internally it uses the magic:
console.log('\u001b[2J\u001b[0;0H');
Alternatively you can also place this at the top of your test runner code to clear the console yourself.
Context
My answer is the same as #bluenote10
The difference is that I made some improvements to the package he posted and published it on my github:
Karma Clear Screen
Improvements
Improvement in the initial message.
Date of the update.
In addition to console.log('\u001b[2J\u001b[0;0H'); the spacing has been improved.
If we click on Java perspective in Eclipse and right click on a Java project, we see “new” a JUnit file.On executing the test cases in JUnit we see red/green bar displaying failure/success of test cases.
I am trying to find a plugin that would add these two features :
In the perl perspective (provided by EPIC) , right-click on a Perl
project should list a new “t” file.
On executing perl unit the status of test cases should be displayed
using Reed/Green bar.
If there is no plugin is there a way we can do the same.
As far as I know, there is no EPIC plugin for this or even a more generic TAP-based test runner for Eclipse. Such a thing would be nice to have.
Rigging some sort of report on test success from a web page is pretty common. This can be done using a tool like Test::Harness which can be used to run your test or tests and return or output a report of how well your test run went.
From there, it's a matter of turning that into a red/green progress bar.
If you want to see the progress updated continuously during the test run, you'll have to run and parse the test files more directly as they run. All Perl tests output TAP format, which is a standard format with specs available here:
http://testanything.org
Imagine a test suite with a dozen tests. Each might print somet stuff to System.out via a logger etc. The wish or problem is that it is not possible to have the console only show the output for the selected test. The console shows everything. Is tehre a plugin or way to achieve my wish ?
You can have Eclipse run only one test in a suite, by choosing the test on the Run Configurations dialog (the "Test method" field).
By the way, this isn't really a programming question. You might get more response by posting the question to superuser.com.