Update translations. Change import filament message to warning instead. Change messages to be simpler

This commit is contained in:
Lam Wei Lun
2026-08-31 12:08:08 +08:00
97 changed files with 2298 additions and 2561 deletions

View File

@@ -30,25 +30,47 @@ if (APPLE)
target_link_libraries(test_common INTERFACE "-liconv -framework IOKit" "-framework CoreFoundation" -lc++)
endif()
# Copies runtime DLLs next to each test executable. Handles both single-config
# generators (CMAKE_BUILD_TYPE set) and multi-config generators (Ninja
# Multi-Config, Visual Studio) where CMAKE_BUILD_TYPE is empty and DLLs must
# land in every per-config output directory.
# Copies runtime shared libraries next to each test executable. Handles both
# single-config generators (CMAKE_BUILD_TYPE set) and multi-config generators
# (Ninja Multi-Config, Visual Studio) where CMAKE_BUILD_TYPE is empty and DLLs
# must land in every per-config output directory. On Windows the loader finds
# DLLs in the executable's directory; the Linux branch below does the same for
# the deps-built FFmpeg libraries and adds an $ORIGIN rpath, since the ELF
# loader does not search the executable's directory and the CI unit-test runner
# only receives the tests artifact (no deps install).
function(orcaslicer_copy_test_dlls)
if (NOT WIN32)
return()
endif()
set(_configs ${CMAKE_CONFIGURATION_TYPES})
if (NOT _configs)
set(_configs "${CMAKE_BUILD_TYPE}")
endif()
foreach(_cfg IN LISTS _configs)
if (_cfg STREQUAL "Debug")
orcaslicer_copy_dlls(COPY_DLLS "Debug" "d" _unused_dlls)
else()
orcaslicer_copy_dlls(COPY_DLLS "${_cfg}" "" _unused_dlls)
if (WIN32)
set(_configs ${CMAKE_CONFIGURATION_TYPES})
if (NOT _configs)
set(_configs "${CMAKE_BUILD_TYPE}")
endif()
endforeach()
foreach(_cfg IN LISTS _configs)
if (_cfg STREQUAL "Debug")
orcaslicer_copy_dlls(COPY_DLLS "Debug" "d" _unused_dlls)
else()
orcaslicer_copy_dlls(COPY_DLLS "${_cfg}" "" _unused_dlls)
endif()
endforeach()
elseif (UNIX AND NOT APPLE)
# Only test executables that link libslic3r_gui pull in the FFmpeg
# shared libraries (src/slic3r/CMakeLists.txt links PkgConfig::LIBAV
# into it). Copy them next to the executable and give it an $ORIGIN
# rpath so the loader finds them when the tests run on the CI unit-test
# runner, which only receives this build/tests tree.
get_target_property(_linked_libs ${_TEST_NAME}_tests LINK_LIBRARIES)
if (NOT "libslic3r_gui" IN_LIST _linked_libs)
return()
endif()
set_property(TARGET ${_TEST_NAME}_tests PROPERTY BUILD_RPATH "$ORIGIN")
set(_configs ${CMAKE_CONFIGURATION_TYPES})
if (NOT _configs)
set(_configs "${CMAKE_BUILD_TYPE}")
endif()
foreach(_cfg IN LISTS _configs)
orcaslicer_copy_sos(${_TEST_NAME}_tests "${_cfg}" "" _unused_sos)
endforeach()
endif()
endfunction()
# Register Catch2 tags as CTest labels so `ctest -L`/`-LE` can filter by tag.

View File

