Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from leapmotion/ref-testutilities
Extracting a utilities project for testing
- Loading branch information
Showing
19 changed files
with
136 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#pragma once | ||
|
||
/// <summary> | ||
/// Delegating main routine, installs an enclosure filter and begins running the tests | ||
/// </summary> | ||
int autotesting_main(int argc, const char* argv []); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,4 @@ endif() | |
|
||
add_subdirectory(autonet) | ||
add_subdirectory(autowiring) | ||
add_subdirectory(autotesting) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
set(AutoTesting_SOURCES | ||
AutowiringEnclosure.h | ||
AutowiringEnclosure.cpp | ||
gtest-all-guard.h | ||
gtest-all-guard.cpp | ||
) | ||
|
||
rewrite_header_paths(AutoTesting_SOURCES) | ||
add_library(AutoTesting ${AutoTesting_SOURCES}) | ||
set_property(TARGET AutoTesting PROPERTY FOLDER "Autowiring") | ||
target_link_libraries(AutoTesting Autowiring) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. | ||
#include "stdafx.h" | ||
#include "AutowiringEnclosure.h" | ||
#include <gtest/gtest-all.cc> | ||
|
||
using namespace std; | ||
|
||
int autotesting_main(int argc, const char* argv[]) | ||
{ | ||
auto& listeners = testing::UnitTest::GetInstance()->listeners(); | ||
listeners.Append(new AutowiringEnclosure); | ||
testing::InitGoogleTest(&argc, (char**)argv); | ||
return RUN_ALL_TESTS(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. | ||
#include "stdafx.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <thread> | ||
#define NOMINMAX | ||
#endif | ||
|
||
#ifndef _MSC_VER | ||
#include <stdlib.h> | ||
#endif | ||
|
||
// C++11 glue logic, for platforms that have incomplete C++11 support | ||
#include "contrib/C++11/cpp11.h" | ||
|
||
|
||
template<class T, int n> | ||
const char(&ArraySize(const T(&vals)[n]))[n]; | ||
#define ARRAYCOUNT(x) sizeof(ArraySize(x)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 $<TARGET_FILE:AutowiringBenchmarkTest>) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. | ||
#include "stdafx.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved. | ||
#pragma once | ||
|
||
#include <C++11/cpp11.h> | ||
#include <gtest/gtest.h> | ||
#include <autowiring/autowiring.h> | ||
|
||
#ifdef _MSC_VER | ||
#include <thread> | ||
#include <mutex> | ||
#endif | ||
|
||
// Very unusual syntax -- function taking an array of fixed size, and returning | ||
// a character array of that same size | ||
template<class T, int n> | ||
const char(&ArraySize(const T(&vals)[n]))[n]; | ||
|
||
#define ARRAYCOUNT(x) sizeof(ArraySize(x)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.