Skip to content
Snippets Groups Projects
Commit d418ec01 authored by Julien Malik's avatar Julien Malik
Browse files

ENH: add a test to check if the current working copy is the nightly revision

parent ec74f0ab
No related branches found
No related tags found
No related merge requests found
...@@ -20,6 +20,12 @@ SET(EPSILON_3 0.001) ...@@ -20,6 +20,12 @@ SET(EPSILON_3 0.001)
SET(TESTSYSTEM_TESTS ${CXX_TEST_PATH}/otbTestSystemTests) SET(TESTSYSTEM_TESTS ${CXX_TEST_PATH}/otbTestSystemTests)
#Test if the current working copy corresponds to the nightly revision number
ADD_TEST(tsTuIsNightlyRevision ${TESTSYSTEM_TESTS}
otbIsNightlyRevision
${OTB_WC_REVISION}
http://www.orfeo-toolbox.org/nightly/libNightlyNumber )
#Test a basic ascii comparison #Test a basic ascii comparison
ADD_TEST(tsTvCompareAscii ${TESTSYSTEM_TESTS} ADD_TEST(tsTvCompareAscii ${TESTSYSTEM_TESTS}
--compare-ascii ${NOTOL} --compare-ascii ${NOTOL}
...@@ -124,6 +130,7 @@ ADD_TEST(tsTvCompareAscii5epsilon2 ${TESTSYSTEM_TESTS} ...@@ -124,6 +130,7 @@ ADD_TEST(tsTvCompareAscii5epsilon2 ${TESTSYSTEM_TESTS}
# ------- CXX source files ----------------------------------- # ------- CXX source files -----------------------------------
SET(TESTSYSTEM_SRCS SET(TESTSYSTEM_SRCS
otbTestSystemTests.cxx otbTestSystemTests.cxx
otbIsNightlyRevision.cxx
otbCompareAsciiTests.cxx otbCompareAsciiTests.cxx
otbCompareAsciiTests2.cxx otbCompareAsciiTests2.cxx
otbCompareAsciiTests3.cxx otbCompareAsciiTests3.cxx
......
/*=========================================================================
Program: ORFEO Toolbox
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.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 notices for more information.
=========================================================================*/
#include <iostream>
#include <fstream>
#include "otbCurlHelper.h"
int otbIsNightlyRevision(int argc, char * argv[])
{
if (argc != 2)
{
return EXIT_FAILURE;
}
std::string wcRevision = argv[1];
std::string nightlyRevisionUrl = argv[2];
otb::CurlHelper::Pointer curl = otb::CurlHelper::New();
std::string nightlyRevision;
curl->RetrieveUrlInMemory(nightlyRevisionUrl, nightlyRevision);
if (nightlyRevision == wcRevision)
{
return EXIT_SUCCESS;
}
else
{
return EXIT_FAILURE;
}
}
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
void RegisterTests() void RegisterTests()
{ {
REGISTER_TEST(otbIsNightlyRevision);
REGISTER_TEST(otbCompareAsciiTests); REGISTER_TEST(otbCompareAsciiTests);
REGISTER_TEST(otbCompareAsciiTests2); REGISTER_TEST(otbCompareAsciiTests2);
REGISTER_TEST(otbCompareAsciiTests3); REGISTER_TEST(otbCompareAsciiTests3);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment