Visar inlägg med etikett Tools. Visa alla inlägg
Visar inlägg med etikett Tools. Visa alla inlägg

lördag, maj 17, 2008

NUnit runners with memory leak, and the solution

I found amazingly few references to people having problem with the NUnit test runners. We came to a point where the the NUnit test runners consumed over one gigabyte of memory and the same tests run from Resharpers test runner from inside Visual Studio would only consume about 250 megabyte of memory. I also found that the memory was not released between assemblies if you run a NUnit project file with multiple assemblies.

The problem was that a reference to each TestFixture decorated class was kept in the result even if it was unnecessary. Or to be more specific, the Fixture part of the result released it's reference to the tested Fixture class after TestFixtureTearDown, but the TestMethod in the result kept a reference to the very same Fixture...To find out about this I used a nice memory profiler, SciTech's .NET Memory Profiler

I posted a patch to the NUnit project on SourceForge. With this patch the nunit-console test runner use about the same amount of memory as the Resharper one, and I suppose this would be the case for the GUI one too, since this was a change in the core.

måndag, februari 25, 2008

Nice, smart and simple GUI testing

If you would like to test your windows GUI, try this Test Automation Fx.
You will get a new project in Visual Studio 2005 and 2008 and a designer to create your test project.
Then you record some clicks in your application to test. The designer generates C# or VB.NET code.
You can run the test to verify that your application behaves ;o)
It's nice that the output is .NET code so we can make adjustment if we need to. And even better, the recorded clicks doesn't only use stupid coordinates, but it identifies and finds buttons by name :o) So it could handle some changes without breaking the tests.
It works for both native and .NET applications.
It's a beta, but definitely worth looking at.

tisdag, januari 08, 2008

The old find in files error

Sometimes when I try FindInFiles in Visual Studio, I can get this error:
"No files were found to look in.Find was stopped in progress." in Visual Studio 2003, 2005 and now also in 2008
...the solution is to press Control + Scroll Lock.

I used to believe VisualAssist had something to do with it, but in VS 2008 I only use ReSharper, so I suppose Visual Studio itself is the problem?

onsdag, november 07, 2007

Switch between VS 2005 and VS 2008

I have made two small scripts that make it possible to develop using Visual Studio 2008 Beta 2 in a group using Visual Studio 2005.
And I'm sure these scrips could be very usefull if you want to make some other batch search replace on some files.

Surely my scrips don't cover all solution files but I'm sure you could modify them to cover your solutions.
As a base I use RxFind a regular expression search and replace, command line tool I found at CodePlex. To make it more usefull for this case I made a couple of small modifications.
I added the possiblity to take the search and replace expressions from an input file. This makes it easier to handle line breaks and "-characters in the expressions. When you avoid a few of the escape characters, it is much easier to read.

Use it like this.
  • Modify the file name and path in the first rows of the batch files.
  • Open your Visual Studio 2005 solution that should be under version control., in Visual Studio 2008 (Beta 2)
  • Let the conversion wizard do it's job.
  • Let your version control system show which files where modified
  • Try to run: "first time to2005.bat"
  • In the ideal world the solution should now not contain any modifications and it should be possible to open it in VS 2005 like before.
  • Run to2008.bat, it should now be possible to open the solution in VS 2008.
  • Run to2005.bat, if there are some modifications you want to commit, do so.
Runing this back and forth, I found a few small changes that I wanted to do in the project files. Changes that should be there in both the 2005 and the 2008 version of the files.

* If my script and your modifications work you should be able to work like this, using subversion/cvs terminology:

10 Checkout
15 run to2008.bat
20 Use the project in VS 2008
30 Make updates and so on
40 Run to2005.bat build and run the tests (I do this from the command line)
50 commit
60 Goto 15 ;o)

BTW The script are made for C# but could probably be modified for VB very easily, if there are some real VB-hacker out there...
If you have spaces in your solution file name or in the path where you put your tool, you would have to add a few "" in the batch file, but since i didn't need it. I leave it as an exercise for the reader.
One of the benefits I get out of this is that I can avoid conflicts between my favorite VS add in for C++(Visual Assist) which I use in VS 2005 and my favorite/current VS add in for C# (ReSharper) that I use in VS 2008.

Download scripts

Download updated source for RxFind

fredag, april 06, 2007

Partition and Burn

