Skip to content
Snippets Groups Projects
Commit ae7fb6f4 authored by Cyrille Valladeau's avatar Cyrille Valladeau
Browse files

ENH: finish html appli generator + tests

parent 04a182b2
Branches
Tags
No related merge requests found
......@@ -47,27 +47,21 @@ namespace Wrapper
oss << value; \
oss << "</p>";
#define otbDocHtmlBodyItalicMacro( value ) \
oss << "<span style=\" font-style:italic;\">"; \
oss << value; \
oss << "</span>";
#define otbDocHtmlBodyBoldMacro( value ) \
oss << "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-weight:600;\">"; \
oss << value; \
oss << "</span></p>";
#define otbDocHtmlBodyCodeMacro( value ) \
oss << "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Courier New, courier';\">"; \
oss << value; \
oss << "</p>";
#define otbDocHtmlBodyBoldCodeMacro( value ) \
oss << "<span style=\" font-weight:600;\"><p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Courier New, courier';\">"; \
oss << value; \
oss << "</p></span>";
#define otbDocHtmlParamMacro( type, param ) \
oss << "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:'Courier New,courier'; font-weight:600;\";>"; \
oss << "["<<type<<"] "<< param->GetName() <<": "; \
oss << "</span>"; \
if( std::string(param->GetDescription()).size()!=0 ) \
{ \
oss << param->GetDescription(); \
} \
oss << "</p>";
ApplicationHtmlDocGenerator::ApplicationHtmlDocGenerator()
{
......@@ -164,11 +158,7 @@ void ApplicationHtmlDocGenerator::GetDocParameters( const Application::Pointer a
if( app->GetParameterType(key) == ParameterType_Group)
{
oss << "<li>";
otbDocHtmlBodyBoldMacro( std::string("[group] ").append( param->GetName() ).append(":") );
if(std::string(param->GetDescription()).size()!=0)
{
otbDocHtmlBodyMacro(oss<<param->GetDescription());
}
otbDocHtmlParamMacro( "group", param);
std::string grDoc;
ApplicationHtmlDocGenerator::GetDocParameterGroup( app, grDoc, key );
oss<<grDoc;
......@@ -177,11 +167,7 @@ void ApplicationHtmlDocGenerator::GetDocParameters( const Application::Pointer a
else if( app->GetParameterType(key) == ParameterType_Choice )
{
oss << "<li>";
otbDocHtmlBodyBoldMacro( std::string("[choice] ").append( param->GetName() ).append(":"));
if(std::string(param->GetDescription()).size()!=0)
{
otbDocHtmlBodyMacro(param->GetDescription());
}
otbDocHtmlParamMacro( "choice", param);
std::string grDoc;
ApplicationHtmlDocGenerator::GetDocParameterChoice(app, grDoc, key);
oss<<grDoc;
......@@ -190,8 +176,7 @@ void ApplicationHtmlDocGenerator::GetDocParameters( const Application::Pointer a
else
{
oss << "<li>";
otbDocHtmlBodyBoldCodeMacro( std::string("[param] ").append( param->GetName() ).append(":"));
otbDocHtmlBodyMacro( param->GetDescription() );
otbDocHtmlParamMacro("param", param);
oss << "</li>";
}
}
......@@ -221,11 +206,7 @@ void ApplicationHtmlDocGenerator::GetDocParameterGroup( const Application::Point
if( app->GetParameterType(fullKey) == ParameterType_Group)
{
oss<<"<li>";
otbDocHtmlBodyBoldCodeMacro( std::string("[group] ").append( param->GetName() ).append(":"));
if(std::string(param->GetDescription()).size()!=0)
{
otbDocHtmlBodyMacro( param->GetDescription() );
}
otbDocHtmlParamMacro( "group", param);
std::string grDoc;
ApplicationHtmlDocGenerator::GetDocParameterGroup( app, grDoc, fullKey );
oss<<grDoc;
......@@ -234,11 +215,7 @@ void ApplicationHtmlDocGenerator::GetDocParameterGroup( const Application::Point
else if( app->GetParameterType(fullKey) == ParameterType_Choice )
{
oss<<"<li>";
otbDocHtmlBodyBoldCodeMacro( std::string("[choice] ").append( param->GetName() ).append(":"));
if(std::string(param->GetDescription()).size()!=0)
{
otbDocHtmlBodyMacro( param->GetDescription() );
}
otbDocHtmlParamMacro( "choice", param);
std::string grDoc;
ApplicationHtmlDocGenerator::GetDocParameterChoice(app, grDoc, fullKey );
oss<<grDoc;
......@@ -247,8 +224,7 @@ void ApplicationHtmlDocGenerator::GetDocParameterGroup( const Application::Point
else
{
oss << "<li>";
otbDocHtmlBodyBoldCodeMacro( std::string("[param] ").append( param->GetName() ).append(":"));
otbDocHtmlBodyMacro( param->GetDescription() );
otbDocHtmlParamMacro( "param", param );
oss <<"</li>";
}
}
......@@ -277,12 +253,7 @@ void ApplicationHtmlDocGenerator::GetDocParameterChoice( const Application::Poin
std::string grDoc;
oss << "<li>";
otbDocHtmlBodyBoldCodeMacro( std::string("[group] ").append( group->GetName() ).append(":"));
if(std::string(group->GetDescription()).size()!=0)
{
otbDocHtmlBodyMacro( group->GetDescription() );
}
otbDocHtmlParamMacro( "group", group);
ApplicationHtmlDocGenerator::GetDocParameterGroup( app, grDoc, fullKey );
oss<<grDoc;
oss<<"</li>";
......
if( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
SET(BASELINE ${OTB_DATA_ROOT}/Baseline/OTB/Images)
set(BASELINE_FILES ${OTB_DATA_ROOT}/Baseline/OTB/Files)
#Tolerance on pixel image diff
SET(NOTOL 0.0)
set(CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH})
set(INPUTDATA ${OTB_DATA_ROOT}/Input)
......@@ -151,6 +158,9 @@ add_test(owTvApplicationHtmlDocGeneratorNew ${OTB_WRAPPER_TESTS}
)
add_test(owTvApplicationHtmlDocGeneratorTest ${OTB_WRAPPER_TESTS}
--compare-ascii ${NOTOL}
${TEMP}/owTvOReadImageInfoDoc.html
${BASELINE}/owTvOReadImageInfoDoc.html
otbWrapperApplicationHtmlDocGeneratorTest1
ReadImageInfo
$<TARGET_FILE_DIR:otbapp_ReadImageInfo>
......@@ -185,3 +195,5 @@ otbWrapperApplicationHtmlDocGeneratorTest.cxx
include_directories(${CMAKE_SOURCE_DIR}/Code/Core)
add_executable(otbWrapperTests ${Wrapper_SRCS})
target_link_libraries(otbWrapperTests OTBApplicationEngine OTBTesting)
endif( NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING )
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment