Rename our allwpilib (which is now 2020) to not have 2019 in the name
Change-Id: I3c07f85ed32ab8b97db765a9b43f2a6ce7da964a
diff --git a/cmake/modules/AddTest.cmake b/cmake/modules/AddTest.cmake
new file mode 100644
index 0000000..c8ef579
--- /dev/null
+++ b/cmake/modules/AddTest.cmake
@@ -0,0 +1,14 @@
+include(CompileWarnings)
+
+macro(wpilib_add_test name srcdir)
+ file(GLOB_RECURSE test_src ${srcdir}/*.cpp)
+ add_executable(${name}_test ${test_src})
+ wpilib_target_warnings(${name}_test)
+ if (BUILD_SHARED_LIBS)
+ target_compile_definitions(${name}_test PRIVATE -DGTEST_LINKED_AS_SHARED_LIBRARY)
+ endif()
+ if (MSVC)
+ target_compile_options(${name}_test PRIVATE /wd4251 /wd4101)
+ endif()
+ add_test(NAME ${name} COMMAND ${name}_test)
+endmacro()