Filter uncategorized tests in vstest.console.exe - vstest

I have a visual studio test assembly. There are several test methods of which a few methods have TestCategoryAttribute on them and others don't. I want to filter out all the methods that do not contain the attribute from getting executed, i.e, uncategorized tests should not be executed.
I am trying to have something like this which does not work.
vstest.console.exe MyTests.dll /TestCaseFilter:"(TestCategory!=)"
Looking for the right syntax. I am using Visual Studio 2015.

Related

Visual Studio 2019 - CMake Linux - Where to get list of macros?

When working with the CMake Linux project in Visual Studio 2019, every json file (e.g. task.vs.json, launch.vs.json) magically uses macros like:
${workspaceRoot}
${env.xxx}
${debugInfo.xxx}
${cmake.xxx}
How can one know the full list of options when documentation is scarce, and IntelliSense does not help? For the case of MSBuild, usually there will be a window of all the possible variables, along with their resolved values.
As an aside, is there a way to define variables at a per-user leve, so files like launch.vs.json can take take it in? For example, defining targetAddr=192.168.1.2, and then use ${targetAddr} in the json file. One method is to define the variable in the json file itself, but I wish to commit the file as a "default" for team members, and let team members inject values through variables, without making the json file "dirty".

wxwidget overloaded functions "wxToolbar::Addtool"

Good day.
I'm working on a GUI application using WxWidget in Visual Studio 2017. I've encountered this error:
No instance of overloaded functions "wxToolbar::Addtool"matches the
argumentlist argument are: (wxStandardID, wxBitmap,conts wchar_t[17] object type is : wxToolbar)
I had managed to bring down the errors from twenty-five to six, but the error above doesn't go away
(I've claned and restarted my IDE). The code below is where the issue is occurring:
wxToolBar *toolbar = CreateToolBar();
toolbar->AddTool(wxID_EXIT, exit, wxT("Exit application"));
toolbar->Realize();
It looks like the Wxwidget version you are programming with is >2.9. Looking the documentation,
the method for parameter overloading : toolbar1->AddTool(wxID_ANY, save, wxT("")); had been deprecated, would advice you study this before you start coding.
Happy coding.

VS2012 debug visualisation problems

I am using the natvis system to make debugging my custom types easier.
I have a simple array type that I wish to make expandable...
<Type Name="Array<*>">
<DisplayString>used={m_used} ptr={m_ptr}</DisplayString>
<Expand>
<ArrayItems>
<Size>m_used</Size>
<ValuePointer>m_ptr</ValuePointer>
</ArrayItems>
</Expand>
</Type>
I have enabled natvis parser debugging using the EnableNatvisDebugger=0x0000001 reg key
When I run the program and hover over my array in the debugger, I get the following output
.natvis(25,26): Successfully parsed expression 'm_used' in type context 'Array<int>'.
.natvis(25,32): Successfully parsed expression 'm_ptr' in type context 'Array<int>'.
.natvis(28,15): Successfully parsed expression 'm_used' in type context 'Array<int>'.
.natvis(29,23): Successfully parsed expression 'm_ptr' in type context 'Array<int>'.
Unfortunately the visualiser only seems to work when hovering over items and pinning them in the code window. It does not work in any of the watch windows. Also the child item expansion doesn't work at all either.
I am running the following version of VS2012
Microsoft Visual Studio Professional 2012
Version 11.0.61030.00 Update 4
Microsoft .NET Framework
Version 4.5.50938
I have disabled Edit and Continue, and switched off support for Managed C++ Compatability.
I should probably mention that none of the visualisations for the STL work either.
I am a bit stumped.

how to dump all gradle values used for build

we have a multi-project gradle build in android studio. every now and then we have to change something in it, and usually its only 1 or two lines of code, but its never easy knowing where to put those. I find it quite hard to know which properties exist where so I would love to have something like dump-everything where I could see all properties and their children at the point in time, this would make changes much easier
I have found this
def void explainMe(it){
//println "Examining $it.name:"
println "Meta:"
println it.metaClass.metaMethods*.name.sort().unique()
println "Methods:"
println it.metaClass.methods*.name.sort().unique()
println "Depends On:"
//println it.dependsOn.collect({it*.getName()})
println "Properties:"
println it.properties.entrySet()*.toString()
.sort().toString().replaceAll(", ","\n")
}
which is OK, but I would like to call it on top level scope and for all its children recursively, and in best case store output to file to be able to search through it. any idea would be appreciated? alternatively would it be possible to attach debugger to gradle build and inspect /watch variables inside?
thanks
Gradle has very specific support for inspecting certain parts of the build model (gradle tasks, gradle help --task taskName, gradle properties, gradle projects, gradle dependencies, gradle dependencyInsight, etc.), but doesn't currently have a generic feature for deep inspection of arbitrary build model properties and their values. Instead one would typically add some printlns to the build script and/or consult the Gradle Build Language Reference.
To answer your second question, a Gradle build can be debugged in the same way as any other external application. The necessary JVM args (typically provided by the debugger) can be set via the JAVA_OPTS or GRADLE_OPTS environment variable. It's probably best to execute Gradle with --no-daemon when debugging.

Typescript giving "Output Generation Failed" in Visual Studio 2012 with 0.9.5

I've been using Typescript 0.9.5 for the last few days, and then suddenly today the JavaScript files just stopped being generated. I see an error "Output generation failed" in the Visual Studio status bar, but nothing in any of the output windows.
I've rebooted, and restarted Visual Studio, disabled Web Essentials, tried all the usual things.
The files are set as TypescriptCompile in the properties. I've tried adding new files, or editing old ones with no effect. The Project file hasn't been changed as far as I can tell (its in TFS and none of the TypeScript sections have been altered).
I've made sure both files are checked out, still nothing.
Update: I've managed to compile manually using tsc.exe from the command line, so it must be something in Visual Studio.
OK, so I solved the problem.
One of my files contained invalid typescript, specifically trying to export a class when not inside a module. This caused all typescript files to fail to generate, but with no useful error message.
The following file would cause the problem:
export class Test {
public DoSomething() {
}
}
Either removing the export keyword, or adding a wrapping module solved the problem.
I've raised it as an issue here: https://typescript.codeplex.com/workitem/2109
Update: More details.
The above syntax is valid if you are using the CommonJS or AMD module patterns.
To enable this in visual studio you need to edit the .csproj file and insert a new PropertyGroup:
<TypeScriptModuleKind>AMD</TypeScriptModuleKind>
If you have an export outside of an internal module Typescript tries to compile it as either commonjs or amd module format. The compilation will fail if the a --module flag is not present on the command line. Use your project properties to set it to the desired value (probably amd in your case).
More info on TypeScript modules : http://www.youtube.com/watch?v=KDrWLMUY0R0&hd=1

Resources