I was about to shrink my old XP partition. And I have read about a free partitioning program GPartedLiveCD, but first I confused it with GNU Parted the difference is that GParted adds a GUI.
There are instructions to boot GParted from an USB stick, but that didn't work at the first try. And I didn't want to spend hours rebooting to get it working. So I decided to make a LiveCD instead. I have not installed any CD burning program in Vista, since the operating system should be able to handle it on it's own. But how to burn an iso image?
I found a really small and nice download (378 kB) - ISO Recorder.
That adds a context menu command for ISO files that starts a simple wizard too burn the image.

Since the partition I shrunk, was the startup one, I was not suprised when I had to put in the installation disk to make a repair to make Vista boot again. I did physically move the Vista partition. And after the quick repair of the boot info, it worked fine.

måndag, mars 26, 2007

Office eller OpenOffice

Att nu leva utan Office? Försöker ju använda det så lite som möjligt, så det borde väl inte vara så svårt? Installerade OpenOffice igår och avinstallerade Office 2007 idag. Redan innan jag avinstallerade Office, började jag känna av lite problem. Satt på ett möte och diskuterade ett Word-dokument, jag hade öppnat det i OpenOffice - det visades ganska ok. Men någon av sidorna blev något längre, så jag hade inte samma radbrytning som de andra. De hänvisade till en sida och jag satt och bläddrade lite desperat fram och tillbaka.
Men på eftermiddagen råkade någon på .NET Rocks! nämna viewers för Office-dokument, inget nytt, men jag hade inte tänkt på dem.
Så nu har jag installerat:
Trevligt små nätta applikationer om man jämför med en stor officeinstallation. Och med FileFormatConvertern för 2007-formaten, så känner jag mig mer redo än de flesta "vanliga" Officeanvändare att ta mig an de flesta dokument som folk kan tänkas attackera mig med.
Min egen produktion i dokumentväg blir ju förstås ifrån OpenOffice och kanske i de flesta fallen som PDF:er för bästa möjliga flyttbarhet. PDF:er som givetvis bör läsas med Foxit-reader så mycket snabbare än orginalbesten. Men ett problem kvarstår, kunden jag jobbar åt använder Microsoft Exchange Server, och vad jag har lyckats hitta, så finns det bara ett alternativ till Outlook här, och det är Novell Evolution. Evolution är fämst avsett för Linux men finns även för Windows. Men än så länge bara för XP. Och pigg på att installera som jag är, så kör jag givetvis Vista sen länge.

torsdag, november 09, 2006

All Sysinternals tools in one download

Life has become a bit easier.
All the tools from Sysinternals in a single download. Sysinternals Suite
all of their wonderful tools in a 8 MB download. And this includes 68 executables, help files and some other files.

onsdag, november 08, 2006

The new tool from Sysinternals is released

Sysinternals / Microsoft have finally released Process Monitor which has the functionallity from the old Filemon and Regmon and adds a lot of nice features.
Perhaps the best improvement is non-destructive filters. So you can play around testing different filter settings, whithout destroying the log.
I just made a quick test, but it was nice. What are your system doing? Run process monitor, and it shows all registry and file activity...

måndag, oktober 23, 2006

Driver Verifier

Tittade på några av Mark Russinovich (ny blogadress)- Sysinternals framträdande på Tech Ed tidigare i år - i går. Man undrar ju var Process Monitor blir av. Vid framträdandet i juni sa Mark att det skulle släppas om ett par veckor. Men tyvärr har väl affären med Microsoft bromsat processen. Jag hoppas iallafall att den kommer så småningom. Process Monitor skulle alltså vara en kombination av Filemon och Regmon och lite till. Jag lärde mig ett och annat, man kan spara vilka program som autostartas i Autoruns. Det kan vara bra att göra innan man installerar ett program. Man kan sen jämföra före och efter, och de nya raderna blir gröna. Man kan dessutom göra samma sak utan att spara genom att ha Autorun startat under installatioonen och sen bara uppdatera vyn med F5.

Hur många känner till det inbyggda Microsoft verktyget Driver Verifier (system32\Verifier.exe)?

Om man installerar eller för all del själv utvecklar en driver, så kan man med Driver Verifier göra inställningar så att drivern kontrolleras hårdare. Det ger sämre prestanda, och blåskärm såfort drivern gör något otillåtet. Men alternativet kan vara att drivern lyckas skriva sönder minnet för en annan driver, som sen felaktigt kan få skulden för kraschen. Mark rekommenderar att man väljer alla inställningar utom Low resource simulation. Efter blåskärmen får man analysera kraschen med WinDbg....