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

Fix unit test fff_print_tests #13886

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

jalapenopuzzle
Copy link

fff_print_tests fail when run in Debug mode:
At commit 5c7888b

user@prusa:/home/user/PrusaSlicer/build-debug$ make test
Running tests...
Test project /home/user/PrusaSlicer/build-debug
    Start 1: arrange_tests
1/6 Test #1: arrange_tests ....................   Passed   34.79 sec
    Start 2: thumbnails_tests
2/6 Test #2: thumbnails_tests .................   Passed    0.39 sec
    Start 3: libslic3r_tests
3/6 Test #3: libslic3r_tests ..................Subprocess aborted***Exception: 100.95 sec
    Start 4: fff_print_tests
4/6 Test #4: fff_print_tests ..................Subprocess aborted***Exception: 376.86 sec
    Start 5: sla_print_tests
5/6 Test #5: sla_print_tests ..................   Passed  3161.06 sec
    Start 6: slic3rutils_tests
6/6 Test #6: slic3rutils_tests ................   Passed   16.77 sec

67% tests passed, 2 tests failed out of 6

Total Test time (real) = 3690.87 sec

The following tests FAILED:
	  3 - libslic3r_tests (Subprocess aborted)
	  4 - fff_print_tests (Subprocess aborted)
Errors while running CTest
Output from these tests are in: /home/user/PrusaSlicer/build-debug/Testing/Temporary/LastTest.log
Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.
make: *** [Makefile:71: test] Error 8
user@prusa:/home/user/PrusaSlicer/build-debug$ 

This pull request addresses the failures in the fff_print_tests.

user@prusa:/home/user/PrusaSlicer/build-debug$ make test
Running tests...
Test project /home/user/PrusaSlicer/build-debug
    Start 1: arrange_tests
1/6 Test #1: arrange_tests ....................   Passed   31.95 sec
    Start 2: thumbnails_tests
2/6 Test #2: thumbnails_tests .................   Passed    0.03 sec
    Start 3: libslic3r_tests
3/6 Test #3: libslic3r_tests ..................Subprocess aborted***Exception:  94.54 sec
    Start 4: fff_print_tests
4/6 Test #4: fff_print_tests ..................   Passed  1178.31 sec
    Start 5: sla_print_tests
5/6 Test #5: sla_print_tests ..................   Passed  3006.60 sec
    Start 6: slic3rutils_tests
6/6 Test #6: slic3rutils_tests ................   Passed   16.55 sec

83% tests passed, 1 tests failed out of 6

Total Test time (real) = 4328.06 sec

The following tests FAILED:
	  3 - libslic3r_tests (Subprocess aborted)
Errors while running CTest
Output from these tests are in: /home/user/PrusaSlicer/build-debug/Testing/Temporary/LastTest.log
Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.
make: *** [Makefile:71: test] Error 8
user@prusa:/home/user/PrusaSlicer/build-debug$ 

Tested on Ubuntu 22.04 virtual machine.

The following changes were made:

  • Fix fff_print_tests assertion failure axis.size() <= 1
    PrusaSlicer/src/libslic3r/GCodeReader.cpp:24: char Slic3r::get_extrusion_axis_char(const Slic3r::GCodeConfig&): Assertion `axis.size() <= 1' failed.
    The set_deserialise_strict() method converts 'A' to the string "65" (representing the ASCII numerical value) instead of the string "A". Perhaps this should be fixed more robustly.
  • Fix fff_print_tests test name Temeperatures -> Temperatures
  • Fix fff_print_tests All travel moves happen within skirt
    Remove the last travel_moves point which returns to the origin (0,0) which is outside the convex hull. This point was causing CHECK(convex_hull.contains(travel_move)) to fail.
  • Fix fff_print_tests "Used Filament" test Assertion std::abs(length) < 1000.0' failed The test configured a retract_length of 10000000 which is larger than the asserted maximum retraction length of 1000. PrusaSlicer/src/libslic3r/GCode/GCodeWriter.cpp:473: std::string Slic3r::GCodeWriter::_retract(double, double, std::string_view): Assertion std::abs(length) < 1000.0' failed.
    Fixed by doing the print with two different (legal) retraction lengths and checking that the total_used_filament agrees in both cases.
  • Fix fff_print_tests "Slicing with retraction and lifting" remove illegal negative restart_extra test case
    Negative restart_extra is asserted against at PrusaSlicer/src/libslic3r/Extrucer.cpp:58
  • How to build - add instructions on how to run the unit tests

PrusaSlicer/src/libslic3r/GCodeReader.cpp:24: char Slic3r::get_extrusion_axis_char(const Slic3r::GCodeConfig&): Assertion `axis.size() <= 1' failed.
The set_deserialise_strict() method converts 'A' to the string "65" instead of "A". Perhaps this should be fixed more robustly.
Remove the last travel_moves point which returns to the origin (0,0) which is outside the convex hull. This point was causing CHECK(convex_hull.contains(travel_move)) to fail.
…< 1000.0' failed

The test configured a retract_length of 10000000 which is larger than the asserted maximum retraction length of 1000.
PrusaSlicer/src/libslic3r/GCode/GCodeWriter.cpp:473: std::string Slic3r::GCodeWriter::_retract(double, double, std::string_view): Assertion `std::abs(length) < 1000.0' failed.
Fixed by doing the print with two different (legal) retraction lengths and checking that the total_used_filament agrees in both cases.
…gal negative restart_extra test case

Negative restart_extra is asserted against at PrusaSlicer/src/libslic3r/Extrucer.cpp:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant