Skip to content

Commit ce196f2

Browse files
committed
Add support and project files for Visual Studio 2012
1 parent c13d247 commit ce196f2

14 files changed

Lines changed: 1395 additions & 9 deletions

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*.sln text eol=crlf
88
*.vcproj text eol=crlf
99
*.vcxproj text eol=crlf
10+
*.vcxproj.filters text eol=crlf
1011

1112
# VC6 files
1213
*.dsw text eol=crlf

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
*.suo
55
*.sdf
66
*.opensdf
7+
8+
# Build output directories
79
Release
810
Debug
11+
MinSizeRel
12+
RelWithDebInfo
913
ipch

CMakeLists.txt

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ source_group("" FILES ${headers_} ${sources_})
1010

1111
# get platform specific sources
1212
if (WIN32)
13+
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
1314
set(platformDir_ Win32)
1415
else()
1516
set(platformDir_ Posix)
@@ -20,32 +21,32 @@ file(GLOB platformSources_ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} UnitTest++/${pla
2021
source_group(${platformDir_} FILES ${platformHeaders_} ${platformSources_})
2122

2223
# create the lib
23-
add_library(UnitTestPP STATIC ${headers_} ${sources_} ${platformHeaders_} ${platformSources_})
24+
add_library(UnitTest++ STATIC ${headers_} ${sources_} ${platformHeaders_} ${platformSources_})
2425

2526
if(${UTPP_USE_PLUS_SIGN})
26-
set_target_properties(UnitTestPP PROPERTIES OUTPUT_NAME UnitTest++)
27+
set_target_properties(UnitTest++ PROPERTIES OUTPUT_NAME UnitTest++)
2728
endif()
2829

2930

3031
# build the test runner
3132
file(GLOB TEST_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} tests/*.cpp tests/*.h)
3233
source_group( "" FILES ${TEST_SRCS})
33-
add_executable(TestUnitTestPP ${TEST_SRCS})
34+
add_executable(TestUnitTest++ ${TEST_SRCS})
3435
include_directories(.)
3536

3637
if(${UTPP_USE_PLUS_SIGN})
37-
set_target_properties(TestUnitTestPP PROPERTIES OUTPUT_NAME TestUnitTest++)
38+
set_target_properties(TestUnitTest++ PROPERTIES OUTPUT_NAME TestUnitTest++)
3839
endif()
3940

40-
target_link_libraries(TestUnitTestPP UnitTestPP)
41+
target_link_libraries(TestUnitTest++ UnitTest++)
4142

4243
# turn on testing
4344
enable_testing()
4445
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} -V)
4546

4647
# add the test runner as a test
47-
add_test(NAME TestUnitTestPP COMMAND TestUnitTest++ ${CONFIG_PATH} ${CONFIG_TASKS_PATH} ${SOUND_LOG_PATH})
48-
add_dependencies(check TestUnitTestPP)
48+
add_test(NAME TestUnitTest++ COMMAND TestUnitTest++ ${CONFIG_PATH} ${CONFIG_TASKS_PATH} ${SOUND_LOG_PATH})
49+
add_dependencies(check TestUnitTest++)
4950

5051

5152
# add install targets
@@ -57,6 +58,6 @@ else()
5758
set (UTPP_INSTALL_DESTINATION "include/UnitTestPP")
5859
endif()
5960

60-
install(TARGETS UnitTestPP DESTINATION lib)
61+
install(TARGETS UnitTest++ DESTINATION lib)
6162
install(FILES ${headers_} DESTINATION ${UTPP_INSTALL_DESTINATION})
6263
install(FILES ${platformHeaders_} DESTINATION ${UTPP_INSTALL_DESTINATION}/${platformDir_})

tests/TestTest.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ TEST(ThrowingTestsAreReportedAsFailures)
7272
CHECK_EQUAL(1, results.GetFailureCount());
7373
}
7474

75-
#ifndef UNITTEST_MINGW
75+
#if !defined(UNITTEST_MINGW) && !defined(UNITTEST_WIN32)
7676
TEST(CrashingTestsAreReportedAsFailures)
7777
{
7878
class CrashingTest : public Test
@@ -81,6 +81,7 @@ TEST(CrashingTestsAreReportedAsFailures)
8181
CrashingTest() : Test("crashing") {}
8282
virtual void RunImpl() const
8383
{
84+
8485
reinterpret_cast< void (*)() >(0)();
8586
}
8687
};

vs_projects/vs2012_x64/TestUnitTest++.vcxproj

Lines changed: 299 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup>
4+
<ClCompile Include="..\..\tests\Main.cpp" />
5+
<ClCompile Include="..\..\tests\TestAssertHandler.cpp" />
6+
<ClCompile Include="..\..\tests\TestCheckMacros.cpp" />
7+
<ClCompile Include="..\..\tests\TestChecks.cpp" />
8+
<ClCompile Include="..\..\tests\TestCompositeTestReporter.cpp" />
9+
<ClCompile Include="..\..\tests\TestCurrentTest.cpp" />
10+
<ClCompile Include="..\..\tests\TestDeferredTestReporter.cpp" />
11+
<ClCompile Include="..\..\tests\TestExceptions.cpp" />
12+
<ClCompile Include="..\..\tests\TestMemoryOutStream.cpp" />
13+
<ClCompile Include="..\..\tests\TestTest.cpp" />
14+
<ClCompile Include="..\..\tests\TestTestList.cpp" />
15+
<ClCompile Include="..\..\tests\TestTestMacros.cpp" />
16+
<ClCompile Include="..\..\tests\TestTestResults.cpp" />
17+
<ClCompile Include="..\..\tests\TestTestRunner.cpp" />
18+
<ClCompile Include="..\..\tests\TestTestSuite.cpp" />
19+
<ClCompile Include="..\..\tests\TestTimeConstraint.cpp" />
20+
<ClCompile Include="..\..\tests\TestTimeConstraintMacro.cpp" />
21+
<ClCompile Include="..\..\tests\TestUnitTestPP.cpp" />
22+
<ClCompile Include="..\..\tests\TestXmlTestReporter.cpp" />
23+
</ItemGroup>
24+
<ItemGroup>
25+
<ClInclude Include="..\..\tests\RecordingReporter.h" />
26+
<ClInclude Include="..\..\tests\ScopedCurrentTest.h" />
27+
</ItemGroup>
28+
<ItemGroup>
29+
</ItemGroup>
30+
</Project>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
Microsoft Visual Studio Solution File, Format Version 12.00
2+
# Visual Studio 2012
3+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestUnitTest++", "TestUnitTest++.vcxproj", "{FAE7B8C1-428D-45DB-9A26-751A64C666D1}"
4+
ProjectSection(ProjectDependencies) = postProject
5+
{7867CF0A-53DE-4CAD-A141-976283C590C4} = {7867CF0A-53DE-4CAD-A141-976283C590C4}
6+
EndProjectSection
7+
EndProject
8+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UnitTest++", "UnitTest++.vcxproj", "{7867CF0A-53DE-4CAD-A141-976283C590C4}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|x64 = Debug|x64
13+
MinSizeRel|x64 = MinSizeRel|x64
14+
Release|x64 = Release|x64
15+
RelWithDebInfo|x64 = RelWithDebInfo|x64
16+
EndGlobalSection
17+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
18+
{FAE7B8C1-428D-45DB-9A26-751A64C666D1}.Debug|x64.ActiveCfg = Debug|x64
19+
{FAE7B8C1-428D-45DB-9A26-751A64C666D1}.Debug|x64.Build.0 = Debug|x64
20+
{FAE7B8C1-428D-45DB-9A26-751A64C666D1}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
21+
{FAE7B8C1-428D-45DB-9A26-751A64C666D1}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
22+
{FAE7B8C1-428D-45DB-9A26-751A64C666D1}.Release|x64.ActiveCfg = Release|x64
23+
{FAE7B8C1-428D-45DB-9A26-751A64C666D1}.Release|x64.Build.0 = Release|x64
24+
{FAE7B8C1-428D-45DB-9A26-751A64C666D1}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
25+
{FAE7B8C1-428D-45DB-9A26-751A64C666D1}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
26+
{7867CF0A-53DE-4CAD-A141-976283C590C4}.Debug|x64.ActiveCfg = Debug|x64
27+
{7867CF0A-53DE-4CAD-A141-976283C590C4}.Debug|x64.Build.0 = Debug|x64
28+
{7867CF0A-53DE-4CAD-A141-976283C590C4}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
29+
{7867CF0A-53DE-4CAD-A141-976283C590C4}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
30+
{7867CF0A-53DE-4CAD-A141-976283C590C4}.Release|x64.ActiveCfg = Release|x64
31+
{7867CF0A-53DE-4CAD-A141-976283C590C4}.Release|x64.Build.0 = Release|x64
32+
{7867CF0A-53DE-4CAD-A141-976283C590C4}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
33+
{7867CF0A-53DE-4CAD-A141-976283C590C4}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
34+
EndGlobalSection
35+
GlobalSection(SolutionProperties) = preSolution
36+
HideSolutionNode = FALSE
37+
EndGlobalSection
38+
EndGlobal

0 commit comments

Comments
 (0)