Commit f0a89149 authored by Robert Maynard's avatar Robert Maynard Committed by Brad King

RunCMake: Automatically support platform out override files

parent 6425a5f3
......@@ -55,6 +55,12 @@ but do not actually build anything. To add a test:
``<SubTest>-check.cmake``
Custom result check.
Note that when a specific platform expects differing stdout or stderr that
can be done by adding a platform specific output file. These follow the
naming convention of:
``<SubTest>-stdout-<platform_lower_case>.txt``
``<SubTest>-stderr-<platform_lower_case>.txt``
Note that trailing newlines will be stripped from actual and expected
test output before matching against the stdout and stderr expressions.
The code in ``<SubTest>-check.cmake`` may use variables
......
......@@ -21,10 +21,20 @@ function(run_cmake test)
else()
set(expect_result 0)
endif()
string(TOLOWER ${CMAKE_HOST_SYSTEM_NAME} platform_name)
if(platform_name MATCHES cygwin)
#remove all additional bits from cygwin name
set(platform_name cygwin)
endif()
foreach(o out err)
if(RunCMake-std${o}-file AND EXISTS ${top_src}/${RunCMake-std${o}-file})
file(READ ${top_src}/${RunCMake-std${o}-file} expect_std${o})
string(REGEX REPLACE "\n+$" "" expect_std${o} "${expect_std${o}}")
elseif(EXISTS ${top_src}/${test}-std${o}-${platform_name}.txt)
file(READ ${top_src}/${test}-std${o}-${platform_name}.txt expect_std${o})
string(REGEX REPLACE "\n+$" "" expect_std${o} "${expect_std${o}}")
elseif(EXISTS ${top_src}/${test}-std${o}.txt)
file(READ ${top_src}/${test}-std${o}.txt expect_std${o})
string(REGEX REPLACE "\n+$" "" expect_std${o} "${expect_std${o}}")
......
-- PrefixInPATH_INCLUDE_DIR='PrefixInPATH_INCLUDE_DIR-NOTFOUND'
-- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_file/include/PrefixInPATH.h'
-- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_file/include/PrefixInPATH.h'
-- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_file/include/PrefixInPATH.h'
-- PrefixInPATH_INCLUDE_DIR='PrefixInPATH_INCLUDE_DIR-NOTFOUND'
-- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_file/include/PrefixInPATH.h'
-- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_file/include/PrefixInPATH.h'
-- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_file/include/PrefixInPATH.h'
-- PrefixInPATH_INCLUDE_DIR='PrefixInPATH_INCLUDE_DIR-NOTFOUND'
-- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_file/include/PrefixInPATH.h'
-- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_file/include/PrefixInPATH.h'
-- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_file/include/PrefixInPATH.h'
-- PrefixInPATH_INCLUDE_DIR='PrefixInPATH_INCLUDE_DIR-NOTFOUND'
-- PrefixInPATH_INCLUDE_DIR='PrefixInPATH_INCLUDE_DIR-NOTFOUND'
-- PrefixInPATH_INCLUDE_DIR='PrefixInPATH_INCLUDE_DIR-NOTFOUND'
include(RunCMake)
if(WIN32 OR CYGWIN)
run_cmake(PrefixInPATH)
endif()
run_cmake(PrefixInPATH)
-- PrefixInPATH_LIBRARY='PrefixInPATH_LIBRARY-NOTFOUND'
-- PrefixInPATH_LIBRARY='.*/Tests/RunCMake/find_library/lib/libPrefixInPATH.a'
-- PrefixInPATH_LIBRARY='.*/Tests/RunCMake/find_library/lib/libPrefixInPATH.a'
-- PrefixInPATH_LIBRARY='.*/Tests/RunCMake/find_library/lib/libPrefixInPATH.a'
-- PrefixInPATH_LIBRARY='PrefixInPATH_LIBRARY-NOTFOUND'
-- PrefixInPATH_LIBRARY='.*/Tests/RunCMake/find_library/lib/libPrefixInPATH.a'
-- PrefixInPATH_LIBRARY='.*/Tests/RunCMake/find_library/lib/libPrefixInPATH.a'
-- PrefixInPATH_LIBRARY='.*/Tests/RunCMake/find_library/lib/libPrefixInPATH.a'
-- PrefixInPATH_LIBRARY='PrefixInPATH_LIBRARY-NOTFOUND'
-- PrefixInPATH_LIBRARY='.*/Tests/RunCMake/find_library/lib/libPrefixInPATH.a'
-- PrefixInPATH_LIBRARY='.*/Tests/RunCMake/find_library/lib/libPrefixInPATH.a'
-- PrefixInPATH_LIBRARY='.*/Tests/RunCMake/find_library/lib/libPrefixInPATH.a'
-- PrefixInPATH_LIBRARY='PrefixInPATH_LIBRARY-NOTFOUND'
-- PrefixInPATH_LIBRARY='PrefixInPATH_LIBRARY-NOTFOUND'
-- PrefixInPATH_LIBRARY='PrefixInPATH_LIBRARY-NOTFOUND'
......@@ -4,6 +4,4 @@ run_cmake(Created)
if(CMAKE_HOST_UNIX)
run_cmake(LibArchLink)
endif()
if(WIN32 OR CYGWIN)
run_cmake(PrefixInPATH)
endif()
run_cmake(PrefixInPATH)
-- PrefixInPATH_INCLUDE_DIR='PrefixInPATH_INCLUDE_DIR-NOTFOUND'
-- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_path/include'
-- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_path/include'
-- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_path/include'
-- PrefixInPATH_INCLUDE_DIR='PrefixInPATH_INCLUDE_DIR-NOTFOUND'
-- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_path/include'
-- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_path/include'
-- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_path/include'
-- PrefixInPATH_INCLUDE_DIR='PrefixInPATH_INCLUDE_DIR-NOTFOUND'
-- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_path/include'
-- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_path/include'
-- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_path/include'
-- PrefixInPATH_INCLUDE_DIR='PrefixInPATH_INCLUDE_DIR-NOTFOUND'
-- PrefixInPATH_INCLUDE_DIR='PrefixInPATH_INCLUDE_DIR-NOTFOUND'
-- PrefixInPATH_INCLUDE_DIR='PrefixInPATH_INCLUDE_DIR-NOTFOUND'
include(RunCMake)
if(WIN32 OR CYGWIN)
run_cmake(PrefixInPATH)
endif()
run_cmake(PrefixInPATH)
if(APPLE)
run_cmake(FrameworksWithSubdirs)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment