Skip to content

Commit

Permalink
Update test configs (openscad#4806)
Browse files Browse the repository at this point in the history
* Set Heavy tests to > 5 seconds on a decent workstation
* Updated example tests with green surfaces
* Fix z fighting in hull example
* Change font to Liberation Sans, to be certain it's available on all systems
  • Loading branch information
kintel authored Nov 5, 2023
1 parent 24e65d0 commit bfe4770
Show file tree
Hide file tree
Showing 26 changed files with 40 additions and 79 deletions.
4 changes: 2 additions & 2 deletions examples/Basics/LetterBlock.scad
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// LetterBlock.scad - Basic usage of text() and linear_extrude()

// Module instantiation
LetterBlock("M");
LetterBlock("Y");

// Module definition.
// size=30 defines an optional parameter with a default value.
Expand All @@ -14,7 +14,7 @@ module LetterBlock(letter, size=30) {
linear_extrude(height=size, convexity=4)
text(letter,
size=size*22/30,
font="Bitstream Vera Sans",
font="Liberation Sans:style=bold",
halign="center",
valign="center");
}
Expand Down
12 changes: 6 additions & 6 deletions examples/Basics/hull.scad
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
// The hull of a toy sailboat
$fs = .1;
hull(){
#translate([0,30,2.5]) sphere(1); //bow
#translate([0,10,-1]) cube([20,1,8],true); //1st bulkhead
#translate([0,10,-5]) cube([1,1,8],true); //1st keel
#translate([0,-8,-1]) cube([20,1,8],true); //2nd bulkhead
#translate([0,-8,-5]) cube([1,1,8],true); //2nd keel
#translate([0,-30,1]) cube([16,1,4],true); //stern
translate([0,30,2.5]) sphere(1); //bow
translate([0,10,-1]) cube([20,1,8],true); //1st bulkhead
translate([0,10,-5]) cube([1,1,8],true); //1st keel
translate([0,-8,-1]) cube([20,1,8],true); //2nd bulkhead
translate([0,-8,-5]) cube([1,1,8],true); //2nd keel
translate([0,-30,1]) cube([16,1,4],true); //stern
}
cylinder(40,1,1); //Mast

Expand Down
57 changes: 9 additions & 48 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,10 @@ list(APPEND SCADFILES_WITH_GREEN_FACES
${EXAMPLES_DIR}/Basics/CSG-modules.scad
${EXAMPLES_DIR}/Basics/CSG.scad
${EXAMPLES_DIR}/Basics/logo.scad
${EXAMPLES_DIR}/Basics/LetterBlock.scad
${EXAMPLES_DIR}/Basics/text_on_cube.scad
${EXAMPLES_DIR}/Basics/logo_and_text.scad
${EXAMPLES_DIR}/Parametric/sign.scad
${EXAMPLES_DIR}/Old/example001.scad
${EXAMPLES_DIR}/Old/example002.scad
${EXAMPLES_DIR}/Old/example003.scad
Expand Down Expand Up @@ -874,53 +878,10 @@ foreach(CONFIG $CACHE{TEST_CONFIGS})
unset(${CONFIG}_TEST_CONFIG CACHE)
endforeach()

# Heavy tests are tests taking more than 10 seconds on a development computer
# Heavy tests are tests taking more than 5 seconds on a decent 2023 desktop
set_test_config(Heavy FILES
cgalbinstlcgalpngtest_rotate_extrude-tests
cgalpngtest_camera-tests
cgalpngtest_for-nested-tests
cgalpngtest_fractal
cgalpngtest_issue267-normalization-crash
cgalpngtest_iteration
cgalpngtest_linear_extrude-scale-zero-tests
cgalpngtest_minkowski3-erosion
cgalpngtest_projection-extrude-tests
cgalpngtest_resize-tests
cgalpngtest_rotate_extrude-angle
cgalpngtest_rotate_extrude-tests
cgalpngtest_sphere-tests
cgalpngtest_surface-tests
cgalstlcgalpngtest_rotate_extrude-tests
csgpngtest_camera-tests
csgpngtest_for-nested-tests
csgpngtest_fractal
csgpngtest_issue267-normalization-crash
csgpngtest_iteration
csgpngtest_linear_extrude-scale-zero-tests
csgpngtest_minkowski3-erosion
csgpngtest_resize-tests
csgpngtest_rotate_extrude-angle
csgpngtest_rotate_extrude-tests
csgpngtest_sphere-tests
csgpngtest_surface-tests
monotonepngtest_rotate_extrude-tests
offpngtest_demo_cut
offpngtest_difference
offpngtest_fence
offpngtest_rounded_box
offpngtest_search
offpngtest_surface
offpngtest_translation
opencsgtest_issue267-normalization-crash
opencsgtest_minkowski3-erosion
openscad-colorscheme-metallic-render_CSG
stlpngtest_demo_cut
stlpngtest_difference
stlpngtest_fence
stlpngtest_search
stlpngtest_surface
stlpngtest_rounded_box
stlpngtest_translation
cgalpngtest_issue267-normalization-crash
)

# Bugs
Expand All @@ -934,7 +895,7 @@ set_test_config(Bugs FILES
)

# Examples
set_test_config(Examples FILES ${EXAMPLE_FILES} PREFIXES cgalpngtest opencsgtest throwntogethertest csgpngtest monotonepngtest stlpngtest stlcgalpngtest cgalstlcgalpngtest cgalbinstlcgalpngtest offpngtest offcgalpngtest)
set_test_config(Examples FILES ${EXAMPLE_FILES} PREFIXES cgalpngtest opencsgtest throwntogethertest csgpngtest monotonepngtest stlpngtest stlcgalpngtest cgalstlcgalpngtest cgalbinstlcgalpngtest offpngtest offcgalpngtest manifold-cgalpng dumptest-examples)
set_test_config(Examples FILES ${EXAMPLE_2D_FILES} PREFIXES dxfpngtest)

#############
Expand Down Expand Up @@ -1199,8 +1160,8 @@ add_cmdline_test(svgpngtest EXPERIMENTAL SCRIPT ${EX_IM_PNGTEST_PY} ARGS
function(add_output_file_test TESTCMD_BASENAME)
cmake_parse_arguments(TESTCMD "" "FILE;FORMAT" "" ${ARGN})

add_test(NAME "${TESTCMD_BASENAME}_${TESTCMD_FORMAT}_run" COMMAND ${OPENSCAD_BINPATH} ${TESTCMD_FILE} -o ${TESTCMD_BASENAME}.${TESTCMD_FORMAT})
add_test(NAME "${TESTCMD_BASENAME}_${TESTCMD_FORMAT}_check" COMMAND ${CMAKE_COMMAND} -E cat ${TESTCMD_BASENAME}.${TESTCMD_FORMAT})
add_test(NAME "${TESTCMD_BASENAME}_${TESTCMD_FORMAT}_run" CONFIGURATIONS Default COMMAND ${OPENSCAD_BINPATH} ${TESTCMD_FILE} -o ${TESTCMD_BASENAME}.${TESTCMD_FORMAT})
add_test(NAME "${TESTCMD_BASENAME}_${TESTCMD_FORMAT}_check" CONFIGURATIONS Default COMMAND ${CMAKE_COMMAND} -E cat ${TESTCMD_BASENAME}.${TESTCMD_FORMAT})
set_tests_properties("${TESTCMD_BASENAME}_${TESTCMD_FORMAT}_check" PROPERTIES DEPENDS "${TESTCMD_BASENAME}_${TESTCMD_FORMAT}_run")
endfunction()

Expand Down
Binary file modified tests/regression/cgalpngtest/GEB-expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/regression/cgalpngtest/LetterBlock-expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/regression/cgalpngtest/children-expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/regression/cgalpngtest/logo_and_text-expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/regression/cgalpngtest/rotate_extrude-expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/regression/cgalpngtest/sign-expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/regression/cgalpngtest/text_on_cube-expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ group() {
}
multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 5], [0, 0, 0, 1]]) {
linear_extrude(height = 30, $fn = 0, $fa = 12, $fs = 2, convexity = 4) {
text(text = "M", size = 22, spacing = 1, font = "Bitstream Vera Sans", direction = "ltr", language = "en", script = "Latn", halign = "center", valign = "center", $fn = 0, $fa = 12, $fs = 2);
text(text = "Y", size = 22, spacing = 1, font = "Liberation Sans:style=bold", direction = "ltr", language = "en", script = "Latn", halign = "center", valign = "center", $fn = 0, $fa = 12, $fs = 2);
}
}
}
Expand Down
44 changes: 22 additions & 22 deletions tests/regression/dumptest-examples/hull-expected.csg
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
hull() {
# multmatrix([[1, 0, 0, 0], [0, 1, 0, 30], [0, 0, 1, 2.5], [0, 0, 0, 1]]) {
sphere($fn = 0, $fa = 12, $fs = 0.1, r = 1);
}
# multmatrix([[1, 0, 0, 0], [0, 1, 0, 10], [0, 0, 1, -1], [0, 0, 0, 1]]) {
cube(size = [20, 1, 8], center = true);
}
# multmatrix([[1, 0, 0, 0], [0, 1, 0, 10], [0, 0, 1, -5], [0, 0, 0, 1]]) {
cube(size = [1, 1, 8], center = true);
}
# multmatrix([[1, 0, 0, 0], [0, 1, 0, -8], [0, 0, 1, -1], [0, 0, 0, 1]]) {
cube(size = [20, 1, 8], center = true);
}
# multmatrix([[1, 0, 0, 0], [0, 1, 0, -8], [0, 0, 1, -5], [0, 0, 0, 1]]) {
cube(size = [1, 1, 8], center = true);
}
# multmatrix([[1, 0, 0, 0], [0, 1, 0, -30], [0, 0, 1, 1], [0, 0, 0, 1]]) {
cube(size = [16, 1, 4], center = true);
}
}
cylinder($fn = 0, $fa = 12, $fs = 0.1, h = 40, r1 = 1, r2 = 1, center = false);
hull() {
multmatrix([[1, 0, 0, 0], [0, 1, 0, 30], [0, 0, 1, 2.5], [0, 0, 0, 1]]) {
sphere($fn = 0, $fa = 12, $fs = 0.1, r = 1);
}
multmatrix([[1, 0, 0, 0], [0, 1, 0, 10], [0, 0, 1, -1], [0, 0, 0, 1]]) {
cube(size = [20, 1, 8], center = true);
}
multmatrix([[1, 0, 0, 0], [0, 1, 0, 10], [0, 0, 1, -5], [0, 0, 0, 1]]) {
cube(size = [1, 1, 8], center = true);
}
multmatrix([[1, 0, 0, 0], [0, 1, 0, -8], [0, 0, 1, -1], [0, 0, 0, 1]]) {
cube(size = [20, 1, 8], center = true);
}
multmatrix([[1, 0, 0, 0], [0, 1, 0, -8], [0, 0, 1, -5], [0, 0, 0, 1]]) {
cube(size = [1, 1, 8], center = true);
}
multmatrix([[1, 0, 0, 0], [0, 1, 0, -30], [0, 0, 1, 1], [0, 0, 0, 1]]) {
cube(size = [16, 1, 4], center = true);
}
}
cylinder($fn = 0, $fa = 12, $fs = 0.1, h = 40, r1 = 1, r2 = 1, center = false);

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/regression/opencsgtest/GEB-expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/regression/opencsgtest/LetterBlock-expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/regression/opencsgtest/children-expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/regression/opencsgtest/example009-expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/regression/opencsgtest/hull-expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/regression/opencsgtest/rotate_extrude-expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/regression/throwntogethertest/GEB-expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/regression/throwntogethertest/LetterBlock-expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/regression/throwntogethertest/hull-expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/regression/throwntogethertest/rotate_extrude-expected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit bfe4770

Please sign in to comment.