From 2cd431d905d8dd33a59b095853e5ba7f4b66a9eb Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Mon, 6 Jan 2003 23:07:24 -0500 Subject: [PATCH] Start working on improved test --- Source/CTest/CMakeLists.txt | 18 ++++++++++++++ Source/CTest/cmCTestSubmit.cxx | 38 ++++++++++++++++++++++++++++++ Source/CTest/cmCTestSubmit.h | 43 ++++++++++++++++++++++++++++++++++ 3 files changed, 99 insertions(+) create mode 100644 Source/CTest/CMakeLists.txt create mode 100644 Source/CTest/cmCTestSubmit.cxx create mode 100644 Source/CTest/cmCTestSubmit.h diff --git a/Source/CTest/CMakeLists.txt b/Source/CTest/CMakeLists.txt new file mode 100644 index 000000000..130caea6e --- /dev/null +++ b/Source/CTest/CMakeLists.txt @@ -0,0 +1,18 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 1.5) +PROJECT(CTEST CXX) + +SUBDIRS(Curl) + +FIND_LIBRARY(CMAKE_LIBRARY NAMES CMakeLib PATHS + ${CTEST_BINARY_DIR}/..) + +SET(CTEST_SRCS + ../ctest.cxx + ../cmCTest.cxx + cmCTestSubmit.cxx) + +INCLUDE_DIRECTORIES(${CTEST_SOURCE_DIR}/..) + +ADD_DEFINITIONS(-DHAVE_CURL) +ADD_EXECUTABLE(ctest ${CTEST_SRCS}) +TARGET_LINK_LIBRARIES(ctest ${CMAKE_LIBRARY} Curl) \ No newline at end of file diff --git a/Source/CTest/cmCTestSubmit.cxx b/Source/CTest/cmCTestSubmit.cxx new file mode 100644 index 000000000..dbe9283e1 --- /dev/null +++ b/Source/CTest/cmCTestSubmit.cxx @@ -0,0 +1,38 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile$ + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html 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 notices for more information. + +=========================================================================*/ + +#include "cmCTestSubmit.h" +#include "cmSystemTools.h" + +bool cmCTestSubmit::SubmitUsingFTP(const std::vector& files, + const std::string& prefix, + const std::string& url) +{ + std::string::size_type cc; + for ( cc = 0; cc < files.size(); cc ++ ) + { + std::cout << "upload file: " << files[cc].c_str() << " to " << url.c_str() + << " / " << prefix.c_str() << " " << files[cc].c_str() << std::endl; + } +} + +bool cmCTestSubmit::SubmitUsingSCP(const std::vector& files, + const std::string& prefix, + const std::string& url) +{ + std::cout << "SubmitUsingSCP is not yet implemented" << std::endl; +} diff --git a/Source/CTest/cmCTestSubmit.h b/Source/CTest/cmCTestSubmit.h new file mode 100644 index 000000000..f8adcd9b7 --- /dev/null +++ b/Source/CTest/cmCTestSubmit.h @@ -0,0 +1,43 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile$ + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html 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 notices for more information. + +=========================================================================*/ +#ifndef cmCTestSubmit_h +#define cmCTestSubmit_h + +#include "cmStandardIncludes.h" + +/** \class cmCTestSubmit + * \brief Helper class for CTest + * + * Submit testing results + * + */ +class cmCTestSubmit +{ +public: + cmCTestSubmit() {} + ~cmCTestSubmit() {} + + /** + * Submit file using various ways + */ + bool SubmitUsingFTP(const std::vector& files, + const std::string& prefix, const std::string& url); + bool SubmitUsingSCP(const std::vector& files, + const std::string& prefix, const std::string& url); +}; + +#endif