Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
iMSTK
iMSTK
Commits
4f24afe0
Commit
4f24afe0
authored
Jul 31, 2021
by
Sreekanth Arikatla
Browse files
Merge branch 'feature/test-main' into 'master'
ENH:Add a main to run the unittests See merge request
!630
parents
3f2be851
b0745652
Pipeline
#240302
failed with stage
in 0 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CMake/Utilities/imstkAddTest.cmake
View file @
4f24afe0
...
...
@@ -50,10 +50,11 @@ function(imstk_add_test_internal target kind)
# Link test driver against current target, gtest and pthread
target_link_libraries
(
${
test_driver_executable
}
${
target
}
Testing
Threads::Threads
GTest::gtest
GTest::gmock
GTest::gtest_main
Threads::Threads
)
if
(
MSVC
)
...
...
CMakeLists.txt
View file @
4f24afe0
...
...
@@ -377,6 +377,7 @@ add_subdirectory(Source/CollisionDetection)
add_subdirectory
(
Source/CollisionHandling
)
add_subdirectory
(
Source/Scene
)
add_subdirectory
(
Source/SimulationManager
)
add_subdirectory
(
Source/Testing
)
add_subdirectory
(
Source/Filtering
)
add_subdirectory
(
Source/FilteringCore
)
...
...
Source/Testing/CMakeLists.txt
0 → 100644
View file @
4f24afe0
#-----------------------------------------------------------------------------
# Create target
#-----------------------------------------------------------------------------
if
(
${
PROJECT_NAME
}
_BUILD_TESTING
)
include
(
imstkAddLibrary
)
imstk_add_library
(
Testing
DEPENDS
Common
GTest::gtest
${
VTK_LIBRARIES
}
)
endif
()
\ No newline at end of file
Source/Testing/imstkTestingMain.cpp
0 → 100644
View file @
4f24afe0
/*=========================================================================
Library: iMSTK
Copyright (c) Kitware, Inc. & Center for Modeling, Simulation,
& Imaging in Medicine, Rensselaer Polytechnic Institute.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0.txt
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
=========================================================================*/
#include
<vtksys/SystemTools.hxx>
#include
<gtest/gtest.h>
#include
"imstkLogger.h"
int
main
(
int
argc
,
char
**
argv
)
{
bool
removeLog
=
false
;
for
(
int
i
=
0
;
i
<
argc
;
++
i
)
{
if
(
std
::
string
(
argv
[
i
])
==
"--imstk_keep_log"
)
{
removeLog
=
true
;
}
}
if
(
removeLog
)
{
vtksys
::
SystemTools
::
RemoveADirectory
(
"testlog"
);
vtksys
::
SystemTools
::
MakeDirectory
(
"testlog"
);
}
auto
&
logger
=
imstk
::
Logger
::
getInstance
();
logger
.
addFileSink
(
"test"
,
"testlog"
);
::
testing
::
InitGoogleTest
(
&
argc
,
argv
);
return
RUN_ALL_TESTS
();
}
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment