Is it possible to suppress Run Settings output by nunit console? - nunit

NUnit console outputs run settings, which include the Test Parameters. I do not want it displayed. Is it possible? I use nunit3-console.

There are no options to change the default console text output, which is aimed at immediate developer feedback rather than reporting. Choices for you would be
Direct the output to a text file and edit it, perhaps automatically.
Create your own report from the XML result file, which contains all the necessary components. You can do this either by writing a resfoundult writer extension to the engine or creating an XSL transform that produces the result you want. I've generally found it best to just pick the technology (C# vs XSLT) that you most enjoy. :-)

Related

Merge 2 pdf files and preserve forms

I'd like to merge at least 2 PDF files into one while preserving all the form elements in the original PDFs. The form elements include text fields, radio buttons, check boxes, drop down menus and others. Please have a look at this sample PDF file with forms:
http://foersom.com/net/HowTo/data/OoPdfFormExample.pdf
Now try to merge it with any other arbitrary PDF file.
Can you do it?
EDIT: As for the implementation, I'd ideally prefer a command line solution on a linux plattform using open source tools such as 'ghostscript', or any other tool that you think is appropriate to solve this task.
Of course, everybody is welcome to supply any working solution to this problem, including a coded solution that involves writing a script which makes some API calls to a pdf-processing library. However, I'd suggest to take the path of least resistance first (CMD Solution).
Best Regards
EDIT #2: Well there are indeed several CMD tools that merge PDFs. However, these tools don't seem to, AFAIK, to preserve the forms in the original PDFs! These tools appear to simply just concatenate the printouts of all those PDFs into a single Printout, which is then presented as a single PDF.
Furthermore, If you printout a PDF file with forms into a file, you lose all the forms in it. This clearly not what I'm looking for.
I have found success using pdftk, which is an open-source software that runs on linux and can be called from your terminal.
To concatenate multiple pdfs into one (and preserve form-fillable elements), you can use the following command:
pdftk input1.pdf input2.pdf cat output output-file.pdf

How to print an NUnit test run's XML file as a nice-looking report on the command line?

I have a suite of NUnit tests. When they finish, I get a TestResults.xml file. This file is very large and dense; I'd like to be able to peruse a simple human-readable report of the underlying results. I'm led to believe that the provided nunit-console program can do that, but I can't figure out how.
How can I print the information described by TestResults.xml with nunit-console?
Note that running the tests is not the problem; my problem is figuring out how to display the results on the command-line. I can't change how the tests are run, but I can do whatever I want with the results file.
The Test Result file isn't intended to be human-readable, except when used for debugging. It's a source for all the data about a test run from which human-readable reports may be generated.
There are two ways to generate a report
As a part of the test run itself.
After the run is finished, using the test result xml file.
Reports generated as part of the test run require a report writing extension. You would write such an extension following the documentation to produce the report in whatever format you require, like text or html, and give it a unique tag likemyreport.
You would install your extension and could then run the console runner including an option like
--result:somefile.html;format=myreport
As you may guess, creating your own extension is a relatively advanced use of NUnit.
Another option, if you are familiar with XSLT processing, is to use the built-in report format user, together with an XSLT transform. In that case, the option is something like
--result:somefile.html;transform=mytransform.xslt
You can also produce a report after the run is finished using the XML output file. The NUnit console program is not used in this case. You must use some standard program for creating reports from NUnit output (or a generic program taking XSLT transforms) or write your own program.

Code folding in Live Scripts

Is there a way to fold sections of codes in Live Scripts as there is in regular scripts?
I have tried to look for it in the preferences and enabled all kind of foldings, but none of them relate to the Live Scripts. I would expect it to work since the notation of %% is similar in both types of scripts.
Any idea how to enable/workaround this?
No, I don't believe you can do this. Seems like a nice thing to want to do, though, so I would enter an enhancement request with MathWorks. I have no suggestion for a workaround, I'm afraid.
I know this is old but in case anyone else is wondering, below are the workarounds suggested to me by tech support when I submitted an enhancement request. I encourage the reader to add their vote by submitting a request if they still want to see this feature added to the live editor.
Convert to M file and "publish" with 'showcode' as false. First, convert the Live Script into an M file. You can do this interactively
by clicking "Save As" and then choosing the "M" file option in the
File Type section or you can do it programmatically as follows:
>> matlab.internal.liveeditor.openAndConvert('live_script_to_be_converted.mlx',
'output_script.m');
Once you have the converted M file which has all the section breaks
and formatting, you can use the "publish" function as follows from the
MATLAB Command Window:
>> options.format = 'pdf';
>> options.showCode = false;
>> publish('output_script.m',options)
This will publish the PDF file to a sub-directory called "html" inside
the current working directory.
Here is a documentation link for the "publish" function and
specifically, the "showCode" option:
https://www.mathworks.com/help/matlab/ref/publish.html#input_argument_namevalue_d119e823467
Please note, when saving the MLX file as M file and then publishing,
it does not convert the LaTeX expressions to something readable. It
also automatically inserts a table of contents at the beginning.
Encapsulate the code in another script or function. An alternate approach would be for you to encapsulate the code you want to hide in
another script or function and call it from your published Live
Script. For example, something like:
>> %% Now plot a figure
>> functionThatPlotsAFigure
In this case, instead of publishing all the plotting code, only the
call to the plotting function would be published.
Publish the Live Script as an HTML and then modify the HTML page to hide the code sections and then publish it as a PDF.
The options stated above are simply workarounds as we do not currently have this functionality. A request has been submitted to our developers to add in this feature and they are considering this for future releases of MATLAB. We appreciate your feedback as we constantly strive to improve our products.

Validate against an Eclipse formatting profile from command line

I'm looking for a way to verify Java code against an Eclipse code formatting profile from the command line. The goal is to create a Mercurial hook which rejects any commit that doesn't match the profile. Is there a way to do this?
I'm aware of the possibility to call Eclipse's formatter from the command line. What I'm looking for is something which just validates (yes/no). I guess I could use the formatter and then compare the two, but it seems like a clumsy approach.
Background: The reason we want to try this is because we currently get many unnecessary merge conflicts because of formatting differences. We have an environment where multiple IDE:s are used, although only one is officially supported. We want to enforce the official profile, and everyone can continue using the tools they prefer as long as they set it up to format the code correctly.
In brief, follow those steps:
Duplicate the original Java file in a temporary place ;
Format the temporary duplicate using the Eclipse Java code formatter ;
Check whether the files are identical or not.
Tricks to help you out:
To call the Eclipse Java code formatter from command line, see Formatting your code using the Eclipse code formatter.
To know whether files are identical, using the diff utility: diff --text --quiet >/dev/null, the error code will tell you what you're seeking for.

Generating dgml files from command line

Is there a command line tool to generate the dgml file from a list of dlls?
I have tried graphcmd.exe, this only further simplifies an already generated dgml file.
Are there any command line options in the visual studio ultimate through which we can achieve this?
The reason that i ask this is, i would like to generate the dgml files as part of the continuous integration, and further process each file to get the integrated dependency graphs of all individual components involved in the system.
GraphCmd can crack assemblies and produce DGML output. But it cannot produce a complete top down dependency graph with groups by namespace and class and so on. But if you use the Architecture Explorer "Select Files...", point at an assembly, select the types and members that you are interested in, then click "Save Query" in the vertical AE toolbar on the left, then open the resulting .dgql file you will see how it works. Then you can pass this query to GraphCmd using "-query" argument.
Unfortunately this isn't possible in VS 2010. You can only generate dgml diagrams from inside VS. If you're looking to manage your dependencies as part of your build you may want to look at VS 2010 layer validation.