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
Stack Of Tasks
dynamic-graph
Commits
38c251ae
Commit
38c251ae
authored
Dec 20, 2010
by
Thomas Moulard
Browse files
Clean unit tests compilation.
parent
71f7c54f
Changes
9
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
38c251ae
...
...
@@ -65,7 +65,7 @@ ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY
(
include
)
ADD_SUBDIRECTORY
(
tools
)
ADD_SUBDIRECTORY
(
doc
)
ADD_SUBDIRECTORY
(
unitTesting
)
ADD_SUBDIRECTORY
(
tests
)
SETUP_PROJECT_FINALIZE
()
SETUP_PROJECT_CPACK
()
\ No newline at end of file
unitTesting
/CMakeLists.txt
→
tests
/CMakeLists.txt
View file @
38c251ae
...
...
@@ -13,53 +13,45 @@
# received a copy of the GNU Lesser General Public License along with
# dynamic-graph. If not, see <http://www.gnu.org/licenses/>.
# Declare boost include directories
include_directories
(
${
Boost_INCLUDE_DIRS
}
)
### tests
SET
(
tests_exe
test_pool
test_depend
test_signalcast
)
SET
(
tests_libs
test_signalcast_libA
test_signalcast_libB
)
SET
(
test_signalcast_additional_libs
${
test_libs
}
)
ADD_DEFINITIONS
(
-DDEBUG=2
)
LINK_DIRECTORIES
(
${
CMAKE_SOURCE_DIR
}
/src
)
# Add Boost path to include directories.
INCLUDE_DIRECTORIES
(
${
Boost_INCLUDE_DIRS
}
)
# Additional tests
FOREACH
(
test_name
${
tests_libs
}
)
SET
(
LIBRARY_NAME
${
test_name
}
)
# Make Boost.Test generates the main function in test cases.
ADD_DEFINITIONS
(
-DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN
)
# DYNAMIC_GRAPH_TEST(NAME)
# ------------------------
#
# Define a test named `NAME'.
#
# This macro will create a binary from `NAME.cpp', link it against
# Boost and add it to the test suite.
#
MACRO
(
DYNAMIC_GRAPH_TEST NAME
)
ADD_EXECUTABLE
(
${
NAME
}
${
NAME
}
.cpp
)
ADD_TEST
(
${
NAME
}
${
RUNTIME_OUTPUT_DIRECTORY
}
/
${
NAME
}
)
ADD_LIBRARY
(
${
LIBRARY_NAME
}
SHARED
${
test_name
}
.cpp
)
TARGET_LINK_LIBRARIES
(
${
NAME
}
${
PROJECT_NAME
}
)
ADD_DEPENDENCIES
(
${
NAME
}
${
PROJECT_NAME
}
)
TARGET_LINK_LIBRARIES
(
${
LIBRARY_NAME
}
${
PROJECT_NAME
}
)
ADD_DEPENDENCIES
(
${
LIBRARY_NAME
}
${
PROJECT_NAME
}
)
ENDFOREACH
(
test_name
)
# Link against Boost.
TARGET_LINK_LIBRARIES
(
${
NAME
}
${
Boost_LIBRARIES
}
)
ENDMACRO
(
DYNAMIC_GRAPH_TEST
)
FOREACH
(
test_name
${
tests_exe
}
)
SET
(
EXECUTABLE_NAME
${
test_name
}
)
DYNAMIC_GRAPH_TEST
(
test_pool
)
DYNAMIC_GRAPH_TEST
(
test_depend
)
ADD_EXECUTABLE
(
${
EXECUTABLE_NAME
}
${
test_name
}
.cpp
)
TARGET_LINK_LIBRARIES
(
${
EXECUTABLE_NAME
}
${
PROJECT_NAME
}
)
ADD_DEPENDENCIES
(
${
EXECUTABLE_NAME
}
${
PROJECT_NAME
}
)
# Signal cast test.
SET
(
signalcast_libs test_signalcast_libA test_signalcast_libB
)
TARGET_LINK_LIBRARIES
(
${
EXECUTABLE_NAME
}
${${
test_name
}
_additional_libs
}
)
FOREACH
(
lib
${
signalcast_libs
}
)
ADD_LIBRARY
(
${
lib
}
SHARED
${
lib
}
.cpp
)
ADD_TEST
(
NAME
${
test_name
}
COMMAND
${
test_name
}
)
ENDFOREACH
(
test_name
)
TARGET_LINK_LIBRARIES
(
${
lib
}
${
PROJECT_NAME
}
)
ADD_DEPENDENCIES
(
${
lib
}
${
PROJECT_NAME
}
)
ENDFOREACH
()
DYNAMIC_GRAPH_TEST
(
test_signalcast
)
TARGET_LINK_LIBRARIES
(
${
EXECUTABLE_NAME
}
${
signalcast_libs
}
)
unitTesting
/test_depend.cpp
→
tests
/test_depend.cpp
View file @
38c251ae
File moved
unitTesting
/test_pool.cpp
→
tests
/test_pool.cpp
View file @
38c251ae
File moved
unitTesting
/test_signalcast.cpp
→
tests
/test_signalcast.cpp
View file @
38c251ae
File moved
unitTesting
/test_signalcast_libA.cpp
→
tests
/test_signalcast_libA.cpp
View file @
38c251ae
File moved
unitTesting
/test_signalcast_libA.h
→
tests
/test_signalcast_libA.h
View file @
38c251ae
File moved
unitTesting
/test_signalcast_libB.cpp
→
tests
/test_signalcast_libB.cpp
View file @
38c251ae
File moved
unitTesting
/test_signalcast_libB.h
→
tests
/test_signalcast_libB.h
View file @
38c251ae
File moved
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