Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
spdlog
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
spdlog
Commits
3a44818b
Commit
3a44818b
authored
Jun 18, 2016
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed pr #228 to include pthread and removed header_dependecies test
parent
64028851
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
71 deletions
+7
-71
tests/CMakeLists.txt
tests/CMakeLists.txt
+7
-2
tests/header_dependencies/CMakeLists.txt
tests/header_dependencies/CMakeLists.txt
+0
-58
tests/header_dependencies/main.c
tests/header_dependencies/main.c
+0
-7
tests/header_dependencies/main.cpp
tests/header_dependencies/main.cpp
+0
-4
No files found.
tests/CMakeLists.txt
View file @
3a44818b
...
@@ -9,11 +9,16 @@ add_library(catch INTERFACE)
...
@@ -9,11 +9,16 @@ add_library(catch INTERFACE)
target_include_directories
(
catch INTERFACE
${
CMAKE_CURRENT_SOURCE_DIR
}
)
target_include_directories
(
catch INTERFACE
${
CMAKE_CURRENT_SOURCE_DIR
}
)
file
(
GLOB catch_tests LIST_DIRECTORIES false RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
*.cpp
)
file
(
GLOB catch_tests LIST_DIRECTORIES false RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
*.cpp
)
if
(
CMAKE_COMPILER_IS_GNUCXX
)
set
(
CMAKE_CXX_FLAGS
"--std=c++11 -pthread"
)
set
(
CMAKE_EXE_LIKKER_FLAGS
"-pthread"
)
endif
()
add_executable
(
catch_tests
${
catch_tests
}
)
add_executable
(
catch_tests
${
catch_tests
}
)
target_link_libraries
(
catch_tests spdlog
)
target_link_libraries
(
catch_tests spdlog
)
add_test
(
NAME catch_tests COMMAND catch_tests
)
add_test
(
NAME catch_tests COMMAND catch_tests
)
file
(
MAKE_DIRECTORY
"
${
CMAKE_CURRENT_BINARY_DIR
}
/logs"
)
file
(
MAKE_DIRECTORY
"
${
CMAKE_CURRENT_BINARY_DIR
}
/logs"
)
# Ensure headers include their own dependencies
add_subdirectory
(
header_dependencies
)
tests/header_dependencies/CMakeLists.txt
deleted
100644 → 0
View file @
64028851
#
# Ensure all headers include all dependencies
#
set
(
IGNORED_HEADERS
""
)
set
(
COMMON_TEST_LIBRARIES spdlog
)
add_custom_target
(
header_dependencies
)
file
(
GLOB_RECURSE headers RELATIVE
"
${
HEADER_BASE
}
"
${
HEADER_BASE
}
/*.h
)
set
(
test_index 0
)
foreach
(
HEADER
${
headers
}
)
# Sample of relevant variables computed here
# HEADER: details/line_logger_impl.h
# symbolname: spdlog_details_line_logger_impl
# Compute symbolname
string
(
REPLACE
".h"
""
symbolname
"
${
HEADER
}
"
)
string
(
MAKE_C_IDENTIFIER
"
${
symbolname
}
"
symbolname
)
list
(
FIND IGNORED_HEADERS
"
${
HEADER
}
"
_index
)
# If we didn't explicitly ignore this and if we built this target
if
(
${
_index
}
EQUAL -1
)
#message(STATUS "${HEADER}: '${symbolname}'")
set
(
extension cpp
)
# Name the test and output file with a number, to dodge Windows path length limits.
# Call it header, instead of test, to avoid polluting the 'executable namespace'
set
(
test_name
"header_
${
extension
}
_
${
test_index
}
"
)
set
(
source_file
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/main.
${
extension
}
"
)
add_executable
(
${
test_name
}
"
${
source_file
}
"
)
target_compile_definitions
(
${
test_name
}
PRIVATE HEADER_TO_TEST=
"
${
HEADER
}
"
)
target_include_directories
(
${
test_name
}
PRIVATE
${
BUILDTREE_HEADER_BASE
}
${
HEADER_BASE
}
)
set_target_properties
(
${
test_name
}
PROPERTIES
FOLDER
"Header dependency tests"
)
target_link_libraries
(
${
test_name
}
PRIVATE
${
COMMON_TEST_LIBRARIES
}
${
LIBRARIES_
${
symbolname
}}
${
LIBRARIES_
${
libname
}}
)
add_test
(
NAME
${
test_name
}
_builds COMMAND
${
test_name
}
)
add_dependencies
(
header_dependencies
${
test_name
}
)
math
(
EXPR test_index
"
${
test_index
}
+ 1"
)
endif
()
endforeach
()
tests/header_dependencies/main.c
deleted
100644 → 0
View file @
64028851
#include HEADER_TO_TEST
int
main
(
int
argc
,
char
**
argv
)
{
return
0
;
}
tests/header_dependencies/main.cpp
deleted
100644 → 0
View file @
64028851
#include HEADER_TO_TEST
int
main
(
int
argc
,
char
*
argv
[])
{
return
0
;
}
Write
Preview
Markdown
is supported
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