From 5aca77a530fe1b6f47343f472bc391db03d999c5 Mon Sep 17 00:00:00 2001 From: Kenneth Moreland Date: Wed, 10 Sep 2014 13:36:16 -0600 Subject: [PATCH] Add SystemInformation test The SystemInformation test always passes. It prints out the contents of various configuration parameters. The intention is to capture this information in dashboard reports. That way if a change causes a dashboard failure and a developer does not have access to the dashboard, she can look at the output of this test to see the configuration of the build and that machine. --- CMake/VTKmSystemInformation.cmake | 57 +++++++++++++++++++++++++++++++ CMakeLists.txt | 4 +++ 2 files changed, 61 insertions(+) create mode 100644 CMake/VTKmSystemInformation.cmake diff --git a/CMake/VTKmSystemInformation.cmake b/CMake/VTKmSystemInformation.cmake new file mode 100644 index 000000000..e8818c274 --- /dev/null +++ b/CMake/VTKmSystemInformation.cmake @@ -0,0 +1,57 @@ +##============================================================================ +## Copyright (c) Kitware, Inc. +## All rights reserved. +## See LICENSE.txt for details. +## This software is distributed WITHOUT ANY WARRANTY; without even +## the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +## PURPOSE. See the above copyright notice for more information. +## +## Copyright 2014 Sandia Corporation. +## Copyright 2014 UT-Battelle, LLC. +## Copyright 2014. Los Alamos National Security +## +## Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +## the U.S. Government retains certain rights in this software. +## +## Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National +## Laboratory (LANL), the U.S. Government retains certain rights in +## this software. +##============================================================================ + +# This script is used to create the SystemInformation test. The test always +# passes. It just captures in its output the configuration of the system. +# This allows you to inspect the configuration of the system of a failed +# dashboard in case you don't have access to that dashboard. +# +# This script is called with a command like: +# +# cmake -D VTKm_BINARY_DIR= -P +# + +set(FILES + vtkm/internal/Configure.h + CMakeCache.txt + CMakeFiles/CMakeError.log + ) + +function(print_file filename) + set(full_filename "${VTKm_BINARY_DIR}/${filename}") + message(" + +============================================================================== + +Contents of \"${filename}\": +------------------------------------------------------------------------------") + if(EXISTS "${full_filename}") + file(READ ${full_filename} contents) + message("${contents}") + else() + message("The file \"${full_filename}\" does not exist.") + endif() +endfunction(print_file) + +message("CTEST_FULL_OUTPUT (Avoid ctest truncation of output)") + +foreach(filename ${FILES}) + print_file(${filename}) +endforeach() diff --git a/CMakeLists.txt b/CMakeLists.txt index a43a80dc1..1966db5ff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -92,10 +92,14 @@ include_directories( #----------------------------------------------------------------------------- # Add test to check for copyright statement on all source files. +# Also add test to output system information. if (VTKm_ENABLE_TESTING) add_test(NAME CopyrightStatement COMMAND ${CMAKE_COMMAND} "-DVTKm_SOURCE_DIR=${VTKm_SOURCE_DIR}" -P "${VTKm_SOURCE_DIR}/CMake/VTKmCheckCopyright.cmake" ) + add_test(NAME SystemInformation + COMMAND ${CMAKE_COMMAND} "-DVTKm_BINARY_DIR=${VTKm_BINARY_DIR}" -P "${VTKm_SOURCE_DIR}/CMake/VTKmSystemInformation.cmake" + ) endif (VTKm_ENABLE_TESTING) #-----------------------------------------------------------------------------