Improved support for MbUnit, xUnit and Gallio

The main focus of the TestDriven.Net 2.18 release has been to improve support for test runner plug-ins in general (not just NUnit). If you’re using xUnit, MbUnit or Gallio – I recommend you upgrade to this version.

Automatic support for 64-bit machines

The registry layout on 64-bit machines is plain weird and full of pitfalls for the unwary. The registry layout is different depending on whether you’re installing under HKLM or HKCU. Under ‘HKLM’ the ‘SOFTWARE’ key is split and test runner plug-ins needed to be registered twice in order to work in both 32 and 64-bit processes. There is no such split under ‘HKCU’ and plug-ins installed there only needed to be registered once.

This created the unfortunate situation where plug-ins installed for ‘all users’ wouldn’t work when running in a 64-bit process, but plug-ins installed ‘just for me’ would work fine. Rather than expect plug-in developers to deal with this weirdness, I’ve made some changes to automatically support plug-ins that aren’t 64-bit aware.

If you have an assembly that needs to work on 32 and 64-bit machines, you may find the following snippet useful:

    public static RegistryKey OpenSoftwareKey(bool hklm, string name)
    {
        string fullName = @"SOFTWARE";
        if (hklm)
        {
            if (Marshal.SizeOf(typeof(IntPtr)) == 8)
            {
                fullName += @"\Wow6432Node";
            }
            return Registry.LocalMachine.OpenSubKey(fullName + @"\" + name);
        }
        return Registry.CurrentUser.OpenSubKey(fullName + @"\" + name);
    }

The following ad-hoc test will display TestDriven.Net’s install directory (assuming TestDriven.Net is installed ‘for all users’):

    void test()
    {
        using(var key = OpenSoftwareKey(true, @"MutantDesign\TestDriven.NET"))
        {
            Console.WriteLine(key.GetValue("InstallDir"));
        }
    }

Better support for ah-hoc tests

In previous versions of TestDriven.Net, a test runner plug-in was required to explicitly signal when none of its tests were found for execution. This would give other test runners (such as the ad-hoc test runner) a chance to handle the test. Unfortunately most test runners have been signaling a successful test run when tests were found but none were targeted.

I’ve changed it so the ad-hoc test runner will automatically get a chance to execute if no tests were executed and the test runner plug-in indicated a successful test run. The upshot of this is that you can now have ad-hoc side-by-side with MbUnit or xUnit tests.

If you’re using xUnit, try doing ‘Run Test(s)’ on each of the following methods:

    [Fact]
    public void TestMe()
    {
        Console.WriteLine("Console output isn't displayed when using xUnit");
        Assert.True(false, "Comment out [Fact] and run as ad-hoc test! ;)");
    }
    void hello()
    {
        Trace.WriteLine("Hello, World!");
    }
    void dump()
    {
        Trace.WriteLine(AppDomain.CurrentDomain, "_verbose");
    }

(ad-hoc tests should work side-by-side with all other test framework methods as well)

Improved performance when executing with Gallio / MbUnit v3

Gallio is a test runner that supports many different test types (MbUnit, xUnit, NUnit, MSTest and more). It has its own plug-in architecture and it doesn’t use the default TestDriven.Net app domain test isolation. This makes Gallio very flexible, but it also meant it wasn’t appropriate to setup and tear down the Gallio engine for each test run.

I’ve made some changes to allow Gallio to stay resident in the test process. This has significantly improved performance (especially for short test runs). If you’re using Gallio/MbUnit v3, try upgrading to Gallio v3.0.5 build 546 and see how much of a different it makes.

Feedback…

There have been lots of other changes which you can find in the release notes. If you notice any new issues, please don’t hesitate to let me know!

23 Comments

  • Hi Jamie,

    In previous versions nested fixtures were not supported correctly. Is that changed maybe in this new version or is there a chance to get it changed?


    Thanks,
    Vladan

  • Hi Vladan, Which unit testing framework are you using? It is the test runner plug-in that decides which tests to execute when a particular class is targeted.

  • Nested test fixtures work with Gallio v3.0.5. I use them in many places.

    If they don't, please file a bug!

  • Hey guys!

    Sorry for not responding earlier, I kind of forgot to recheck this post for additional comments :(

    Anyway, thank you both...Unfortunately Gallio in version 3.0.4,5,6 crashes my Visual Studio so I have no luck :(


    Cheers!

    Vladan

  • The wealth of the mind is the only wealth.

    -----------------------------------

  • -----------------------------------------------------------
    "There are definitely a lot of details like that to acquire into consideration. Which is a excellent position to bring up. I provide the ideas over as common inspiration but plainly there are inquiries just like the 1 you convey up wherever probably the most essential thing will be working in trustworthy very good faith. I don?t know if best practices have emerged all around issues like that, but I am certain that your work is clearly identified as a honest recreation. Anyhow, in my language, there aren't significantly very good source like this."

  • Hi. I learn a few of your other posts and needed to understand if you would be interested in exchanging blogroll hyperlinks?

    --------------------------------------------------------------------
    Interdisciplinary Coordinating Committees

  • pzpqa awnings vakdy

  • I am speechless. This is really a wonderful website and really partaking too. Exceptional perform! That is not truly a lot returning from an amateur author like me, but it's all I could consider following enjoying your posts. Good grammar and vocabulary. Not like other blogs. You really know what you are talking about very. So significantly that you just made me wish to investigate more. Your blog page has turn out to be a stepping stone for me, my buddy. Give thanks to you for your articulate journey. I really loved the 27 posts that We have learn so significantly.

    --------------------------------------------------------------------
    Folklore and Mythology

  • I was just looking for this details for some time. Immediately after 6 hours of continuous Googleing, at last I got it in your web site. I wonder what's the lack of Google technique that do not rank this type of informative internet sites in top of the list. Generally the leading internet sites are full of garbage.

  • Great blog! I genuinely adore how it's straightforward on my eyes and also the info are well written. I am wondering how I may be notified whenever a new post has been created. I've subscribed to your rss feed which should do the trick! Have a nice day!

  • Thanks for tris interesting information! I found it very useful =)

  • PxvZNf I am so grateful for your article post.Thanks Again. Will read on...


  • is the perfect day time bag with plenty of room for private and also business items. And it really is versatile. At any office or about the vacation you'll be regarded like a lady of favor with this tote in your shoulder.

  • Dau6oJ Thanks-a-mundo for the article.Really looking forward to read more. Really Cool.

  • joqqm jermichael finley jersey
    mkfzs ryan fitzpatrick jersey
    hiwvn matt ryan jersey
    zkxxp justin smith jersey
    zadvu brandon jacobs jersey

  • dkowz brian cushing jersey
    criyk desean jackson jersey
    ieskz ben roethlisberger jersey
    lrgmr colt mccoy jersey
    blzha ryan fitzpatrick jersey

  • vzege jason williams jersey
    sfoyr vince wilfork jersey
    hpenl ed reed jersey
    ypafr maurice jones-drew jersey
    hmwvu jeremy maclin jersey

  • ccvxx rashard mendenhall jersey
    ogvsk demarco murray jersey
    rzhbt ray rice jersey
    yhmll justin blackmon jersey
    lwqjh clay matthews jersey

  • hzqkh phil dawson jersey
    imeyb lance moore jersey
    fynic brandon jacobs jersey
    ohbcg maurkice pouncey jersey
    afuxr eric decker jersey

  • yyekj brett keisel jersey
    jxayd robert griffin iii jersey
    dhnzc lamichael james jersey
    amzjn matt ryan jersey
    bokgx wes welker jersey

  • Chicken Coop is mounted on 4 wheels and can be used in the Firefox, Safari,
    Chrome or another browser. The Internet Archive is already starting to track some BitTorrent statistics, which can often be the
    cause. Also if your Website is going to take it.

    B M 's software platform that is search optimized is fast becoming the single most important ingredient of a pressrelease, that will be legitimately beneficial.

  • I almost never comment, however after reading a few of the remarks
    on this page Improved support for MbUnit, xUnit and Gallio - TestDriven.
    NET by Jamie Cansdale. I do have a couple of questions for you if you don't mind. Is it only me or do some of these comments come across like they are left by brain dead folks? :-P And, if you are posting at additional places, I'd like to keep up with anything fresh you have to post.
    Could you post a list of all of all your shared sites like your twitter feed, Facebook page or linkedin profile?

Comments have been disabled for this content.