Commit 75e2c636 authored by Brad King's avatar Brad King
Browse files

Restore SystemInformation test

Fix the list of files to match modular VTK locations.  Pass the build
tree as an argument to the test instead of configuring a header file.
Avoid referening VTK_BINARY_DIR because that is not available in the
Testing/External project build.

Change-Id: I51a2a701725b3b8af48339ac799ca3630e208afc
parent 4f3b5222
......@@ -26,6 +26,7 @@ create_test_sourcelist(Tests ${vtk-module}CxxTests.cxx
TestSmartPointer.cxx
TestSortDataArray.cxx
TestSparseArrayValidation.cxx
TestSystemInformation.cxx
TestUnicodeStringAPI.cxx
TestUnicodeStringArrayAPI.cxx
TestVariantComparison.cxx
......@@ -47,8 +48,11 @@ vtk_module_test_executable(${vtk-module}CxxTests ${Tests}
set(TestsToRun ${Tests})
list(REMOVE_ITEM TestsToRun ${vtk-module}CxxTests.cxx)
# Tell TestSystemInformation where to find the build trees.
set(TestSystemInformation_ARGS ${CMAKE_BINARY_DIR})
# Add all the executables
foreach(test ${TestsToRun})
get_filename_component(TName ${test} NAME_WE)
add_test(NAME ${vtk-module}-${TName} COMMAND ${vtk-module}CxxTests ${TName})
add_test(NAME ${vtk-module}-${TName} COMMAND ${vtk-module}CxxTests ${TName} ${${TName}_ARGS})
endforeach()
#ifndef __vtk_SystemInformation_h
#define __vtk_SystemInformation_h
#define VTK_BINARY_DIR "@VTK_BINARY_DIR@"
#define CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@"
#endif
......@@ -18,7 +18,6 @@
// CMakeCache.txt file. This test will display the file.
#include "vtkDebugLeaks.h"
#include <Common/Testing/Cxx/SystemInformation.h>
#include <sys/stat.h>
void vtkSystemInformationPrintFile(const char* name, ostream& os)
......@@ -64,27 +63,32 @@ void vtkSystemInformationPrintFile(const char* name, ostream& os)
}
}
int TestSystemInformation(int,char *[])
int TestSystemInformation(int argc, char* argv[])
{
if(argc != 2)
{
cerr << "Usage: TestSystemInformation <top-of-build-tree>\n";
return 1;
}
std::string build_dir = argv[1];
build_dir += "/";
const char* files[] =
{
CMAKE_BINARY_DIR "/CMakeCache.txt",
VTK_BINARY_DIR "/vtkConfigure.h",
VTK_BINARY_DIR "/vtkToolkits.h",
CMAKE_BINARY_DIR "/CMakeFiles/CMakeError.log",
VTK_BINARY_DIR "/CMake/CMakeCache.txt",
VTK_BINARY_DIR "/VTKBuildSettings.cmake",
VTK_BINARY_DIR "/VTKLibraryDepends.cmake",
VTK_BINARY_DIR "/VTKConfig.cmake",
0
"CMakeCache.txt",
"CMakeFiles/CMakeError.log",
"Common/Core/vtkConfigure.h",
"Common/Core/vtkToolkits.h",
"VTKConfig.cmake",
0
};
cout << "CTEST_FULL_OUTPUT (Avoid ctest truncation of output)" << endl;
const char** f;
for(f = files; *f; ++f)
for(const char** f = files; *f; ++f)
{
vtkSystemInformationPrintFile(*f, cout);
std::string fname = build_dir + *f;
vtkSystemInformationPrintFile(fname.c_str(), cout);
}
#if defined(__sgi) && !defined(__GNUC__) && defined(_COMPILER_VERSION)
......
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