Commits

Matt Oswald committed c0ff111

adding test for correct exports in test assemblies

Comments (0)

Files changed (9)

BareTests/BareTest.cpp

+#include "xUnit++.h"
+
+//
+// FilteredTestsRunner has a tendency to not get linked into the test dlls.
+// This is the simplest valid test library possible, and is intended to ensure
+// this error does not happen in the future.
+//
+FACT(BareTest)
+{
+}

BareTests/BareTests.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>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{EDEB02E2-F389-4CBF-AE7D-3041A934F86B}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>BareTests</RootNamespace>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <PlatformToolset>v110</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <PlatformToolset>v110</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <PlatformToolset>v110</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <PlatformToolset>v110</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <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 Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <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" />
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <AdditionalIncludeDirectories>../xUnit++</AdditionalIncludeDirectories>
+    </ClCompile>
+    <PostBuildEvent>
+      <Command>"$(OutputPath)../../../xUnit++.console/$(Configuration)/$(PlatformShortName)/xUnit++.console.exe" "$(TargetPath)"</Command>
+    </PostBuildEvent>
+    <PostBuildEvent>
+      <Message>Running Bare Tests...</Message>
+    </PostBuildEvent>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <AdditionalIncludeDirectories>../xUnit++</AdditionalIncludeDirectories>
+    </ClCompile>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <AdditionalIncludeDirectories>../xUnit++</AdditionalIncludeDirectories>
+    </ClCompile>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <AdditionalIncludeDirectories>../xUnit++</AdditionalIncludeDirectories>
+    </ClCompile>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClCompile Include="BareTest.cpp" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\xUnit++\xUnit++.vcxproj">
+      <Project>{25df3961-f288-4a96-ae6b-a4950a00ab8e}</Project>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>

BareTests/BareTests.vcxproj.filters

+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <ClCompile Include="BareTest.cpp" />
+  </ItemGroup>
+</Project>
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xUnit++.VsRunner", "xUnit++.VsRunner\xUnit++.VsRunner.vcxproj", "{7048C76A-27E7-4385-BCF1-BB9E718E99F8}"
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BareTests", "BareTests\BareTests.vcxproj", "{EDEB02E2-F389-4CBF-AE7D-3041A934F86B}"
+	ProjectSection(ProjectDependencies) = postProject
+		{2F1709B8-9F5A-4625-9404-C348298181B7} = {2F1709B8-9F5A-4625-9404-C348298181B7}
+	EndProjectSection
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Win32 = Debug|Win32
 		{7048C76A-27E7-4385-BCF1-BB9E718E99F8}.Release|Win32.Build.0 = Release|Win32
 		{7048C76A-27E7-4385-BCF1-BB9E718E99F8}.Release|x64.ActiveCfg = Release|Win32
 		{7048C76A-27E7-4385-BCF1-BB9E718E99F8}.Release|x64.Build.0 = Release|Win32
+		{EDEB02E2-F389-4CBF-AE7D-3041A934F86B}.Debug|Win32.ActiveCfg = Debug|Win32
+		{EDEB02E2-F389-4CBF-AE7D-3041A934F86B}.Debug|Win32.Build.0 = Debug|Win32
+		{EDEB02E2-F389-4CBF-AE7D-3041A934F86B}.Debug|x64.ActiveCfg = Debug|x64
+		{EDEB02E2-F389-4CBF-AE7D-3041A934F86B}.Debug|x64.Build.0 = Debug|x64
+		{EDEB02E2-F389-4CBF-AE7D-3041A934F86B}.Release|Win32.ActiveCfg = Release|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
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
 	EndGlobalSection
 	GlobalSection(NestedProjects) = preSolution
 		{2276DFCF-ABEA-44FA-9821-2F9F5B891CFF} = {AFBBD3E4-82D4-488E-949B-C50B2D9222A3}
+		{EDEB02E2-F389-4CBF-AE7D-3041A934F86B} = {AFBBD3E4-82D4-488E-949B-C50B2D9222A3}
 	EndGlobalSection
 EndGlobal

xUnit++/IOutput.cpp

+#include "IOutput.h"
+
+namespace xUnitpp
+{
+
+IOutput::~IOutput()
+{
+}
+
+}

xUnit++/TestCollection.cpp

             callback(test.TestDetails());
         }
     }
+
+    extern "C" __declspec(dllexport) int FilteredTestsRunner(int timeLimit, xUnitpp::IOutput &testReporter, std::function<bool(const xUnitpp::TestDetails &)> filter)
+    {
+        return xUnitpp::TestRunner(testReporter).RunTests(filter,
+            xUnitpp::TestCollection::Instance().Tests(), xUnitpp::Time::ToDuration(std::chrono::milliseconds(timeLimit)), 0);
+    }
 }
 
 namespace xUnitpp
 {
 
-// this has to go somewhere... :)
-IOutput::~IOutput()
-{
-}
-
 TestCollection &TestCollection::Instance()
 {
     static TestCollection collection;

xUnit++/xUnit++.vcxproj

     </ProjectConfiguration>
   </ItemGroup>
   <ItemGroup>
+    <ClCompile Include="IOutput.cpp" />
     <ClCompile Include="LineInfo.cpp" />
     <ClCompile Include="TestCollection.cpp" />
     <ClCompile Include="TestDetails.cpp" />

xUnit++/xUnit++.vcxproj.filters

     <ClCompile Include="xUnitTestRunner.cpp" />
     <ClCompile Include="LineInfo.cpp" />
     <ClCompile Include="xUnitTest.cpp" />
+    <ClCompile Include="IOutput.cpp" />
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="xUnitAssert.h" />

xUnit++/xUnitTestRunner.cpp

 namespace
 {
 
-extern "C" __declspec(dllexport) int FilteredTestsRunner(int timeLimit, xUnitpp::IOutput &testReporter, std::function<bool(const xUnitpp::TestDetails &)> filter)
-{
-    return xUnitpp::TestRunner(testReporter).RunTests(filter,
-        xUnitpp::TestCollection::Instance().Tests(), xUnitpp::Time::ToDuration(std::chrono::milliseconds(timeLimit)), 0);
-}
-
 class ActiveTests
 {
 public: