mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-19 19:33:47 +00:00
Feature/re enable tests (#10503)
* re-enable tests * Add comprehensive testing guide for OrcaSlicer in CLAUDE.md * fix build errors on Win * fix appimage errors
This commit is contained in:
@@ -20,8 +20,14 @@ target_link_libraries(${_TEST_NAME}_tests test_common libslic3r)
|
||||
set_property(TARGET ${_TEST_NAME}_tests PROPERTY FOLDER "tests")
|
||||
|
||||
if (WIN32)
|
||||
bambuslicer_copy_dlls(${_TEST_NAME}_tests)
|
||||
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
|
||||
orcaslicer_copy_dlls(COPY_DLLS "Debug" "d" output_dlls_Debug)
|
||||
elseif("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
|
||||
orcaslicer_copy_dlls(COPY_DLLS "RelWithDebInfo" "" output_dlls_Release)
|
||||
else()
|
||||
orcaslicer_copy_dlls(COPY_DLLS "Release" "" output_dlls_Release)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# catch_discover_tests(${_TEST_NAME}_tests TEST_PREFIX "${_TEST_NAME}: ")
|
||||
add_test(${_TEST_NAME}_tests ${_TEST_NAME}_tests ${CATCH_EXTRA_ARGS})
|
||||
catch_discover_tests(${_TEST_NAME}_tests TEST_PREFIX "${_TEST_NAME}: ")
|
||||
# add_test(${_TEST_NAME}_tests ${_TEST_NAME}_tests ${CATCH_EXTRA_ARGS})
|
||||
|
||||
@@ -22,7 +22,7 @@ SCENARIO("lift() is not ignored after unlift() at normal values of Z", "[GCodeWr
|
||||
AND_WHEN("GcodeWriter::Lift() is called") {
|
||||
REQUIRE(writer.lift().size() > 0);
|
||||
AND_WHEN("Z is moved post-lift to the same delta as the config Z lift") {
|
||||
REQUIRE(writer.travel_to_z(trouble_Z + config.retract_lift.values[0]).size() == 0);
|
||||
REQUIRE(writer.travel_to_z(trouble_Z + config.z_hop.values[0]).size() == 0);
|
||||
AND_WHEN("GCodeWriter::Unlift() is called") {
|
||||
REQUIRE(writer.unlift().size() == 0); // we're the same height so no additional move happens.
|
||||
THEN("GCodeWriter::Lift() emits gcode.") {
|
||||
@@ -38,7 +38,7 @@ SCENARIO("lift() is not ignored after unlift() at normal values of Z", "[GCodeWr
|
||||
AND_WHEN("GcodeWriter::Lift() is called") {
|
||||
REQUIRE(writer.lift().size() > 0);
|
||||
AND_WHEN("Z is moved post-lift to the same delta as the config Z lift") {
|
||||
REQUIRE(writer.travel_to_z(trouble_Z + config.retract_lift.values[0]).size() == 0);
|
||||
REQUIRE(writer.travel_to_z(trouble_Z + config.z_hop.values[0]).size() == 0);
|
||||
AND_WHEN("GCodeWriter::Unlift() is called") {
|
||||
REQUIRE(writer.unlift().size() == 0); // we're the same height so no additional move happens.
|
||||
THEN("GCodeWriter::Lift() emits gcode.") {
|
||||
@@ -54,7 +54,7 @@ SCENARIO("lift() is not ignored after unlift() at normal values of Z", "[GCodeWr
|
||||
AND_WHEN("GcodeWriter::Lift() is called") {
|
||||
REQUIRE(writer.lift().size() > 0);
|
||||
AND_WHEN("Z is moved post-lift to the same delta as the config Z lift") {
|
||||
REQUIRE(writer.travel_to_z(trouble_Z + config.retract_lift.values[0]).size() == 0);
|
||||
REQUIRE(writer.travel_to_z(trouble_Z + config.z_hop.values[0]).size() == 0);
|
||||
AND_WHEN("GCodeWriter::Unlift() is called") {
|
||||
REQUIRE(writer.unlift().size() == 0); // we're the same height so no additional move happens.
|
||||
THEN("GCodeWriter::Lift() emits gcode.") {
|
||||
|
||||
@@ -99,7 +99,11 @@ SCENARIO("Print: Brim generation", "[Print]") {
|
||||
{ "brim_width", 3 }
|
||||
});
|
||||
THEN("Brim Extrusion collection has 3 loops in it") {
|
||||
REQUIRE(print.brim().items_count() == 3);
|
||||
size_t total_items = 0;
|
||||
for (const auto& pair : print.get_brimMap()) {
|
||||
total_items += pair.second.items_count();
|
||||
}
|
||||
REQUIRE(total_items == 3);
|
||||
}
|
||||
}
|
||||
WHEN("Brim is set to 6mm") {
|
||||
@@ -109,7 +113,11 @@ SCENARIO("Print: Brim generation", "[Print]") {
|
||||
{ "brim_width", 6 }
|
||||
});
|
||||
THEN("Brim Extrusion collection has 6 loops in it") {
|
||||
REQUIRE(print.brim().items_count() == 6);
|
||||
size_t total_items = 0;
|
||||
for (const auto& pair : print.get_brimMap()) {
|
||||
total_items += pair.second.items_count();
|
||||
}
|
||||
REQUIRE(total_items == 6);
|
||||
}
|
||||
}
|
||||
WHEN("Brim is set to 6mm, extrusion width 0.5mm") {
|
||||
@@ -121,7 +129,11 @@ SCENARIO("Print: Brim generation", "[Print]") {
|
||||
});
|
||||
print.process();
|
||||
THEN("Brim Extrusion collection has 12 loops in it") {
|
||||
REQUIRE(print.brim().items_count() == 14);
|
||||
size_t total_items = 0;
|
||||
for (const auto& pair : print.get_brimMap()) {
|
||||
total_items += pair.second.items_count();
|
||||
}
|
||||
REQUIRE(total_items == 14);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -161,7 +161,11 @@ SCENARIO("Original Slic3r Skirt/Brim tests", "[SkirtBrim]") {
|
||||
THEN("2 brim lines") {
|
||||
Slic3r::Print print;
|
||||
Slic3r::Test::init_and_process_print({TestMesh::cube_20x20x20}, print, config);
|
||||
REQUIRE(print.brim().entities.size() == 2);
|
||||
size_t total_entities = 0;
|
||||
for (const auto& pair : print.get_brimMap()) {
|
||||
total_entities += pair.second.entities.size();
|
||||
}
|
||||
REQUIRE(total_entities == 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ SCENARIO("SupportMaterial: support_layers_z and contact_distance", "[SupportMate
|
||||
{
|
||||
ConstSupportLayerPtrsAdaptor support_layers = print.objects().front()->support_layers();
|
||||
|
||||
first_support_layer_height_ok = support_layers.front()->print_z == print.config().first_layer_height.value;
|
||||
first_support_layer_height_ok = support_layers.front()->print_z == print.config().initial_layer_print_height.value;
|
||||
|
||||
layer_height_minimum_ok = true;
|
||||
layer_height_maximum_ok = true;
|
||||
|
||||
Reference in New Issue
Block a user