Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
CMake
CMake
Commits
66801f4d
Commit
66801f4d
authored
Jan 24, 2019
by
Robert Maynard
Committed by
Brad King
Jan 28, 2019
Browse files
cmake: Add tests for verbose output to --build mode
parent
439fe2e2
Changes
11
Hide whitespace changes
Inline
Side-by-side
Tests/RunCMake/CMakeLists.txt
View file @
66801f4d
...
...
@@ -123,7 +123,7 @@ if(NOT CMAKE_GENERATOR MATCHES "Visual Studio|Xcode")
add_RunCMake_test
(
CMP0065
)
endif
()
if
(
CMAKE_GENERATOR MATCHES
"Make"
)
add_RunCMake_test
(
Make
)
add_RunCMake_test
(
Make
-DMAKE_IS_GNU=
${
MAKE_IS_GNU
}
)
endif
()
if
(
CMAKE_GENERATOR STREQUAL
"Ninja"
)
set
(
Ninja_ARGS
...
...
Tests/RunCMake/Make/RunCMakeTest.cmake
View file @
66801f4d
...
...
@@ -16,5 +16,22 @@ run_TargetMessages(OFF)
run_TargetMessages
(
VAR-ON -DCMAKE_TARGET_MESSAGES=ON
)
run_TargetMessages
(
VAR-OFF -DCMAKE_TARGET_MESSAGES=OFF
)
function
(
run_VerboseBuild
)
run_cmake
(
VerboseBuild
)
set
(
RunCMake_TEST_NO_CLEAN 1
)
set
(
RunCMake_TEST_BINARY_DIR
${
RunCMake_BINARY_DIR
}
/VerboseBuild-build
)
if
(
RunCMake_GENERATOR STREQUAL
"Watcom WMake"
)
# wmake does not actually show the verbose output.
set
(
RunCMake-stdout-file VerboseBuild-build-watcom-stdout.txt
)
endif
()
run_cmake_command
(
VerboseBuild-build
${
CMAKE_COMMAND
}
--build . -v --clean-first
)
unset
(
RunCMake-stdout-file
)
if
(
MAKE_IS_GNU
)
set
(
RunCMake-stdout-file VerboseBuild-nowork-gnu-stdout.txt
)
endif
()
run_cmake_command
(
VerboseBuild-nowork
${
CMAKE_COMMAND
}
--build . --verbose
)
endfunction
()
run_VerboseBuild
()
run_cmake
(
CustomCommandDepfile-ERROR
)
run_cmake
(
IncludeRegexSubdir
)
Tests/RunCMake/Make/VerboseBuild-build-stdout.txt
0 → 100644
View file @
66801f4d
.*DEFINE_FOR_VERBOSE_DETECTION.*hello.dir.*
Tests/RunCMake/Make/VerboseBuild-build-watcom-stdout.txt
0 → 100644
View file @
66801f4d
.
Tests/RunCMake/Make/VerboseBuild-nowork-gnu-stdout.txt
0 → 100644
View file @
66801f4d
.*Nothing to be done for.*hello.*
Tests/RunCMake/Make/VerboseBuild.cmake
0 → 100644
View file @
66801f4d
enable_language
(
C
)
# Make sure compile command is not hidden in a temp file.
string
(
REPLACE
"
${
CMAKE_START_TEMP_FILE
}
"
""
CMAKE_C_COMPILE_OBJECT
"
${
CMAKE_C_COMPILE_OBJECT
}
"
)
string
(
REPLACE
"
${
CMAKE_END_TEMP_FILE
}
"
""
CMAKE_C_COMPILE_OBJECT
"
${
CMAKE_C_COMPILE_OBJECT
}
"
)
add_executable
(
hello hello.c
)
target_compile_definitions
(
hello PRIVATE
"DEFINE_FOR_VERBOSE_DETECTION"
)
Tests/RunCMake/Make/hello.c
0 → 100644
View file @
66801f4d
#include
<stdio.h>
int
main
(
void
)
{
printf
(
"Hello world!
\n
"
);
return
0
;
}
Tests/RunCMake/Ninja/RunCMakeTest.cmake
View file @
66801f4d
...
...
@@ -30,6 +30,15 @@ function(run_NoWorkToDo)
endfunction
()
run_NoWorkToDo
()
function
(
run_VerboseBuild
)
run_cmake
(
VerboseBuild
)
set
(
RunCMake_TEST_NO_CLEAN 1
)
set
(
RunCMake_TEST_BINARY_DIR
${
RunCMake_BINARY_DIR
}
/VerboseBuild-build
)
run_cmake_command
(
VerboseBuild-build
${
CMAKE_COMMAND
}
--build . -v --clean-first
)
run_cmake_command
(
VerboseBuild-nowork
${
CMAKE_COMMAND
}
--build . --verbose
)
endfunction
()
run_VerboseBuild
()
function
(
run_CMP0058 case
)
# Use a single build tree for a few tests without cleaning.
set
(
RunCMake_TEST_BINARY_DIR
${
RunCMake_BINARY_DIR
}
/CMP0058-
${
case
}
-build
)
...
...
Tests/RunCMake/Ninja/VerboseBuild-build-stdout.txt
0 → 100644
View file @
66801f4d
.*DEFINE_FOR_VERBOSE_DETECTION.*hello.dir.*
Tests/RunCMake/Ninja/VerboseBuild-nowork-stdout.txt
0 → 100644
View file @
66801f4d
^ninja: no work to do
Tests/RunCMake/Ninja/VerboseBuild.cmake
0 → 100644
View file @
66801f4d
enable_language
(
C
)
add_executable
(
hello hello.c
)
target_compile_definitions
(
hello PRIVATE
"DEFINE_FOR_VERBOSE_DETECTION"
)
Brad King
@brad.king
mentioned in commit
9620cb93
·
Jan 29, 2019
mentioned in commit
9620cb93
mentioned in commit 9620cb935a49e7b4955f5b1d0ffa2e93b4327591
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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