@@ -1000,7 +1000,7 @@ TEST_CASE("Published 3MF full-published slots are imported as standalone detache
check_double_vector(bundle.filaments.find_preset("My PLA", false, true)->config.opt<ConfigOptionFloatsNullable>("filament_retraction_length")->values, { 0.5 });
CHECK(pub.skipped_keys.empty());
REQUIRE(pub.material_replacements.size() == 1);
CHECK(pub.material_replacements[0] == "slot 0: My PLA -> PLA (published material imported)");
CHECK(pub.material_replacements[0] == "slot 0: My PLA -> PLA");
}
SECTION("type mismatch also detaches: a fresh same-type copy replaces the slot") {
@@ -1031,7 +1031,7 @@ TEST_CASE("Published 3MF full-published slots are imported as standalone detache
check_double_vector(bundle.filaments.find_preset("My PLA", false, true)->config.opt<ConfigOptionFloatsNullable>("filament_retraction_length")->values, { 0.5 });
CHECK(pub.skipped_keys.empty());
REQUIRE(pub.material_replacements.size() == 1);
CHECK(pub.material_replacements[0] == "slot 0: My PLA -> ABS (published material imported)");
CHECK(pub.material_replacements[0] == "slot 0: My PLA -> ABS");
}
SECTION("the author's identity rides on the copy when the type has no library match") {
@@ -1071,7 +1071,7 @@ TEST_CASE("Published 3MF full-published slots are imported as standalone detache
check_double_vector(bundle.filaments.find_preset("Other PLA", false, true)->config.opt<ConfigOptionFloatsNullable>("filament_retraction_length")->values, { 0.7 });
CHECK(pub.skipped_keys.empty());
REQUIRE(pub.material_replacements.size() == 1);
CHECK(pub.material_replacements[0] == "slot 0: My PLA -> ABS (published material imported)");
CHECK(pub.material_replacements[0] == "slot 0: My PLA -> ABS");
}
}
@@ -1137,7 +1137,7 @@ TEST_CASE("Published 3MF imports a full material under the author's stripped nam
check_double_vector(bundle.filaments.find_preset("Generic PLA @System", false, true)->config.opt<ConfigOptionFloatsNullable>("filament_retraction_length")->values, { 0.5 });
check_double_vector(bundle.filaments.find_preset("My PETG", false, true)->config.opt<ConfigOptionFloatsNullable>("filament_retraction_length")->values, { 0.6 });
REQUIRE(pub.material_replacements.size() == 1);
CHECK(pub.material_replacements[0] == "slot 0: My PETG -> Generic PLA (published material imported)");
CHECK(pub.material_replacements[0] == "slot 0: My PETG -> Generic PLA");
CHECK(pub.skipped_keys.empty());
}
@@ -1168,7 +1168,7 @@ TEST_CASE("Published 3MF imports a full material under the author's stripped nam
CHECK(bundle.filament_presets[0] == "Generic PLA");
check_double_vector(bundle.filaments.find_preset("Bambu PLA Basic @System", false, true)->config.opt<ConfigOptionFloatsNullable>("filament_retraction_length")->values, { 0.5 });
REQUIRE(pub.material_replacements.size() == 1);
CHECK(pub.material_replacements[0] == "slot 0: My PETG -> Generic PLA (published material imported)");
CHECK(pub.material_replacements[0] == "slot 0: My PETG -> Generic PLA");
CHECK(pub.skipped_keys.empty());
}
@@ -1217,7 +1217,7 @@ TEST_CASE("Published 3MF imports a full material under the author's stripped nam
check_double_vector(bundle.filaments.find_preset("Generic PLA", false, true)->config.opt<ConfigOptionFloatsNullable>("filament_retraction_length")->values, { 0.8 });
check_double_vector(bundle.filaments.find_preset("Generic PLA @System", false, true)->config.opt<ConfigOptionFloatsNullable>("filament_retraction_length")->values, { 0.5 });
REQUIRE(pub.material_replacements.size() == 1);
CHECK(pub.material_replacements[0] == "slot 1: Generic PLA @System -> Generic PLA (published material imported)");
CHECK(pub.material_replacements[0] == "slot 1: Generic PLA @System -> Generic PLA");
CHECK(pub.skipped_keys.empty());
}
}
@@ -1271,7 +1271,7 @@ TEST_CASE("Published 3MF uniquifies an imported full material name on collision"
check_double_vector(bundle.filaments.find_preset("Generic PLA @Qidi Q2 0.4 nozzle", false, true)->config.opt<ConfigOptionFloatsNullable>("filament_retraction_length")->values, { 0.5 });
check_double_vector(bundle.filaments.find_preset("Generic PLA @System", false, true)->config.opt<ConfigOptionFloatsNullable>("filament_retraction_length")->values, { 0.5 });
REQUIRE(pub.material_replacements.size() == 1);
CHECK(pub.material_replacements[0] == "slot 0: My PETG -> Generic PLA (Published) (published material imported)");
CHECK(pub.material_replacements[0] == "slot 0: My PETG -> Generic PLA (Published)");
CHECK(pub.skipped_keys.empty());
}
@@ -1413,7 +1413,7 @@ TEST_CASE("Published 3MF imports a full material as a detached project-embedded
check_double_vector(bundle.filaments.find_preset("Spare PLA", false, true)->config.opt<ConfigOptionFloatsNullable>("filament_retraction_length")->values, { 0.4 });
CHECK(pub.skipped_keys.empty());
REQUIRE(pub.material_replacements.size() == 1);
CHECK(pub.material_replacements[0] == "slot 0: My PETG -> Author PLA (published material imported)");
CHECK(pub.material_replacements[0] == "slot 0: My PETG -> Author PLA");
}
// Compatibility restrictions riding on the receiver's baseline preset must not leak onto the
@@ -1516,8 +1516,8 @@ TEST_CASE("Published 3MF shares one imported copy between identical full slots",
check_double_vector(bundle.filaments.find_preset("Author PLA", false, true)->config.opt<ConfigOptionFloatsNullable>("filament_retraction_length")->values, { 0.9 });
// Both slots reported, same target; originals untouched.
REQUIRE(pub.material_replacements.size() == 2);
CHECK(pub.material_replacements[0] == "slot 0: My PETG -> Author PLA (published material imported)");
CHECK(pub.material_replacements[1] == "slot 1: Other PETG -> Author PLA (published material imported)");
CHECK(pub.material_replacements[0] == "slot 0: My PETG -> Author PLA");
CHECK(pub.material_replacements[1] == "slot 1: Other PETG -> Author PLA");
check_double_vector(bundle.filaments.find_preset("My PETG", false, true)->config.opt<ConfigOptionFloatsNullable>("filament_retraction_length")->values, { 0.6 });
check_double_vector(bundle.filaments.find_preset("Other PETG", false, true)->config.opt<ConfigOptionFloatsNullable>("filament_retraction_length")->values, { 0.65 });
CHECK(pub.skipped_keys.empty());
@@ -1642,7 +1642,7 @@ TEST_CASE("Re-importing a published full material uniquifies the second copy", "
check_double_vector(bundle.filaments.find_preset("Author PLA (Published)", false, true)->config.opt<ConfigOptionFloatsNullable>("filament_retraction_length")->values, { 0.9 });
check_double_vector(bundle.filaments.find_preset("Author PLA", false, true)->config.opt<ConfigOptionFloatsNullable>("filament_retraction_length")->values, { 0.9 });
REQUIRE(pub.material_replacements.size() == 1);
CHECK(pub.material_replacements[0] == "slot 0: Author PLA -> Author PLA (Published) (published material imported)");
CHECK(pub.material_replacements[0] == "slot 0: Author PLA -> Author PLA (Published)");
}
CHECK(pub.skipped_keys.empty());
}
@@ -2496,7 +2496,7 @@ TEST_CASE("Published 3MF de-aliases an aliased slot by published identity withou
REQUIRE(target != nullptr);
check_double_vector(target->config.opt<ConfigOptionFloatsNullable>("filament_retraction_length")->values, { 0.9 });
REQUIRE(pub.material_replacements.size() == 1);
CHECK(pub.material_replacements[0].find("(de-aliased") != std::string::npos);
CHECK(pub.material_replacements[0] == "slot 1: My PLA -> Zzz PLA");
CHECK(pub.skipped_keys.empty());
}
@@ -3877,7 +3877,7 @@ TEST_CASE("Published 3MF scores a grown slot's material by identity tiers", "[Pr
CHECK(bundle.filament_presets[2] == "Aaa PLA");
// ...and since it is not an exact material match, the load says so.
REQUIRE(pub.material_replacements.size() == 1);
CHECK(pub.material_replacements[0] == "slot 2: Aaa PLA (substitute: no exact material match)");
CHECK(pub.material_replacements[0] == "slot 2: Aaa PLA (substitute)");
}
}
@@ -3985,7 +3985,7 @@ TEST_CASE("Published 3MF uniquifies a second imported full material as (Publishe
->config.opt<ConfigOptionFloatsNullable>("filament_retraction_length")->values,
{ 0.5 });
REQUIRE(pub.material_replacements.size() == 1);
CHECK(pub.material_replacements[0] == "slot 0: My PETG -> Generic PLA (Published 2) (published material imported)");
CHECK(pub.material_replacements[0] == "slot 0: My PETG -> Generic PLA (Published 2)");
CHECK(pub.skipped_keys.empty());
}