Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TestSuite: List of third-party libraries #8254

Merged
merged 31 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
ff30601
Add version details to some third-party libraries
SaillantNicolas Jun 4, 2024
46f4171
display third party libraries in summary
SaillantNicolas Jun 12, 2024
b0f0f10
Extract JavaScript from Perl code to separate file
SaillantNicolas Jul 4, 2024
d8451ec
Update third-party library names and versions in CMakeLists.txt
SaillantNicolas Jul 10, 2024
fc9a08e
Update library check to use a function and loop
SaillantNicolas Jul 11, 2024
e5a32d7
Fix issue with VTK/Qt5/Qt6
lrineau Jul 12, 2024
2616293
Rename lib to cgal_3rdparty_lib
lrineau Jul 12, 2024
e3fd9ed
Update library version checking logic for MPFR and METIS
SaillantNicolas Jul 12, 2024
00cc6ce
Update GMP and GLPK version checks in CMakeLists.txt
SaillantNicolas Jul 16, 2024
26bab26
Improve regex pattern for third-party library detection
SaillantNicolas Jul 18, 2024
565d541
Restructure third party libraries in a table format
SaillantNicolas Aug 5, 2024
3c56db9
Improve third party libraries display toggle functionality
SaillantNicolas Aug 5, 2024
49cb591
move the code to a CMake module
lrineau Aug 21, 2024
2fad600
Add sed command to extract third-party library info
SaillantNicolas Aug 22, 2024
ae10e2e
Refactor library version extraction logic
SaillantNicolas Aug 22, 2024
44053f5
Update library versions and add new third-party libraries
SaillantNicolas Aug 23, 2024
2a1e5ee
only display the 3rd-party versions with CGAL_TEST_SUITE
lrineau Aug 23, 2024
8ef79af
Add ITT library version
SaillantNicolas Aug 26, 2024
b76177c
Add version check for OpenMesh library
SaillantNicolas Sep 2, 2024
78af7b9
Update OpenMesh version extraction logic in CMake script
SaillantNicolas Sep 13, 2024
f7a42a8
Add modal popup for TPL version display across platforms
SaillantNicolas Sep 18, 2024
32d2cf3
Adding a filter for the modal and the TPL table
SaillantNicolas Sep 19, 2024
262fb0b
Merge remote-tracking branch 'cgal/master' into List-third-party-libr…
lrineau Sep 20, 2024
c956f16
Merge master
lrineau Sep 20, 2024
c643942
Add logic to copy Summary_Script.js to test result dir
SaillantNicolas Sep 23, 2024
b5f95fe
Merge remote-tracking branch 'cgal/master' into List-third-party-libr…
lrineau Sep 24, 2024
7e8443f
updated crontab (automated commit)
lrineau Sep 25, 2024
de1872f
fix the error
lrineau Sep 25, 2024
58cf16d
Use jQuery TableSorter for sorting tables
SaillantNicolas Sep 25, 2024
e210184
Merge remote-tracking branch 'cgal/master'
lrineau Sep 25, 2024
885c906
fix the error
lrineau Sep 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Installation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -480,8 +480,9 @@ if(CMAKE_COMPILER_IS_GNUCXX)

endif()

message("== Generate version files (DONE) ==\n")
include(display-third-party-libs-versions)

message("== Generate version files (DONE) ==\n")
#--------------------------------------------------------------------------------------------------
#
# -= External libraries =-
Expand Down
87 changes: 87 additions & 0 deletions Installation/cmake/modules/display-third-party-libs-versions.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
set(LIBRARIES_TO_CHECK
Eigen3 Qt6 TBB OpenMesh Boost
GMP Threads SuiteSparse MPFI METIS
VTK SCIP OSQP LASLIB GLPK
ITT Ceres MPFR libpointmatcher ITK
OpenGR OpenCV ZLIB
)

function(get_library_version header_path major_macro minor_macro patchlevel_macro version_var)
if(EXISTS ${header_path})
file(READ ${header_path} HEADER_CONTENT)
if("${HEADER_CONTENT}" MATCHES "#define[ \t]+${major_macro}[ \t]+([0-9]+)")
set(VERSION_MAJOR ${CMAKE_MATCH_1})
endif()
if("${HEADER_CONTENT}" MATCHES "#define[ \t]+${minor_macro}[ \t]+([0-9]+)")
set(VERSION_MINOR ${CMAKE_MATCH_1})
endif()
if("${HEADER_CONTENT}" MATCHES "#define[ \t]+${patchlevel_macro}[ \t]+([0-9]+)")
set(VERSION_PATCHLEVEL ${CMAKE_MATCH_1})
else()
set(VERSION_PATCHLEVEL "")
endif()
if(VERSION_PATCHLEVEL)
set(${version_var} "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCHLEVEL}" PARENT_SCOPE)
elseif(VERSION_MAJOR GREATER_EQUAL 0 OR VERSION_MINOR GREATER_EQUAL 0)
set(${version_var} "${VERSION_MAJOR}.${VERSION_MINOR}" PARENT_SCOPE)
endif()
endif()
endfunction()

function(check_library cgal_3rdparty_lib)
set(QT_NO_CREATE_VERSIONLESS_TARGETS ON)
set(CMAKE_FIND_PACKAGE_QUIET TRUE)
string(TOUPPER ${cgal_3rdparty_lib} cgal_3rdparty_lib_upper)
find_package(${cgal_3rdparty_lib} QUIET)
set(CMAKE_FIND_PACKAGE_QUIET FALSE)
if(${cgal_3rdparty_lib}_FOUND)
set(version_var "")
if(DEFINED ${cgal_3rdparty_lib}_VERSION)
set(version_var ${${cgal_3rdparty_lib}_VERSION})
elseif(DEFINED ${cgal_3rdparty_lib}_VERSION_STRING)
set(version_var ${${cgal_3rdparty_lib}_VERSION_STRING})
elseif(DEFINED ${cgal_3rdparty_lib_upper}_VERSION)
set(version_var ${${cgal_3rdparty_lib_upper}_VERSION})
elseif(DEFINED ${cgal_3rdparty_lib_upper}_VERSION_STRING)
set(version_var ${${cgal_3rdparty_lib_upper}_VERSION_STRING})
elseif(${cgal_3rdparty_lib} STREQUAL "GMP")
set(version_var "")
get_library_version("${GMP_INCLUDE_DIR}/gmp.h" "__GNU_MP_VERSION" "__GNU_MP_VERSION_MINOR" "__GNU_MP_VERSION_PATCHLEVEL" version_var)
if(NOT version_var)
file(READ "${GMP_INCLUDE_DIR}/gmp.h" GMP_HEADER_CONTENT)
string(REGEX MATCHALL "#include[ \t]+\"([^\"]+)\"" INCLUDED_HEADERS "${GMP_HEADER_CONTENT}")
foreach(INCLUDED_HEADER ${INCLUDED_HEADERS})
string(REGEX REPLACE "#include[ \t]+\"([^\"]+)\"" "\\1" GMP_ARCH_HEADER "${INCLUDED_HEADER}")
set(GMP_ARCH_HEADER_PATH "${GMP_INCLUDE_DIR}/${GMP_ARCH_HEADER}")
if(EXISTS ${GMP_ARCH_HEADER_PATH})
get_library_version("${GMP_ARCH_HEADER_PATH}" "__GNU_MP_VERSION" "__GNU_MP_VERSION_MINOR" "__GNU_MP_VERSION_PATCHLEVEL" version_var)
if(version_var)
break()
endif()
endif()
endforeach()
endif()
elseif(${cgal_3rdparty_lib} STREQUAL "GLPK")
get_library_version("${GLPK_INCLUDE_DIR}/glpk.h" "GLP_MAJOR_VERSION" "GLP_MINOR_VERSION" "" version_var)
elseif(${cgal_3rdparty_lib} STREQUAL "MPFR")
get_library_version("${MPFR_INCLUDE_DIR}/mpfr.h" "MPFR_VERSION_MAJOR" "MPFR_VERSION_MINOR" "MPFR_VERSION_PATCHLEVEL" version_var)
elseif(${cgal_3rdparty_lib} STREQUAL "METIS")
get_library_version("${METIS_INCLUDE_DIR}/metis.h" "METIS_VER_MAJOR" "METIS_VER_MINOR" "METIS_VER_SUBMINOR" version_var)
elseif(${cgal_3rdparty_lib} STREQUAL "SuiteSparse")
get_library_version("${SuiteSparse_Config_INCLUDE_DIR}/SuiteSparse_config.h" "SUITESPARSE_MAIN_VERSION" "SUITESPARSE_SUB_VERSION" "SUITESPARSE_SUBSUB_VERSION" version_var)
elseif(${cgal_3rdparty_lib} STREQUAL "LASLIB")
get_library_version("${LASLIB_INCLUDE_DIR}/lasdefinitions.hpp" "LAS_TOOLS_VERSION" "" "" version_var)
endif()
if(version_var)
message(STATUS "Third-party library ${cgal_3rdparty_lib} ${version_var}")
else()
message(STATUS "Third-party library ${cgal_3rdparty_lib} found")
endif()
else()
message(STATUS "Third-party library ${cgal_3rdparty_lib} not found")
endif()
endfunction()

foreach(cgal_3rdparty_lib IN LISTS LIBRARIES_TO_CHECK)
check_library(${cgal_3rdparty_lib})
endforeach()
275 changes: 275 additions & 0 deletions Maintenance/test_handling/Summary_Script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,275 @@
const $mainContainer = $('#main_container');
const $platformContainer = $('#platform_container');
const $packageContainer = $('#package_container');
let release = "";
let packages = [];

function getAllTestDirectories(data) {
return data.platforms.flatMap(platform => platform.test_directories.map(directory => directory.test_directory));
}

function clearPackagesOptions() {
$('#packagesSelector option').each(function() {
if ($(this).val() !== 'all' && !packages.includes($(this).val())) {
$(this).remove();
}
});
}

function filterByPlatform(platform) {
const $packageSelector = $('#packagesSelector');
$packageSelector.prop('disabled', platform !== 'all');
$platformContainer.find('.platform').each(function() {
const $this = $(this);
if (platform === 'all' || $this.hasClass(platform)) {
$this.show();
} else {
$this.hide();
}
});
}

function filterByPackage(package) {
const $platformSelector = $('#platformSelector');
const $packageContainers = $packageContainer.find('.package');
if (package === 'all') {
$platformSelector.prop('disabled', false);
$platformContainer.show();
$packageContainer.hide();
} else {
$platformSelector.prop('disabled', true);
$platformContainer.hide();
$packageContainer.show();
}
$packageContainers.each(function() {
const $this = $(this);
if (package === 'all' || $this.hasClass(package)) {
$this.show();
} else {
$this.hide();
}
});
}

function filterByLetter(letter) {
const $letterContainers = $mainContainer.find('.letter_container');
$letterContainers.each(function() {
const $this = $(this);
if (letter === 'all' || $this.hasClass(letter)) {
$this.show();
} else {
$this.hide();
}
if ($this.children().length <= 2) {
$this.hide();
}
});
}

function search() {
const searchTerm = $('#searchInput').val().toLowerCase();
const releaseType = $('#releaseSelector').val();
const $resultsContainer = $('#searchResults');
$resultsContainer.empty();

if (!searchTerm) {
$resultsContainer.append('<p>Please enter a search term.</p>');
return;
}

const matchingDirectories = [];

window.data.platforms.forEach(platform => {
platform.test_directories.forEach(directory => {
if (directory.content.toLowerCase().includes(searchTerm)) {
matchingDirectories.push({
test_directory: directory.test_directory,
platform_name: platform.name
});
}
});
});

if (matchingDirectories.length === 0) {
$resultsContainer.append('<p>No matching directories found.</p>');
} else {
matchingDirectories.forEach(match => {
const link = `${window.data.release}/${match.test_directory}/TestReport_${match.platform_name}.gz`;
$resultsContainer.append(`<p><a href="${link}" target="_blank">${match.platform_name} - ${match.test_directory} - <strong>${window.data.release}</strong></a></p>`);
});
}
}

function packageContainer(platforms) {
const testDirectories = {};

platforms.forEach(platform => {
platform.test_directories.forEach(testDir => {
if (!testDirectories[testDir.test_directory]) {
testDirectories[testDir.test_directory] = {};
}
if (!testDirectories[testDir.test_directory][testDir.letters]) {
testDirectories[testDir.test_directory][testDir.letters] = [];
}
testDirectories[testDir.test_directory][testDir.letters].push({
platformName: platform.name,
content: testDir.content
});
});
});

for (const [testDirectory, letters] of Object.entries(testDirectories)) {
const $container = $('<div>', { class: 'package ' + testDirectory }).appendTo($packageContainer);
$('<h2>').text(testDirectory).appendTo($container);

for (const [letter, platformDetails] of Object.entries(letters)) {
const $letterContainer = $('<div>', {
class: 'letter_container ' + letter,
}).appendTo($container);
$('<h3>').text(letter).appendTo($letterContainer);

platformDetails.forEach(detail => {
const { platformName, content } = detail;

const $platformContainer = $('<div>', { class: 'platform-container' }).appendTo($letterContainer);

const $platformLink = $('<a>', {
href: `${release}/${testDirectory}/TestReport_${platformName}.gz`,
text: platformName,
class: 'platform-link'
}).appendTo($platformContainer);

const $contentSpan = $('<pre>', {
text: content,
class: 'summary-content',
css: { display: 'none' }
}).appendTo($letterContainer);

if (content.length > 0) {
const $toggleButton = $('<button>', {
class: 'toggle-button',
text: 'Show More',
click: function() {
if ($contentSpan.is(':hidden')) {
$contentSpan.show().css('background-color', '#D0D0E0');
$(this).text('Show Less');
} else {
$contentSpan.hide().css('background-color', 'transparent');
$(this).text('Show More');
}
}
}).appendTo($platformContainer);
}

$('<br>').appendTo($letterContainer);
});
}
}
}

function platformContainer(platforms) {
platforms.forEach(platform => {
const $container = $('<div>', { class: 'platform ' + platform.name }).appendTo($platformContainer);
$container.html(`<h2>Results of ${platform.name}</h2>`);
const tplString = platform.third_party_libraries.replace("TPL: ", "").trim();
const tplArray = tplString.split(",").map(tpl => tpl.trim()).filter(tpl => tpl.length > 0);
const $toggleButton = $('<button>', {
text: 'Third Party Libraries',
class: 'tpl-toggle-button',
click: function() {
$tplTable.toggle();
}
}).appendTo($container);
const $tplTable = $('<table>', { class: 'tpl-table', css: { display: 'none' } }).appendTo($container);
const $thead = $('<thead>').appendTo($tplTable);
const $tbody = $('<tbody>').appendTo($tplTable);

$('<tr>').append('<th>Third Party Libraries</th>').appendTo($thead);

let $row = $('<tr>').appendTo($tbody);
tplArray.forEach((tpl, index) => {
if (index > 0 && index % 5 === 0) {
$row = $('<tr>').appendTo($tbody);
}
$('<td>').text(tpl).appendTo($row);
});

const letters = ['n', 'w', 'o', 'r'];
letters.forEach(letter => {
const $letterContainer = $('<div>', { class: 'letter_container ' + letter }).appendTo($container);
$('<h3>').text(letter).appendTo($letterContainer);
const testDirectoriesForLetter = platform.test_directories.filter(directory => directory.letters === letter);
testDirectoriesForLetter.forEach(directory => {
const $directoryContainer = $('<div>', { class: 'directory_container' }).appendTo($letterContainer);
const $directoryName = $('<a>', {
href: `${release}/${directory.test_directory}/TestReport_${platform.name}.gz`,
text: `${directory.test_directory} `
}).appendTo($directoryContainer);
const $contentSpan = $('<pre>', {
text: directory.content,
class: 'summary-content',
css: { display: 'none' }
}).appendTo($letterContainer);
if (directory.content.length > 0) {
const $toggleButton = $('<button>', {
class: 'toggle-button',
text: 'Show More',
click: function() {
if ($contentSpan.is(':hidden')) {
$contentSpan.show().css('background-color', '#D0D0E0');
$(this).text('Show Less');
} else {
$contentSpan.hide().css('background-color', 'transparent');
$(this).text('Show More');
}
}
}).appendTo($directoryContainer);
$('<br>').appendTo($letterContainer);
}
});
if ($letterContainer.children().length <= 2) {
$letterContainer.hide();
}
});
});
}

function openAll() {
$('.summary-content').show().css('background-color', '#D0D0E0');
$('.toggle-button').text('Show Less');
}

function closeAll() {
$('.summary-content').hide().css('background-color', 'transparent');
$('.toggle-button').text('Show More');
}

function main() {
const url = searchURLs["current"];
$.getJSON(url, data => {
window.data = data;
release = data.release;
packages = getAllTestDirectories(data);
clearPackagesOptions();
platformContainer(data.platforms);
packageContainer(data.platforms);
$packageContainer.hide();

const urlParams = new URLSearchParams(window.location.search);
const platform = urlParams.get('platform');
if (platform) {
console.log("Platform is " + platform);
filterByPlatform(platform);
}
const package = urlParams.get('package');
if (package) {
console.log("Package is " + package);
filterByPackage(package);
}
$('#open-all').click(openAll);
$('#close-all').click(closeAll);
$('#search-button').click(search);
}).fail(error => console.log(error));
}

$(document).ready(main);
Loading