summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CompileWarningAsError/RunCMakeTest.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/CompileWarningAsError/RunCMakeTest.cmake')
-rw-r--r--Tests/RunCMake/CompileWarningAsError/RunCMakeTest.cmake19
1 files changed, 12 insertions, 7 deletions
diff --git a/Tests/RunCMake/CompileWarningAsError/RunCMakeTest.cmake b/Tests/RunCMake/CompileWarningAsError/RunCMakeTest.cmake
index a532f72..b068c18 100644
--- a/Tests/RunCMake/CompileWarningAsError/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CompileWarningAsError/RunCMakeTest.cmake
@@ -1,13 +1,18 @@
include(RunCMake)
-function(run_compile_warn test)
- set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${test}-build)
+function(run_compile_warn test lang extension)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${test}_${lang}-build)
set(RunCMake_TEST_OUTPUT_MERGE 1)
- run_cmake_with_options(${test} ${ARGN})
+ run_cmake_with_options(${test}_${lang} "-DLANGUAGE=${lang}" "-DEXTENSION=${extension}" ${ARGN})
set(RunCMake_TEST_NO_CLEAN 1)
- run_cmake_command(${test}-Build ${CMAKE_COMMAND} --build . ${verbose_args})
+ run_cmake_command(${test}_${lang}-Build ${CMAKE_COMMAND} --build . ${verbose_args})
endfunction()
-run_compile_warn(WerrorOn)
-run_compile_warn(WerrorOff)
-run_compile_warn(WerrorOnIgnore "--compile-no-warning-as-error")
+set(langs C CXX)
+set(exts c cxx)
+
+foreach(lang ext IN ZIP_LISTS langs exts)
+ run_compile_warn(WerrorOn ${lang} ${ext})
+ run_compile_warn(WerrorOff ${lang} ${ext})
+ run_compile_warn(WerrorOnIgnore ${lang} ${ext} "--compile-no-warning-as-error")
+endforeach()