Unit testing device drivers

In the old days, that was how we tested and debugged device drivers. The very best way to debug such a system was for engineers to use the embedded system as a development system and—once adequate system maturity was reached— take away the original cross-development system! For your situation, several approaches come to mind: Add … Read more

Xcode 4.5 command line unit testing

Just thought I should also share what I did for a solution to this issue. I followed the solution outlined in https://stackoverflow.com/a/10823483/666943 but converted the ruby script to shell. At the end I basically installed ios-sim via homebrew and replace the Run Script in the Build Phases of my Test target with the following: if … Read more

Unit test and private vars

(Note that Swift 2 adds the @testable attribute which can make internal methods and properties available for testing. See @JeremyP’s comments below for some more information.) No. In Swift, private is private. The compiler can use this fact to optimize, so depending on how you use that property, it is legal for the compiler to … Read more

Which is better? Unit-test project per solution or per project?

Assemblies are a packaging/deployment concern, so we usually split them out because we don’t want to deploy them with our product. Whether you split them out per library or per solution there are merits to both. Ultimately, you want tests to be immediately available to all developers, so that developers know where to find them … Read more

Debugging Go tests in Visual Studio Code

To launch debugger for test I added one more configuration for launch.json { “version”: “0.2.0”, “configurations”: [ { “name”: “Code”, “type”: “go”, “request”: “launch”, “mode”: “debug”, “remotePath”: “”, “port”: 2345, “host”: “127.0.0.1”, “program”: “${workspaceRoot}”, “env”: {}, “args”: [], “showLog”: true }, { “name”: “Test Current File”, “type”: “go”, “request”: “launch”, “mode”: “test”, “remotePath”: “”, “port”: … Read more

Unable to simulate keypress event in Angular 2 unit test (Jasmine)

I’ve had some trouble simulating a keypress in a unit test also. But came across an answer by Seyed Jalal Hosseini. It might be what you’re after. If you’re attempting to simulate a keypress you can trigger an event by calling dispatchEvent(new Event(‘keypress’)); on the element. Here is the answer I’m referring to which gives … Read more

Can I run a single unit test from the command line for a Grails project?

Possibilities of things that might be wrong with your setup: Your command order is incorrect. What works for me is: grails test-app -unit Foo (where my test class is FooTests.groovy) You aren’t explicitly importing grails.test.GrailsUnitTestCase. I had some problems with it recognizing my tests when I didn’t import this. When I was extending GroovyTestCase, things … Read more