Commits

Matt Oswald committed 4d13511

added a utilities library

Comments (0)

Files changed (14)

xUnit++.Utility/TestAssembly.cpp

+#include "TestAssembly.h"
+
+#if !defined(WIN32)
+#include <cstdio>
+#include <dlfcn.h>
+#include <fcntl.h>
+#include <unistd.h>
+#endif
+
+namespace
+{
+#if defined(WIN32)
+    std::string CopyFile(const std::string &file)
+    {
+        char tempPath[MAX_PATH] = {0};
+        if (GetTempPath(MAX_PATH, tempPath) > 0)
+        {
+            if (GetTempFileName(tempPath, "xU+", 0, tempPath) != 0)
+            {
+                if (::CopyFile(file.c_str(), tempPath, FALSE))
+                {
+                    return tempPath;
+                }
+            }
+        }
+
+        return "";
+    }
+#else
+    std::string CopyFile(const std::string &file)
+    {
+        std::string result;
+
+        char buf[BUFSIZ];
+        size_t size;
+
+        char tempFile[] = "/tmp/xU+XXXXXX";
+
+        int source = open(file.c_str(), O_RDONLY, 0);
+        int dest = mkstemp(tempFile);
+
+        if (source > 0)
+        {
+            if (dest > 0)
+            {
+                while ((size = read(source, buf, BUFSIZ)) > 0)
+                {
+                    write(dest, buf, size);
+                }
+
+                result = tempFile;
+
+                close(dest);
+            }
+
+            close(source);
+        }
+
+        return result;
+    }
+#endif
+}
+
+namespace xUnitpp { namespace Utilities
+{
+
+TestAssembly::TestAssembly(const std::string &file)
+    : EnumerateTestDetails(nullptr)
+    , FilteredTestsRunner(nullptr)
+    , tempFile(CopyFile(file))
+    , module(nullptr)
+{
+    if (!tempFile.empty())
+    {
+#if defined(WIN32)
+        if ((module = LoadLibrary(tempFile.c_str())) != nullptr)
+        {
+            EnumerateTestDetails = (xUnitpp::EnumerateTestDetails)GetProcAddress(module, "EnumerateTestDetails");
+            FilteredTestsRunner = (xUnitpp::FilteredTestsRunner)GetProcAddress(module, "FilteredTestsRunner");
+        }
+#else
+        if ((module = dlopen(tempFile.c_str(), RTLD_LAZY)) != nullptr)
+        {
+            // so silly. ISO C++ forbids casting void * to a pointer-to-function
+            // but POSIX says "sure, go right ahead"
+            // this weird syntax works around that
+            *(void **)(&EnumerateTestDetails) = dlsym(module, "EnumerateTestDetails");
+            *(void **)(&FilteredTestsRunner) = dlsym(module, "FilteredTestsRunner");
+        }
+#endif
+    }
+}
+
+TestAssembly::~TestAssembly()
+{
+    if (module)
+    {
+#if defined(WIN32)
+        FreeLibrary(module);
+#else
+        dlclose(module);
+#endif
+    }
+
+    if (!tempFile.empty())
+    {
+#if defined(WIN32)
+        DeleteFile(tempFile.c_str());
+#else
+        std::remove(tempFile.c_str());
+#endif
+    }
+}
+
+bool TestAssembly::is_valid() const
+{
+    return EnumerateTestDetails != nullptr && FilteredTestsRunner != nullptr;
+}
+
+TestAssembly::operator bool_type() const
+{
+    return is_valid() ? &TestAssembly::is_valid : nullptr;
+}
+
+}}

xUnit++.Utility/TestAssembly.h

+#ifndef TESTASSEMBLY_H_
+#define TESTASSEMBLY_H_
+
+#if defined(WIN32)
+#include <Windows.h>
+
+// thanks, Microsoft. "ReportEvent" isn't likely to be used anywhere else, ever
+#undef ReportEvent
+
+#endif
+
+#include <string>
+#include "xUnit++/ExportApi.h"
+
+namespace xUnitpp { namespace Utilities
+{
+
+class TestAssembly
+{
+private:
+    typedef bool (TestAssembly::*bool_type)() const;
+    bool is_valid() const;
+
+#if !defined(WIN32)
+    typedef void * HMODULE;
+#endif
+
+public:
+    TestAssembly(const std::string &file);
+    ~TestAssembly();
+
+    // !!!VS enable this when Visual Studio supports it
+    //explicit operator bool() const
+    //{
+    //    return module != nullptr;
+    //}
+
+    operator bool_type() const;
+
+    xUnitpp::EnumerateTestDetails EnumerateTestDetails;
+    xUnitpp::FilteredTestsRunner FilteredTestsRunner;
+
+private:
+    std::string tempFile;
+    HMODULE module;
+};
+
+}}
+
+#endif

