From abb0cf37fc0ba54440f38375b1b741c129ca7e79 Mon Sep 17 00:00:00 2001 From: Jason Lokerson Date: Fri, 1 Aug 2014 19:58:01 -0700 Subject: [PATCH 1/5] EnclosedContextTestBase useful enough to merit creation of new project --- CMakeLists.txt | 16 ++++++++++++++ .../EnclosedContextTestBase.h | 2 ++ src/CMakeLists.txt | 1 + src/autotesting/CMakeLists.txt | 9 ++++++++ .../EnclosedContextTestBase.cpp | 2 +- .../test => autotesting}/gtest-all-guard.cpp | 4 ++-- src/autotesting/stdafx.cpp | 2 ++ src/autotesting/stdafx.h | 21 +++++++++++++++++++ src/autowiring/CMakeLists.txt | 13 +----------- src/autowiring/test/CMakeLists.txt | 5 +---- 10 files changed, 56 insertions(+), 19 deletions(-) rename src/autowiring/test/EnclosedContextTestBase.hpp => autowiring/EnclosedContextTestBase.h (96%) create mode 100644 src/autotesting/CMakeLists.txt rename src/{autowiring/test => autotesting}/EnclosedContextTestBase.cpp (98%) rename src/{autowiring/test => autotesting}/gtest-all-guard.cpp (89%) create mode 100644 src/autotesting/stdafx.cpp create mode 100644 src/autotesting/stdafx.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c6a91d6d..9f658bdeb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,7 @@ elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") set(CMAKE_CXX_FLAGS "-std=c++11") endif() +set_property(GLOBAL PROPERTY USE_FOLDERS ON) include(CMakeModules/pch.cmake) # We don't build tests unless we're being built by ourselves in our own source tree @@ -52,6 +53,21 @@ function(add_googletest dirname) endif() endfunction() +function(rewrite_header_paths target_SRC_VAR) + # All include files are located in /autowiring from here, so prepend that to all sources + set(SRCS_TEMP ${${target_SRC_VAR}}) + set(SRCS) + foreach(i ${SRCS_TEMP}) + string(REGEX MATCH ".*\\.h" hfile ${i}) + if(hfile) + list(APPEND SRCS ${PROJECT_SOURCE_DIR}/autowiring/${i}) + else() + list(APPEND SRCS ${i}) + endif() + endforeach() + set(${target_SRC_VAR} ${SRCS} PARENT_SCOPE) +endfunction() + # We have unit test projects via googletest, they're added in the places where they are defined enable_testing() diff --git a/src/autowiring/test/EnclosedContextTestBase.hpp b/autowiring/EnclosedContextTestBase.h similarity index 96% rename from src/autowiring/test/EnclosedContextTestBase.hpp rename to autowiring/EnclosedContextTestBase.h index c320a002e..59157ec49 100644 --- a/src/autowiring/test/EnclosedContextTestBase.hpp +++ b/autowiring/EnclosedContextTestBase.h @@ -1,5 +1,7 @@ // Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. #pragma once +#include +#include #include MEMORY_HEADER /// diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 18c6fb34d..ec676237c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -18,3 +18,4 @@ endif() add_subdirectory(autonet) add_subdirectory(autowiring) +add_subdirectory(autotesting) diff --git a/src/autotesting/CMakeLists.txt b/src/autotesting/CMakeLists.txt new file mode 100644 index 000000000..600f4dbd3 --- /dev/null +++ b/src/autotesting/CMakeLists.txt @@ -0,0 +1,9 @@ +set(AutoTesting_SOURCES + EnclosedContextTestBase.h + EnclosedContextTestBase.cpp +) + +rewrite_header_paths(AutoTesting_SOURCES) +add_library(AutoTesting ${AutoTesting_SOURCES}) +set_property(TARGET AutoTesting PROPERTY FOLDER "Autowiring") +target_link_libraries(AutoTesting Autowiring) \ No newline at end of file diff --git a/src/autowiring/test/EnclosedContextTestBase.cpp b/src/autotesting/EnclosedContextTestBase.cpp similarity index 98% rename from src/autowiring/test/EnclosedContextTestBase.cpp rename to src/autotesting/EnclosedContextTestBase.cpp index f342860c1..ad240b528 100644 --- a/src/autowiring/test/EnclosedContextTestBase.cpp +++ b/src/autotesting/EnclosedContextTestBase.cpp @@ -1,5 +1,5 @@ #include "stdafx.h" -#include "EnclosedContextTestBase.hpp" +#include "EnclosedContextTestBase.h" struct TestInfoProxy { TestInfoProxy(const testing::TestInfo& info) : diff --git a/src/autowiring/test/gtest-all-guard.cpp b/src/autotesting/gtest-all-guard.cpp similarity index 89% rename from src/autowiring/test/gtest-all-guard.cpp rename to src/autotesting/gtest-all-guard.cpp index 4dc76c94e..051fd8675 100644 --- a/src/autowiring/test/gtest-all-guard.cpp +++ b/src/autotesting/gtest-all-guard.cpp @@ -16,10 +16,10 @@ int g_argc; char** g_argv; template -const char (&ArraySizer(const T (&vals)[n]))[n]; +const char(&ArraySizer(const T(&vals)[n]))[n]; #define ARYLEN(x) sizeof(ArraySizer(x)) -int main(int argc, char* argv[]) +int main(int argc, char* argv []) { g_argc = argc; g_argv = argv; diff --git a/src/autotesting/stdafx.cpp b/src/autotesting/stdafx.cpp new file mode 100644 index 000000000..36640356b --- /dev/null +++ b/src/autotesting/stdafx.cpp @@ -0,0 +1,2 @@ +// Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. +#include "stdafx.h" diff --git a/src/autotesting/stdafx.h b/src/autotesting/stdafx.h new file mode 100644 index 000000000..14acc27d3 --- /dev/null +++ b/src/autotesting/stdafx.h @@ -0,0 +1,21 @@ +// Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. +#pragma once + +// Only include these headers in cases where a pch can be generated +// Currently this is only supported on MSVC +#ifdef _MSC_VER + #include + #define NOMINMAX +#endif + +#ifndef _MSC_VER + #include +#endif + +// C++11 glue logic, for platforms that have incomplete C++11 support +#include "contrib/C++11/cpp11.h" + + +template +const char(&ArraySize(const T(&vals)[n]))[n]; +#define ARRAYCOUNT(x) sizeof(ArraySize(x)) \ No newline at end of file diff --git a/src/autowiring/CMakeLists.txt b/src/autowiring/CMakeLists.txt index d91ef2bc6..ae90f0634 100644 --- a/src/autowiring/CMakeLists.txt +++ b/src/autowiring/CMakeLists.txt @@ -149,18 +149,7 @@ else() set(Autowiring_SRCS ${Autowiring_Unix_SRCS} ${Autowiring_SRCS}) endif() -# All include files are located in /autowiring from here, so prepend that to all sources -set(Autowiring_SRCS_TEMP ${Autowiring_SRCS}) -set(Autowiring_SRCS) -foreach(i ${Autowiring_SRCS_TEMP}) - string(REGEX MATCH ".*\\.h" hfile ${i}) - if(hfile) - list(APPEND Autowiring_SRCS ${PROJECT_SOURCE_DIR}/autowiring/${i}) - else() - list(APPEND Autowiring_SRCS ${i}) - endif() -endforeach() - +rewrite_header_paths(Autowiring_SRCS) ADD_MSVC_PRECOMPILED_HEADER("stdafx.h" "stdafx.cpp" Autowiring_SRCS) add_library(Autowiring STATIC ${Autowiring_SRCS}) set_property(TARGET Autowiring PROPERTY FOLDER "Autowiring") diff --git a/src/autowiring/test/CMakeLists.txt b/src/autowiring/test/CMakeLists.txt index e06024281..a8d2dfaf1 100644 --- a/src/autowiring/test/CMakeLists.txt +++ b/src/autowiring/test/CMakeLists.txt @@ -41,8 +41,6 @@ set(AutowiringTest_SRCS DispatchQueueTest.cpp DtorCorrectnessTest.hpp DtorCorrectnessTest.cpp - EnclosedContextTestBase.hpp - EnclosedContextTestBase.cpp ExceptionFilterTest.hpp ExceptionFilterTest.cpp EventReceiverTest.hpp @@ -88,7 +86,6 @@ set(AutowiringTest_SRCS TestFixtures/MultiInherit.hpp UuidTest.hpp UuidTest.cpp - gtest-all-guard.cpp ) set( @@ -105,7 +102,7 @@ set_property(TARGET AutowiringFixture PROPERTY FOLDER "Autowiring") ADD_MSVC_PRECOMPILED_HEADER("stdafx.h" "stdafx.cpp" AutowiringTest_SRCS) add_executable(AutowiringTest ${AutowiringTest_SRCS}) -target_link_libraries(AutowiringTest Autowiring AutowiringFixture) +target_link_libraries(AutowiringTest Autowiring AutowiringFixture AutoTesting) set_property(TARGET AutowiringTest PROPERTY FOLDER "Autowiring") # This is a unit test, let CMake know this From 0feec37d74a8c1ebf6b6483c9b6de420b921f99b Mon Sep 17 00:00:00 2001 From: Jason Lokerson Date: Fri, 1 Aug 2014 20:02:56 -0700 Subject: [PATCH 2/5] Class name refactored to reflect new purpose --- ...closedContextTestBase.h => AutowiringEnclosure.h} | 8 ++++---- ...edContextTestBase.cpp => AutowiringEnclosure.cpp} | 12 ++++++------ src/autotesting/CMakeLists.txt | 5 +++-- src/autowiring/test/ContextEnumeratorTest.hpp | 1 - 4 files changed, 13 insertions(+), 13 deletions(-) rename autowiring/{EnclosedContextTestBase.h => AutowiringEnclosure.h} (89%) rename src/autotesting/{EnclosedContextTestBase.cpp => AutowiringEnclosure.cpp} (84%) diff --git a/autowiring/EnclosedContextTestBase.h b/autowiring/AutowiringEnclosure.h similarity index 89% rename from autowiring/EnclosedContextTestBase.h rename to autowiring/AutowiringEnclosure.h index 59157ec49..1dcfa80c7 100644 --- a/autowiring/EnclosedContextTestBase.h +++ b/autowiring/AutowiringEnclosure.h @@ -7,13 +7,13 @@ /// /// General purpose exception filter, used for tracking exceptions thrown from unit test CoreThreads /// -class EnclosedContextExceptionFilter: +class AutowiringEnclosureExceptionFilter: public ContextMember, public ExceptionFilter { public: - EnclosedContextExceptionFilter(void) : - ContextMember("EnclosedContextExceptionFilter"), + AutowiringEnclosureExceptionFilter(void) : + ContextMember("AutowiringEnclosureExceptionFilter"), m_excepted(false) {} @@ -44,7 +44,7 @@ class EnclosedContextExceptionFilter: /// tests complete in a timely fashion. If a longer stop duration is desired, you must provide a /// destructor which performs teardown in a different way. /// -class EnclosedContextTestBase: +class AutowiringEnclosure: public testing::EmptyTestEventListener { private: diff --git a/src/autotesting/EnclosedContextTestBase.cpp b/src/autotesting/AutowiringEnclosure.cpp similarity index 84% rename from src/autotesting/EnclosedContextTestBase.cpp rename to src/autotesting/AutowiringEnclosure.cpp index ad240b528..051f72303 100644 --- a/src/autotesting/EnclosedContextTestBase.cpp +++ b/src/autotesting/AutowiringEnclosure.cpp @@ -1,5 +1,5 @@ #include "stdafx.h" -#include "EnclosedContextTestBase.h" +#include "AutowiringEnclosure.h" struct TestInfoProxy { TestInfoProxy(const testing::TestInfo& info) : @@ -9,8 +9,8 @@ struct TestInfoProxy { const testing::TestInfo& m_info; }; -void EnclosedContextTestBase::OnTestStart(const testing::TestInfo& info) { - AutoRequired filter; +void AutowiringEnclosure::OnTestStart(const testing::TestInfo& info) { + AutoRequired filter; // The context proper. This is automatically assigned as the current // context when SetUp is invoked. @@ -18,16 +18,16 @@ void EnclosedContextTestBase::OnTestStart(const testing::TestInfo& info) { create->Construct(info); // Add exception filter in this context: - create->Inject(); + create->Inject(); // Now make it current and let the test run: create->SetCurrent(); } -void EnclosedContextTestBase::OnTestEnd(const testing::TestInfo& info) { +void AutowiringEnclosure::OnTestEnd(const testing::TestInfo& info) { // Verify we can grab the test case back out and that the pointer is correct: Autowired ti; - Autowired ecef; + Autowired ecef; auto ctxt = ecef ? ecef->GetContext() : nullptr; // Unconditionally reset the global context as the current context diff --git a/src/autotesting/CMakeLists.txt b/src/autotesting/CMakeLists.txt index 600f4dbd3..b7ff6480a 100644 --- a/src/autotesting/CMakeLists.txt +++ b/src/autotesting/CMakeLists.txt @@ -1,6 +1,7 @@ set(AutoTesting_SOURCES - EnclosedContextTestBase.h - EnclosedContextTestBase.cpp + AutowiringEnclosure.h + AutowiringEnclosure.cpp + gtest-all-guard.cpp ) rewrite_header_paths(AutoTesting_SOURCES) diff --git a/src/autowiring/test/ContextEnumeratorTest.hpp b/src/autowiring/test/ContextEnumeratorTest.hpp index 156f63b27..f7aa493e1 100644 --- a/src/autowiring/test/ContextEnumeratorTest.hpp +++ b/src/autowiring/test/ContextEnumeratorTest.hpp @@ -1,6 +1,5 @@ // Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. #pragma once -#include "EnclosedContextTestBase.hpp" class ContextEnumeratorTest: public testing::Test From 4715a22c4f8152d9e43de2b5ab3a09b27bccafb1 Mon Sep 17 00:00:00 2001 From: Jason Lokerson Date: Fri, 1 Aug 2014 20:03:56 -0700 Subject: [PATCH 3/5] Simplification of gtest-all-guard --- src/autotesting/gtest-all-guard.cpp | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/src/autotesting/gtest-all-guard.cpp b/src/autotesting/gtest-all-guard.cpp index 051fd8675..ca718621f 100644 --- a/src/autotesting/gtest-all-guard.cpp +++ b/src/autotesting/gtest-all-guard.cpp @@ -1,31 +1,14 @@ // Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. #include "stdafx.h" -#if __APPLE__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-private-field" -#endif -#include "EnclosedContextTestBase.hpp" +#include "AutowiringEnclosure.h" #include -#include -using namespace testing::internal; using namespace std; -// Misc. globals: -int g_argc; -char** g_argv; - -template -const char(&ArraySizer(const T(&vals)[n]))[n]; -#define ARYLEN(x) sizeof(ArraySizer(x)) - -int main(int argc, char* argv []) +int main(int argc, char* argv[]) { - g_argc = argc; - g_argv = argv; - auto& listeners = testing::UnitTest::GetInstance()->listeners(); - listeners.Append(new EnclosedContextTestBase); + listeners.Append(new AutowiringEnclosure); testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } From 206ddce0ed7f43e82f0cff934f989487aef7ef71 Mon Sep 17 00:00:00 2001 From: Jason Lokerson Date: Fri, 1 Aug 2014 20:24:46 -0700 Subject: [PATCH 4/5] Benchmark tests moved to their own test project --- src/autowiring/CMakeLists.txt | 1 + .../AutowiringBenchmarkTest.cpp | 7 ++++--- .../AutowiringBenchmarkTest.hpp | 0 src/autowiring/benchmark/CMakeLists.txt | 16 ++++++++++++++++ src/autowiring/benchmark/stdafx.cpp | 2 ++ src/autowiring/benchmark/stdafx.h | 18 ++++++++++++++++++ src/autowiring/test/CMakeLists.txt | 2 -- 7 files changed, 41 insertions(+), 5 deletions(-) rename src/autowiring/{test => benchmark}/AutowiringBenchmarkTest.cpp (97%) rename src/autowiring/{test => benchmark}/AutowiringBenchmarkTest.hpp (100%) create mode 100644 src/autowiring/benchmark/CMakeLists.txt create mode 100644 src/autowiring/benchmark/stdafx.cpp create mode 100644 src/autowiring/benchmark/stdafx.h diff --git a/src/autowiring/CMakeLists.txt b/src/autowiring/CMakeLists.txt index ae90f0634..a92403d09 100644 --- a/src/autowiring/CMakeLists.txt +++ b/src/autowiring/CMakeLists.txt @@ -1,4 +1,5 @@ add_googletest(test) +add_googletest(benchmark) set(Autowiring_SRCS at_exit.h diff --git a/src/autowiring/test/AutowiringBenchmarkTest.cpp b/src/autowiring/benchmark/AutowiringBenchmarkTest.cpp similarity index 97% rename from src/autowiring/test/AutowiringBenchmarkTest.cpp rename to src/autowiring/benchmark/AutowiringBenchmarkTest.cpp index 88068d8bc..00d680ca2 100644 --- a/src/autowiring/test/AutowiringBenchmarkTest.cpp +++ b/src/autowiring/benchmark/AutowiringBenchmarkTest.cpp @@ -1,13 +1,14 @@ // Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. #include "stdafx.h" #include "AutowiringBenchmarkTest.hpp" -#include "TestFixtures/SimpleObject.hpp" + +class Foo {}; TEST_F(AutowiringBenchmarkTest, VerifySimplePerformance) { const size_t n = 10000; // Insert the object: - AutoRequired(); + AutoRequired(); // Time n hash map hits, in order to get a baseline: std::unordered_map ref; @@ -27,7 +28,7 @@ TEST_F(AutowiringBenchmarkTest, VerifySimplePerformance) { { auto start = std::chrono::steady_clock::now(); for(size_t i = n; i--;) - Autowired(); + Autowired(); benchmark = (std::chrono::steady_clock::now() - start) / n; } diff --git a/src/autowiring/test/AutowiringBenchmarkTest.hpp b/src/autowiring/benchmark/AutowiringBenchmarkTest.hpp similarity index 100% rename from src/autowiring/test/AutowiringBenchmarkTest.hpp rename to src/autowiring/benchmark/AutowiringBenchmarkTest.hpp diff --git a/src/autowiring/benchmark/CMakeLists.txt b/src/autowiring/benchmark/CMakeLists.txt new file mode 100644 index 000000000..67a68cb8e --- /dev/null +++ b/src/autowiring/benchmark/CMakeLists.txt @@ -0,0 +1,16 @@ +if(NOT AUTOWIRING_BUILD_BENCHMARKS) + return() +endif() + +set(AutowiringBenchmarkTest_SRCS + AutowiringBenchmarkTest.hpp + AutowiringBenchmarkTest.cpp +) + +ADD_MSVC_PRECOMPILED_HEADER("stdafx.h" "stdafx.cpp" AutowiringBenchmarkTest_SRCS) +add_executable(AutowiringBenchmarkTest ${AutowiringBenchmarkTest_SRCS}) +target_link_libraries(AutowiringBenchmarkTest Autowiring AutowiringFixture AutoTesting) +set_property(TARGET AutowiringBenchmarkTest PROPERTY FOLDER "Autowiring") + +# This is a unit test, let CMake know this +add_test(NAME AutowiringBenchmarkTest COMMAND $) diff --git a/src/autowiring/benchmark/stdafx.cpp b/src/autowiring/benchmark/stdafx.cpp new file mode 100644 index 000000000..36640356b --- /dev/null +++ b/src/autowiring/benchmark/stdafx.cpp @@ -0,0 +1,2 @@ +// Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. +#include "stdafx.h" diff --git a/src/autowiring/benchmark/stdafx.h b/src/autowiring/benchmark/stdafx.h new file mode 100644 index 000000000..0bf9972e9 --- /dev/null +++ b/src/autowiring/benchmark/stdafx.h @@ -0,0 +1,18 @@ +// Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. +#pragma once + +#include +#include +#include + +#ifdef _MSC_VER + #include + #include +#endif + +// Very unusual syntax -- function taking an array of fixed size, and returning +// a character array of that same size +template +const char(&ArraySize(const T(&vals)[n]))[n]; + +#define ARRAYCOUNT(x) sizeof(ArraySize(x)) diff --git a/src/autowiring/test/CMakeLists.txt b/src/autowiring/test/CMakeLists.txt index a8d2dfaf1..f82cafc3f 100644 --- a/src/autowiring/test/CMakeLists.txt +++ b/src/autowiring/test/CMakeLists.txt @@ -9,8 +9,6 @@ set(AutowiringTest_SRCS AutoInjectableTest.cpp AutoPacketFactoryTest.hpp AutoPacketFactoryTest.cpp - AutowiringBenchmarkTest.hpp - AutowiringBenchmarkTest.cpp AutowiringTest.hpp AutowiringTest.cpp AutowiringUtilitiesTest.hpp From f960703ddf8816664452d10afa734ee733e3e12f Mon Sep 17 00:00:00 2001 From: Jason Lokerson Date: Fri, 1 Aug 2014 20:28:57 -0700 Subject: [PATCH 5/5] gtest-all-guard modified to allow delegation of main --- autowiring/gtest-all-guard.h | 6 ++++++ src/autotesting/CMakeLists.txt | 1 + src/autotesting/gtest-all-guard.cpp | 4 ++-- src/autowiring/benchmark/AutowiringBenchmarkTest.cpp | 5 +++++ src/autowiring/test/AutowiringTest.cpp | 5 +++++ 5 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 autowiring/gtest-all-guard.h diff --git a/autowiring/gtest-all-guard.h b/autowiring/gtest-all-guard.h new file mode 100644 index 000000000..adb54db86 --- /dev/null +++ b/autowiring/gtest-all-guard.h @@ -0,0 +1,6 @@ +#pragma once + +/// +/// Delegating main routine, installs an enclosure filter and begins running the tests +/// +int autotesting_main(int argc, const char* argv []); \ No newline at end of file diff --git a/src/autotesting/CMakeLists.txt b/src/autotesting/CMakeLists.txt index b7ff6480a..87a96fa0b 100644 --- a/src/autotesting/CMakeLists.txt +++ b/src/autotesting/CMakeLists.txt @@ -1,6 +1,7 @@ set(AutoTesting_SOURCES AutowiringEnclosure.h AutowiringEnclosure.cpp + gtest-all-guard.h gtest-all-guard.cpp ) diff --git a/src/autotesting/gtest-all-guard.cpp b/src/autotesting/gtest-all-guard.cpp index ca718621f..4bf1f764b 100644 --- a/src/autotesting/gtest-all-guard.cpp +++ b/src/autotesting/gtest-all-guard.cpp @@ -5,10 +5,10 @@ using namespace std; -int main(int argc, char* argv[]) +int autotesting_main(int argc, const char* argv[]) { auto& listeners = testing::UnitTest::GetInstance()->listeners(); listeners.Append(new AutowiringEnclosure); - testing::InitGoogleTest(&argc, argv); + testing::InitGoogleTest(&argc, (char**)argv); return RUN_ALL_TESTS(); } diff --git a/src/autowiring/benchmark/AutowiringBenchmarkTest.cpp b/src/autowiring/benchmark/AutowiringBenchmarkTest.cpp index 00d680ca2..8ebbc57bf 100644 --- a/src/autowiring/benchmark/AutowiringBenchmarkTest.cpp +++ b/src/autowiring/benchmark/AutowiringBenchmarkTest.cpp @@ -1,9 +1,14 @@ // Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. #include "stdafx.h" #include "AutowiringBenchmarkTest.hpp" +#include "gtest-all-guard.h" class Foo {}; +int main(int argc, const char* argv[]) { + return autotesting_main(argc, argv); +} + TEST_F(AutowiringBenchmarkTest, VerifySimplePerformance) { const size_t n = 10000; diff --git a/src/autowiring/test/AutowiringTest.cpp b/src/autowiring/test/AutowiringTest.cpp index b762d3d3a..e64eaef5c 100644 --- a/src/autowiring/test/AutowiringTest.cpp +++ b/src/autowiring/test/AutowiringTest.cpp @@ -1,11 +1,16 @@ // Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. #include "stdafx.h" #include "AutowiringTest.hpp" +#include "gtest-all-guard.h" #include "TestFixtures/SimpleObject.hpp" #include "TestFixtures/SimpleReceiver.hpp" #include #include +int main(int argc, const char* argv []) { + return autotesting_main(argc, argv); +} + TEST_F(AutowiringTest, VerifyAutowiredFast) { // Add an object: AutoCurrentContext()->Inject();