Stating multiple traits with xunit console? - xunit

I can find nothing concerning what I would consider a rather obvious question.
The xunit.console.clr4 commandline arg help status this:
usage: xunit.console.clr4 <xunitProjectFile> [options]
usage: xunit.console.clr4 <assemblyFile> [configFile] [options]
Valid options:
/silent : do not output running test count
/teamcity : forces TeamCity mode (normally auto-detected)
/wait : wait for input after completion
/trait "name=value" : only run tests with matching name/value traits
: if specified more than once, acts as an OR operation
/-trait "name=value" : do not run tests with matching name/value traits
: if specified more than once, acts as an AND operation
Valid options for assemblies only:
/noshadow : do not shadow copy assemblies
/xml <filename> : output results to Xunit-style XML file
/html <filename> : output results to HTML file
/nunit <filename> : output results to NUnit-style XML file
so it's clear how to format the cl option to specify a single trait rule:
/trait "MyTrait=LongTest"
but what if I wanted to state multiple traits on the same run? Do I add mulitiple /trait entries, e.g.,
/trait "MyTraits=LongTest" /trait "MyTraits=MediumTest"
? thanks for any help on this.

As the help states:
/trait "name=value" : only run tests with matching name/value traits
: if specified more than once, acts as an OR operation
You have to add multiple /trait entries.

Related

DaCe build files

I am using the DaCe framework in Python and would like to generate SDFGs that take command line arguments. I like the sample file DaCe offers and would like to use it as a base for this. However, arguments of the SDFG are defined at the start of the sample file and overwrites any command-line inputs.
Is there any way I could tell DaCe to make an exception and not redefine those variables when creating the sample file?

CMake: How to add a custom variable for user macro with a value that depends on build configuration?

I use CMake version 3.16.
I tried the following:
set_property(TARGET ${PLUGIN_NAME} PROPERTY VS_GLOBAL_FR_VERSION
$<$<CONFIG:Debug2017>:"2017">
$<$<CONFIG:Release2017>:"2017">
$<$<CONFIG:Debug2018>:"2018">
$<$<CONFIG:Release2018>:"2018">
$<$<CONFIG:Debug2019>:"2019">
$<$<CONFIG:Release2019>:"2019">
)
And it kind of worked...
This variable (FR_VERSION) is supposed to be used in a script that is launched after build. This is how it looks:
add_custom_command(TARGET ${PLUGIN_NAME} POST_BUILD
COMMAND echo $(FR_VERSION)
COMMENT "This command will copy files to dist"
VERBATIM
)
In Visual Studio, however, we got the following:
echo $<$<CONFIG:Debug2017>:"2017">;$<$<CONFIG:Release2017>:"2017">;$<$<CONFIG:Debug2018>:"2018">;$<$<CONFIG:Release2018>:"2018">;$<$<CONFIG:Debug2019>:"2019">;$<$<CONFIG:Release2019>:"2019">
which fails to execute with the error message:
"The syntax of the command is incorrect."
If I don't try to set a different value for different build configs like this:
set_target_properties(${MAYA_PLUGIN_NAME} PROPERTIES VS_GLOBAL_FR_MAYA_VERSION "2018")
then the post-build script is generated as expected. (But this is not acceptable to me, because I need different parameter values for different build configurations).
I would appreciate any advice at this point.
Some target properties support generator expressions, while others do not. The documentation for a property will explicitly say that generator expressions are supported. Take the COMPILE_FEATURES property, for example:
Contents of COMPILE_FEATURES may use “generator expressions” with the syntax $<...>.
The documentation for VS_GLOBAL_<variable> does not have such language. Thus, as suggested, you can put the generator expression directly in the add_custom_command() call, which is supported:
add_custom_command(TARGET ${PLUGIN_NAME} POST_BUILD
COMMAND echo $<$<CONFIG:Debug2017>:"2017">
$<$<CONFIG:Release2017>:"2017">
$<$<CONFIG:Debug2018>:"2018">
$<$<CONFIG:Release2018>:"2018">
$<$<CONFIG:Debug2019>:"2019">
$<$<CONFIG:Release2019>:"2019">
COMMENT "This command will copy files to dist"
)

Jasmine-node CLI: Specify file match parameter

I'm trying to execute just a subset of my node jasmine tests.
I have a project structure as follows
root
+ server
+ invite
+specs
inviteSendSpec.js
inviteConfirmSpec.js
.. many more spec files
+ auth
+specs
.. many spec files
I can execute all tests from root by running:
node-jasmine --verbose server/
I'm trying to figure out how to use the -m parameter, so that I can just run the test matching a certain file name pattern.
e.g.
node-jasmine --verbose -m invite server/
should run all tests which contain invite, according to the few examples I've found. But instead it just finds one single test.
If I try to run a similar variation e.g.
node-jasmine --verbose -m send server/
it will find no tests.
What is the correct syntax for selecting a subset of tests?
p.s. I'm running jasmine-node 11.1.0 (so its not the walkdir issue)
-m or --match parameter is indeed used for file name matching.
I banged my had against the keyboard for couple of hours, and ended up looking at source for cli.js.
So here is the ticket (cli.js, line 228):
var regExpSpec = new RegExp(match + (matchall ? "" : "spec\\.") + "(" + extensions + ")$", 'i')
Aha!
First, you MUST specify --matchall key, otherwise it will use default "spec" prefix.
Second, there is no way you can specify extensions, they are either js or js|coffee|litcoffee if you use --coffee command line parameter
My test files have unit.js suffix (do not ask why), so I ended up with
cli.js --verbose --matchall --match unit\. --test-dir C:\MyProject\
and it did the job.
Your file names are right and
from the docs github.com/mhevery/jasmine-node
Note: your specification files must be named as *spec.js, *spec.coffee
or *spec.litcoffee, which matches the regular expression
/spec.(js|coffee|litcoffee)$/i; otherwise jasmine-node won't find
them! For example, sampleSpecs.js is wrong, sampleSpec.js is right.
You just need to run the hole folder:
node-jasmine --verbose server/invite/specs/
node-jasmine --verbose server/auth/specs/

Run command with parameters in batch file

Assume a psuedo command:
psuedocmd.exe
It has various parameters like:
/scan /save /savefolder
Now i want to run psuedocmd.exe using batch file.
And i would like to use parameters too.
I am using the following line in batch file
psuedocmd.exe /scan /save
But in this case psuedocmd.exe is running without the parameters.
Try putting parameters between quotes "parameter value", especially if paths have spaces in them.
Check if the batch text file is not saved in some encoding making your / be read as an escape character.
If you want to run the .exe by handing over parameters from the batchfile, don't use variables, just use %1, %2, etc.
run.bat /save /folder
Where run.bat's contents are:
pseudocommand.exe %1 %2
Hehe, after over half a year, I'm out of patience..
You must provide the savefolder parameter when using the save parameter in Acunetix Web Vulnerability Scanner, making that line in your batch-file look like:
wvs_console.exe /scan "http://www.aaa.com" /save /savefolder "c:\log"
Excerpt from the documentation:
/scan Scans a single website.
Syntax: /scan [url]
Example: /scan http://testphp.vulnweb.com
/save Saves scan once scan is finished. The file will be
saved in the location specified by the “/savefolder” switch.
Syntax: /save
/savefolder Specify the folder were all the scans and other
scan related files will be saved.
Syntax: /savefolder [directory]
Example: /savefolder C:\Acunetix\Scans

What is output at the different MSBuild output verbosity levels?

What is the definition of what is output at the different levels of MSBuild build output verbosity?
Quiet
Minimal
Normal
Detailed
Diagnostic
There exists the same question on social.msdn:
Quiet: only shows the result of your build.
Minimal: shows some configurations of your msbuild, and the CSC task.
Normal: This will show all the targets and its mainly steps.
Details: In addition to normal, this flag shows the task and it's implementation within the each target.
Diagnostic: Contains all the information that a MSBuild need and produce, it's switches, parameteres, prerequisites and etc. The input parameter of the target and task, and also contains the value of the input and output parameter, the detail steps of the task execution. The time execution for each task.
See how default logger uses verbosity here.
From learn.microsoft.com
Verbosity Settings
The following table shows how the log verbosity (column values) affects which types of message (row values) are logged.
Something that I could not find in the MS docs, but worked out through experimentation: at -v:m (i.e. minimal verbosity) you can still get the cmd for each step echoed by adding -clp:ShowCommandLine. That combo is substantially quieter than -v:n ("normal" verbosity, i.e. the default), but still gives you the cmd echo. At -v:q however, there's no cmd echo even with -clp:ShowCommandLine added. Sadly, -v:q doesn't actually suppress the tool banner of msbuild itself, you also have to add -nologo for that. (See my answer to another Q for the experiments/details on this affair.)
Also, as someone else discovered: at minimal and quiet verbosity you'll get no stdout from the tools, meaning msbuild suppresses that passthrough, otherwise present at normal and above verbosity. I'm not sure about stderr output from the tools, i.e. whether -v:m suppresses that too or if you need -v:q to suppress stderr passthrough. That needs an additional experiment...

Resources