From: mquinson Date: Tue, 15 Jun 2010 22:15:41 +0000 (+0000) Subject: improve TOC desynch detection tool X-Git-Tag: v3_5~938 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/944387f62574ce821a5b039cd4acf28e90efe657 improve TOC desynch detection tool git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7871 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/buildtools/Cmake/GenerateDoc.cmake b/buildtools/Cmake/GenerateDoc.cmake index 4ac49782b1..b9cffe2cf9 100644 --- a/buildtools/Cmake/GenerateDoc.cmake +++ b/buildtools/Cmake/GenerateDoc.cmake @@ -212,14 +212,16 @@ foreach(file_name ${LISTE_GTUT}) string(REPLACE "\n" ";" file_content "${file_content}") foreach(line ${file_content}) - string(REGEX MATCH "[\\]s?u?b?section.*" line2 "${line}") + string(REGEX MATCH "[\\]s?u?b?s?u?b?section.*" line2 "${line}") string(REGEX MATCH ".*_toc.*" line3 "${line}") if(line2 AND NOT line3) string(REPLACE "\\section " "" line2 ${line2}) string(REPLACE "\\subsection " "subsection" line2 ${line2}) + string(REPLACE "\\subsubsection " "subsubsection" line2 ${line2}) string(REGEX REPLACE " .*" "" line2 ${line2}) - set(line2 " - \\ref ${line2}") - string(REPLACE " - \\ref subsection" " - \\ref " line2 ${line2}) + set(line2 " - \\ref ${line2}") + string(REPLACE " - \\ref subsection" " - \\ref " line2 ${line2}) + string(REPLACE " - \\ref subsubsection" " - \\ref " line2 ${line2}) file(APPEND ${PROJECT_DIRECTORY}/doc/tmp.realtoc "${line2}\n") endif(line2 AND NOT line3) endforeach(line ${file_content}) @@ -233,10 +235,11 @@ foreach(file_name ${LISTE_GTUT}) exec_program("${CMAKE_COMMAND} -E compare_files ${PROJECT_DIRECTORY}/doc/tmp.curtoc ${PROJECT_DIRECTORY}/doc/tmp.realtoc" OUTPUT_VARIABLE compare_files) if(compare_files) - message("Wrong toc for ${file_name}. Should be;") + message("Wrong toc for ${file_name}. Should be:") file(READ "${PROJECT_DIRECTORY}/doc/tmp.realtoc" file_content) message("${file_content}") - endif(compare_files) + exec_program("diff -u ${PROJECT_DIRECTORY}/doc/tmp.curtoc ${PROJECT_DIRECTORY}/doc/tmp.realtoc") + endif(compare_files) endforeach(file_name ${LISTE_GTUT}) file(REMOVE ${PROJECT_DIRECTORY}/doc/tmp.curtoc) @@ -283,6 +286,7 @@ endforeach(line ${file_content}) exec_program("${CMAKE_COMMAND} -E compare_files ${PROJECT_DIRECTORY}/doc/tmp.curtoc ${PROJECT_DIRECTORY}/doc/tmp.realtoc" OUTPUT_VARIABLE compare_files) if(compare_files) message("Wrong toc for gtut-tour.doc Right one is in tmp.realtoc") + exec_program("diff -u ${PROJECT_DIRECTORY}/doc/tmp.curtoc ${PROJECT_DIRECTORY}/doc/tmp.realtoc") else(compare_files) file(REMOVE ${PROJECT_DIRECTORY}/doc/tmp.realtoc) endif(compare_files)