xUnit++.Utility/xUnit++.Utility.vcxproj

+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="TestAssembly.cpp" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="TestAssembly.h" />
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <VCTargetsPath Condition="'$(VCTargetsPath11)' != '' and '$(VSVersion)' == '' and '$(VisualStudioVersion)' == ''">$(VCTargetsPath11)</VCTargetsPath>
+    <ProjectGuid>{C40C9047-855E-45D8-ADA8-9B98F3BE0F6C}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>xUnitUtility</RootNamespace>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <PlatformToolset>v110</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <PlatformToolset>v110</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <PlatformToolset>v110</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <PlatformToolset>v110</PlatformToolset>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\.build\output.props" />
+    <Import Project="..\.build\build.props" />
+    <Import Project="..\.build\debug.props" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\.build\output.props" />
+    <Import Project="..\.build\build.props" />
+    <Import Project="..\.build\debug.props" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\.build\output.props" />
+    <Import Project="..\.build\build.props" />
+    <Import Project="..\.build\release.props" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\.build\output.props" />
+    <Import Project="..\.build\build.props" />
+    <Import Project="..\.build\release.props" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup />
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <AdditionalIncludeDirectories>../xUnit++</AdditionalIncludeDirectories>
+    </ClCompile>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <AdditionalIncludeDirectories>../xUnit++</AdditionalIncludeDirectories>
+    </ClCompile>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <AdditionalIncludeDirectories>../xUnit++</AdditionalIncludeDirectories>
+    </ClCompile>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <AdditionalIncludeDirectories>../xUnit++</AdditionalIncludeDirectories>
+    </ClCompile>
+  </ItemDefinitionGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>

xUnit++.Utility/xUnit++.Utility.vcxproj.filters

+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <ClCompile Include="TestAssembly.cpp" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="TestAssembly.h" />
+  </ItemGroup>
+</Project>

xUnit++.VsRunner/Stdafx.h

-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently,
-// but are changed infrequently
-
 #pragma once
 
 #include <Windows.h>
+
+#undef ReportEvent

xUnit++.VsRunner/xUnit++.VsRunner.cpp

 #include "xUnit++/LineInfo.h"
 #include "xUnit++/TestDetails.h"
 #include "xUnit++/TestEvent.h"
+#include "TestAssembly.h"
 
 using namespace System;
 using namespace System::Collections::Generic;
         gcroot<ManagedReporter ^> reporter;
     };
 
-    class TestAssembly
+    class ManagedTestAssembly : public xUnitpp::Utilities::TestAssembly
     {
-    private:
-        typedef bool (TestAssembly::*bool_type)() const;
-        bool is_valid() const
+    public:
+        ManagedTestAssembly(const std::string &file)
+            : TestAssembly(file)
         {
-            return EnumerateTestDetails != nullptr && FilteredTestsRunner != nullptr;
         }
 
-    public:
-        TestAssembly(const std::string &file)
-            : EnumerateTestDetails(nullptr)
-            , FilteredTestsRunner(nullptr)
-            , module(nullptr)
+        ~ManagedTestAssembly()
         {
-            char tempPath[MAX_PATH] = {0};
-            if (GetTempPath(MAX_PATH, tempPath) > 0)
-            {
-                if (GetTempFileName(tempPath, "xU+", 0, tempPath) != 0)
-                {
-                    if (CopyFile(file.c_str(), tempPath, FALSE))
-                    {
-                        tempFile = tempPath;
-                        if ((module = LoadLibrary(tempPath)) != nullptr)
-                        {
-                            EnumerateTestDetails = (xUnitpp::EnumerateTestDetails)GetProcAddress(module, "EnumerateTestDetails");
-                            FilteredTestsRunner = (xUnitpp::FilteredTestsRunner)GetProcAddress(module, "FilteredTestsRunner");
-                        }
-                    }
-                }
-            }
         }
 
-        ~TestAssembly()
-        {
-            if (module)
-            {
-                FreeLibrary(module);
-            }
-
-            if (!tempFile.empty())
-            {
-                DeleteFile(tempFile.c_str());
-            }
-        }
-
-        // !!!VS enable this when Visual Studio supports it
-        //explicit operator bool() const
-        //{
-        //    return module != nullptr;
-        //}
-
-        operator bool_type() const
-        {
-            return is_valid() ? &TestAssembly::is_valid : nullptr;
-        }
-
-        xUnitpp::EnumerateTestDetails EnumerateTestDetails;
-
         void AddTestCase(TestCase ^test)
         {
             tests.push_back(gcroot<TestCase ^>(test));
         }
 
     private:
-        xUnitpp::FilteredTestsRunner FilteredTestsRunner;
-        std::string tempFile;
-        HMODULE module;
         std::vector<gcroot<TestCase ^>> tests;
     };
 
         auto result = gcnew Dictionary<String ^, TestCase ^>();
 
         auto source = marshal_as<std::string>(_source);
-        if (auto assembly = TestAssembly(source))
+        if (auto assembly = ManagedTestAssembly(source))
         {
             auto uri = gcroot<Uri ^>(_uri);
             auto dict = gcroot<Dictionary<String ^, TestCase ^> ^>(result);
 
 bool VsRunner::RunTests(IEnumerable<TestCase ^> ^tests, ITestExecutionRecorder ^recorder)
 {
-    std::map<std::string, std::shared_ptr<TestAssembly>> assemblies;
+    std::map<std::string, std::shared_ptr<ManagedTestAssembly>> assemblies;
 
     for each (TestCase ^test in tests)
     {
         auto source = marshal_as<std::string>(test->Source);
         if (assemblies.find(source) == assemblies.end())
         {
-            if (auto assembly = std::make_shared<TestAssembly>(source))
+            if (auto assembly = std::make_shared<ManagedTestAssembly>(source))
             {
                 assemblies.insert(std::make_pair(source, assembly));
             }

xUnit++.VsRunner/xUnit++.VsRunner.vcxproj

   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
-      <PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PrecompiledHeader>Use</PrecompiledHeader>
-      <AdditionalIncludeDirectories>../xUnit++</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../xUnit++;../xUnit++.Utility</AdditionalIncludeDirectories>
       <SmallerTypeCheck>false</SmallerTypeCheck>
     </ClCompile>
     <Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <ClCompile>
-      <PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PrecompiledHeader>Use</PrecompiledHeader>
-      <AdditionalIncludeDirectories>../xUnit++</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../xUnit++;../xUnit++.Utility</AdditionalIncludeDirectories>
+      <SmallerTypeCheck>false</SmallerTypeCheck>
     </ClCompile>
     <Link>
       <GenerateDebugInformation>true</GenerateDebugInformation>
   </ItemDefinitionGroup>
   <ItemGroup>
     <Reference Include="Microsoft.VisualStudio.TestPlatform.ObjectModel">
-      <HintPath>..\..\..\..\..\..\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll</HintPath>
+      <HintPath>C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll</HintPath>
       <Private>false</Private>
     </Reference>
     <Reference Include="System" />
     <ClCompile Include="xUnit++.VsRunner.cpp" />
   </ItemGroup>
   <ItemGroup>
+    <ProjectReference Include="..\xUnit++.Utility\xUnit++.Utility.vcxproj">
+      <Project>{c40c9047-855e-45d8-ada8-9b98f3be0f6c}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\xUnit++\xUnit++.vcxproj">
       <Project>{25df3961-f288-4a96-ae6b-a4950a00ab8e}</Project>
     </ProjectReference>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
+</Project>

xUnit++.console/TestAssembly.cpp

-#include "TestAssembly.h"
-
-#if !defined(WIN32)
-#include <cstdio>
-#include <dlfcn.h>
-#include <fcntl.h>
-#include <unistd.h>
-#endif
-
-namespace
-{
-#if defined(WIN32)
-    std::string CopyFile(const std::string &file)
-    {
-        char tempPath[MAX_PATH] = {0};
-        if (GetTempPath(MAX_PATH, tempPath) > 0)
-        {
-            if (GetTempFileName(tempPath, "xU+", 0, tempPath) != 0)
-            {
-                if (::CopyFile(file.c_str(), tempPath, FALSE))
-                {
-                    return tempPath;
-                }
-            }
-        }
-
-        return "";
-    }
-#else
-    std::string CopyFile(const std::string &file)
-    {
-        std::string result;
-
-        char buf[BUFSIZ];
-        size_t size;
-
-        char tempFile[] = "/tmp/xU+XXXXXX";
-
-        int source = open(file.c_str(), O_RDONLY, 0);
-        int dest = mkstemp(tempFile);
-
-        if (source > 0)
-        {
-            if (dest > 0)
-            {
-                while ((size = read(source, buf, BUFSIZ)) > 0)
-                {
-                    write(dest, buf, size);
-                }
-
-                result = tempFile;
-
-                close(dest);
-            }
-
-            close(source);
-        }
-
-        return result;
-    }
-#endif
-}
-
-namespace xUnitpp
-{
-
-TestAssembly::TestAssembly(const std::string &file)
-    : EnumerateTestDetails(nullptr)
-    , FilteredTestsRunner(nullptr)
-    , tempFile(CopyFile(file))
-    , module(nullptr)
-{
-    if (!tempFile.empty())
-    {
-#if defined(WIN32)
-        if ((module = LoadLibrary(tempFile.c_str())) != nullptr)
-        {
-            EnumerateTestDetails = (xUnitpp::EnumerateTestDetails)GetProcAddress(module, "EnumerateTestDetails");
-            FilteredTestsRunner = (xUnitpp::FilteredTestsRunner)GetProcAddress(module, "FilteredTestsRunner");
-        }
-#else
-        if ((module = dlopen(tempFile.c_str(), RTLD_LAZY)) != nullptr)
-        {
-            // so silly. ISO C++ forbids casting void * to a pointer-to-function
-            // but POSIX says "sure, go right ahead"
-            // this weird syntax works around that
-            *(void **)(&EnumerateTestDetails) = dlsym(module, "EnumerateTestDetails");
-            *(void **)(&FilteredTestsRunner) = dlsym(module, "FilteredTestsRunner");
-        }
-#endif
-    }
-}
-
-TestAssembly::~TestAssembly()
-{
-    if (module)
-    {
-#if defined(WIN32)
-        FreeLibrary(module);
-#else
-        dlclose(module);
-#endif
-    }
-
-    if (!tempFile.empty())
-    {
-#if defined(WIN32)
-        DeleteFile(tempFile.c_str());
-#else
-        std::remove(tempFile.c_str());
-#endif
-    }
-}
-
-bool TestAssembly::is_valid() const
-{
-    return EnumerateTestDetails != nullptr && FilteredTestsRunner != nullptr;
-}
-
-TestAssembly::operator bool_type() const
-{
-    return is_valid() ? &TestAssembly::is_valid : nullptr;
-}
-
-}

xUnit++.console/TestAssembly.h

-#ifndef TESTASSEMBLY_H_
-#define TESTASSEMBLY_H_
-
-#if defined(WIN32)
-#include <Windows.h>
-
-// thanks, Microsoft. "ReportEvent" isn't likely to be used anywhere else, ever
-#undef ReportEvent
-
-#endif
-
-#include <string>
-#include "xUnit++/ExportApi.h"
-
-namespace xUnitpp
-{
-
-class TestAssembly
-{
-private:
-    typedef bool (TestAssembly::*bool_type)() const;
-    bool is_valid() const;
-
-#if !defined(WIN32)
-    typedef void * HMODULE;
-#endif
-
-public:
-    TestAssembly(const std::string &file);
-    ~TestAssembly();
-
-    // !!!VS enable this when Visual Studio supports it
-    //explicit operator bool() const
-    //{
-    //    return module != nullptr;
-    //}
-
-    operator bool_type() const;
-
-    xUnitpp::EnumerateTestDetails EnumerateTestDetails;
-    xUnitpp::FilteredTestsRunner FilteredTestsRunner;
-
-private:
-    std::string tempFile;
-    HMODULE module;
-};
-
-}
-
-#endif

xUnit++.console/main.cpp

 
     for (const auto &lib : options.libraries)
     {
-        auto testAssembly = xUnitpp::TestAssembly(lib.c_str());
+        auto testAssembly = xUnitpp::Utilities::TestAssembly(lib.c_str());
 
         if (!testAssembly)
         {

xUnit++.console/xUnit++.console.vcxproj

   <PropertyGroup Label="UserMacros" />
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
-      <AdditionalIncludeDirectories>../xUnit++</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../xUnit++;../xUnit++.Utility</AdditionalIncludeDirectories>
     </ClCompile>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <ClCompile>
-      <AdditionalIncludeDirectories>../xUnit++</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../xUnit++;../xUnit++.Utility</AdditionalIncludeDirectories>
     </ClCompile>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <ClCompile>
-      <AdditionalIncludeDirectories>../xUnit++</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../xUnit++;../xUnit++.Utility</AdditionalIncludeDirectories>
     </ClCompile>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <ClCompile>
-      <AdditionalIncludeDirectories>../xUnit++</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../xUnit++;../xUnit++.Utility</AdditionalIncludeDirectories>
     </ClCompile>
   </ItemDefinitionGroup>
   <ItemGroup>
     <ClCompile Include="CommandLine.cpp" />
     <ClCompile Include="ConsoleReporter.cpp" />
     <ClCompile Include="main.cpp" />
-    <ClCompile Include="TestAssembly.cpp" />
     <ClCompile Include="XmlReporter.cpp" />
   </ItemGroup>
   <ItemGroup>
+    <ProjectReference Include="..\xUnit++.Utility\xUnit++.Utility.vcxproj">
+      <Project>{c40c9047-855e-45d8-ada8-9b98f3be0f6c}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\xUnit++\xUnit++.vcxproj">
       <Project>{25df3961-f288-4a96-ae6b-a4950a00ab8e}</Project>
     </ProjectReference>
   <ItemGroup>
     <ClInclude Include="CommandLine.h" />
     <ClInclude Include="ConsoleReporter.h" />
-    <ClInclude Include="TestAssembly.h" />
     <ClInclude Include="XmlReporter.h" />
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

xUnit++.console/xUnit++.console.vcxproj.filters

     <ClCompile Include="main.cpp" />
     <ClCompile Include="CommandLine.cpp" />
     <ClCompile Include="XmlReporter.cpp" />
-    <ClCompile Include="TestAssembly.cpp" />
     <ClCompile Include="ConsoleReporter.cpp" />
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="CommandLine.h" />
     <ClInclude Include="XmlReporter.h" />
-    <ClInclude Include="TestAssembly.h" />
     <ClInclude Include="ConsoleReporter.h" />
   </ItemGroup>
 </Project>
 		{2F1709B8-9F5A-4625-9404-C348298181B7} = {2F1709B8-9F5A-4625-9404-C348298181B7}
 	EndProjectSection
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xUnit++.Utility", "xUnit++.Utility\xUnit++.Utility.vcxproj", "{C40C9047-855E-45D8-ADA8-9B98F3BE0F6C}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Win32 = Debug|Win32
 		{EDEB02E2-F389-4CBF-AE7D-3041A934F86B}.Release|Win32.Build.0 = Release|Win32
 		{EDEB02E2-F389-4CBF-AE7D-3041A934F86B}.Release|x64.ActiveCfg = Release|x64
 		{EDEB02E2-F389-4CBF-AE7D-3041A934F86B}.Release|x64.Build.0 = Release|x64
+		{C40C9047-855E-45D8-ADA8-9B98F3BE0F6C}.Debug|Win32.ActiveCfg = Debug|Win32
+		{C40C9047-855E-45D8-ADA8-9B98F3BE0F6C}.Debug|Win32.Build.0 = Debug|Win32
+		{C40C9047-855E-45D8-ADA8-9B98F3BE0F6C}.Debug|x64.ActiveCfg = Debug|Win32
+		{C40C9047-855E-45D8-ADA8-9B98F3BE0F6C}.Release|Win32.ActiveCfg = Release|Win32
+		{C40C9047-855E-45D8-ADA8-9B98F3BE0F6C}.Release|Win32.Build.0 = Release|Win32
+		{C40C9047-855E-45D8-ADA8-9B98F3BE0F6C}.Release|x64.ActiveCfg = Release|Win32
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

xUnit++/xUnit++.vcxproj

   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Lib />
     <ClCompile>
       <AdditionalIncludeDirectories>xUnit++</AdditionalIncludeDirectories>
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <ClCompile>
       <AdditionalIncludeDirectories>xUnit++</AdditionalIncludeDirectories>
+        <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
     </ClCompile>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <ClCompile>
       <AdditionalIncludeDirectories>xUnit++</AdditionalIncludeDirectories>
+        <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
     </ClCompile>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <ClCompile>
       <AdditionalIncludeDirectories>xUnit++</AdditionalIncludeDirectories>
+        <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
     </ClCompile>
   </ItemDefinitionGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />