diff options
27 files changed, 41 insertions, 96 deletions
diff --git a/testdata/scad/features/null-polygons.dxf b/testdata/dxf/null-polygons.dxf index 390e42e..390e42e 100644 --- a/testdata/scad/features/null-polygons.dxf +++ b/testdata/dxf/null-polygons.dxf diff --git a/testdata/scad/dxf/null-polygons.scad b/testdata/scad/dxf/null-polygons.scad new file mode 100644 index 0000000..349ab6a --- /dev/null +++ b/testdata/scad/dxf/null-polygons.scad @@ -0,0 +1,2 @@ +linear_extrude(height=1) import_dxf("../../dxf/null-polygons.dxf"); +translate([0,20,0]) linear_extrude("../../dxf/null-polygons.dxf", height=1); diff --git a/testdata/scad/features/null-polygons.scad b/testdata/scad/features/null-polygons.scad deleted file mode 100644 index 4849c15..0000000 --- a/testdata/scad/features/null-polygons.scad +++ /dev/null @@ -1,2 +0,0 @@ -linear_extrude() import_dxf("null-polygons.dxf"); -linear_extrude("null-polygons.dxf"); diff --git a/testdata/scad/features/dim-all.dxf b/testdata/scad/misc/dim-all.dxf index 6ae7610..6ae7610 100644 --- a/testdata/scad/features/dim-all.dxf +++ b/testdata/scad/misc/dim-all.dxf diff --git a/testdata/scad/features/dim-all.scad b/testdata/scad/misc/dim-all.scad index 454ed11..454ed11 100644 --- a/testdata/scad/features/dim-all.scad +++ b/testdata/scad/misc/dim-all.scad diff --git a/testdata/scad/features/dxf-export.scad b/testdata/scad/misc/dxf-export.scad index 7f4b8cb..7f4b8cb 100644 --- a/testdata/scad/features/dxf-export.scad +++ b/testdata/scad/misc/dxf-export.scad diff --git a/testdata/scad/features/string-test.scad b/testdata/scad/misc/string-test.scad index 5ec4cfb..5ec4cfb 100644 --- a/testdata/scad/features/string-test.scad +++ b/testdata/scad/misc/string-test.scad diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 0bb6f19..9668df7 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -365,6 +365,9 @@ enable_testing() # Find all scad files file(GLOB MINIMAL_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/minimal/*.scad) file(GLOB FEATURES_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/features/*.scad) +list(REMOVE_ITEM FEATURES_FILES + ${CMAKE_SOURCE_DIR}/../testdata/scad/features/include\ test6.scad + ${CMAKE_SOURCE_DIR}/../testdata/scad/features/include-test5.scad) file(GLOB BUGS_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/bugs/*.scad) file(GLOB SCAD_DXF_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/dxf/*.scad) file(GLOB EXAMPLE_FILES ${CMAKE_SOURCE_DIR}/../examples/*.scad) @@ -390,7 +393,9 @@ list(APPEND ECHO_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/echo-tests.scad ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/escape-test.scad ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/parser-tests.scad - ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/builtin-tests.scad) + ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/builtin-tests.scad + ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/dim-all.scad + ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/string-test.scad) # Add echotest tests to CTest add_cmdline_test(echotest txt ${ECHO_FILES}) @@ -405,55 +410,28 @@ add_cmdline_test(csgtermtest txt ${MINIMAL_FILES}) add_cmdline_test(cgaltest stl ${CGALTEST_FILES}) # Add cgalpngtest tests to CTest -LIST(APPEND CGALPNGTEST_FILES - ${CMAKE_SOURCE_DIR}/../testdata/scad/features/2d-3d.scad - ${CMAKE_SOURCE_DIR}/../testdata/scad/features/circle-tests.scad - ${CMAKE_SOURCE_DIR}/../testdata/scad/features/square-tests.scad - ${CMAKE_SOURCE_DIR}/../testdata/scad/features/polygon-tests.scad - ${CMAKE_SOURCE_DIR}/../testdata/scad/features/cube-tests.scad - ${CMAKE_SOURCE_DIR}/../testdata/scad/features/sphere-tests.scad - ${CMAKE_SOURCE_DIR}/../testdata/scad/features/cylinder-tests.scad - ${CMAKE_SOURCE_DIR}/../testdata/scad/features/polyhedron-tests.scad - ${CMAKE_SOURCE_DIR}/../testdata/scad/features/union-tests.scad - ${CMAKE_SOURCE_DIR}/../testdata/scad/features/difference-tests.scad - ${CMAKE_SOURCE_DIR}/../testdata/scad/features/intersection-tests.scad - ${CMAKE_SOURCE_DIR}/../testdata/scad/features/linear_extrude-tests.scad - ${CMAKE_SOURCE_DIR}/../testdata/scad/features/rotate_extrude-tests.scad - ${CMAKE_SOURCE_DIR}/../testdata/scad/features/minkowski2-tests.scad - ${CMAKE_SOURCE_DIR}/../testdata/scad/features/minkowski3-tests.scad - ${CMAKE_SOURCE_DIR}/../testdata/scad/features/hull2-tests.scad - ${CMAKE_SOURCE_DIR}/../testdata/scad/features/surface-tests.scad - ${CMAKE_SOURCE_DIR}/../testdata/scad/features/import_dxf-tests.scad - ${CMAKE_SOURCE_DIR}/../testdata/scad/features/transform-tests.scad - ${CMAKE_SOURCE_DIR}/../testdata/scad/features/color-tests.scad - ${CMAKE_SOURCE_DIR}/../testdata/scad/features/background-modifier.scad - ${CMAKE_SOURCE_DIR}/../testdata/scad/features/highlight-modifier.scad - ${CMAKE_SOURCE_DIR}/../testdata/scad/features/root-modifier.scad - ${CMAKE_SOURCE_DIR}/../testdata/scad/features/disable-modifier.scad - ${CMAKE_SOURCE_DIR}/../testdata/scad/features/for-tests.scad - ${CMAKE_SOURCE_DIR}/../testdata/scad/features/for-nested-tests.scad - ${CMAKE_SOURCE_DIR}/../testdata/scad/features/intersection_for-tests.scad - ${CMAKE_SOURCE_DIR}/../testdata/scad/features/render-tests.scad - ${CMAKE_SOURCE_DIR}/../testdata/scad/features/projection-tests.scad - ${CMAKE_SOURCE_DIR}/../testdata/scad/features/assign-tests.scad - ${CMAKE_SOURCE_DIR}/../testdata/scad/features/include-tests.scad - ${CMAKE_SOURCE_DIR}/../testdata/scad/features/child-tests.scad - ${CMAKE_SOURCE_DIR}/../testdata/scad/features/ifelse-tests.scad - ${CMAKE_SOURCE_DIR}/../testdata/scad/features/rotate_extrude_dxf-tests.scad) -LIST(APPEND CGALPNGTEST_FILES ${SCAD_DXF_FILES}) -#LIST(APPEND CGALPNGTEST_FILES ${CMAKE_SOURCE_DIR}/../examples/example001.scad) +list(APPEND CGALPNGTEST_FILES ${FEATURES_FILES}) +list(APPEND CGALPNGTEST_FILES ${SCAD_DXF_FILES}) +list(APPEND OPENCSGTEST_FILES ${CGALPNGTEST_FILES}) + +list(REMOVE_ITEM CGALPNGTEST_FILES + ${CMAKE_SOURCE_DIR}/../testdata/scad/features/child-background.scad + ${CMAKE_SOURCE_DIR}/../testdata/scad/features/highlight-and-background-modifier.scad + ${CMAKE_SOURCE_DIR}/../testdata/scad/features/testcolornames.scad) + add_cmdline_test(cgalpngtest png ${CGALPNGTEST_FILES}) # Add opencsg tests to CTest -LIST(APPEND OPENCSGTEST_FILES ${CGALPNGTEST_FILES}) -LIST(APPEND OPENCSGTEST_FILES - ${CMAKE_SOURCE_DIR}/../testdata/scad/features/highlight-and-background-modifier.scad - ${CMAKE_SOURCE_DIR}/../testdata/scad/features/child-background.scad) -LIST(APPEND OPENCSGTEST_FILES ${SCAD_DXF_FILES}) + +# FIXME: This test illustrates a weakness in child() combined with modifiers. +# Reenable it when this is improved +list(REMOVE_ITEM OPENCSGTEST_FILES + ${CMAKE_SOURCE_DIR}/../testdata/scad/features/child-background.scad) + add_cmdline_test(opencsgtest png ${OPENCSGTEST_FILES}) # Add throwntogether tests to CTest -LIST(APPEND THROWNTOGETHERTEST_FILES ${CGALPNGTEST_FILES}) +list(APPEND THROWNTOGETHERTEST_FILES ${CGALPNGTEST_FILES}) add_cmdline_test(throwntogethertest png ${THROWNTOGETHERTEST_FILES}) # Add dxfexport tests to CTest diff --git a/tests/regression/cgalpngtest/hull3-tests-expected.png b/tests/regression/cgalpngtest/hull3-tests-expected.png Binary files differnew file mode 100644 index 0000000..50d838c --- /dev/null +++ b/tests/regression/cgalpngtest/hull3-tests-expected.png diff --git a/tests/regression/cgalpngtest/import_stl-tests-expected.png b/tests/regression/cgalpngtest/import_stl-tests-expected.png Binary files differnew file mode 100644 index 0000000..31395c2 --- /dev/null +++ b/tests/regression/cgalpngtest/import_stl-tests-expected.png diff --git a/tests/regression/cgalpngtest/null-polygons-expected.png b/tests/regression/cgalpngtest/null-polygons-expected.png Binary files differnew file mode 100644 index 0000000..3368f13 --- /dev/null +++ b/tests/regression/cgalpngtest/null-polygons-expected.png diff --git a/tests/regression/csgtexttest/dim-all-expected.txt b/tests/regression/csgtexttest/dim-all-expected.txt deleted file mode 100644 index 6c127a8..0000000 --- a/tests/regression/csgtexttest/dim-all-expected.txt +++ /dev/null @@ -1 +0,0 @@ -group1(group2+group2+group2+group2+group2+group2+group2+group2) diff --git a/tests/regression/dumptest/dim-all-expected.txt b/tests/regression/dumptest/dim-all-expected.txt deleted file mode 100644 index 98a9bd9..0000000 --- a/tests/regression/dumptest/dim-all-expected.txt +++ /dev/null @@ -1,9 +0,0 @@ - group(); - group(); - group(); - group(); - group(); - group(); - group(); - group(); - diff --git a/tests/regression/dumptest/dxf-export-expected.txt b/tests/regression/dumptest/dxf-export-expected.txt deleted file mode 100644 index 93be68c..0000000 --- a/tests/regression/dumptest/dxf-export-expected.txt +++ /dev/null @@ -1,16 +0,0 @@ - circle($fn = 0, $fa = 12, $fs = 1, r = 5); - multmatrix([[1, 0, 0, 15], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { - square(size = [10, 10], center = true); - } - multmatrix([[1, 0, 0, 30], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) { - polygon(points = [[-5, -5], [5, -5], [0, 5]], paths = [[0, 1, 2]], convexity = 1); - } - multmatrix([[1, 0, 0, 0], [0, 1, 0, -15], [0, 0, 1, 0], [0, 0, 0, 1]]) { - difference() { - circle($fn = 0, $fa = 12, $fs = 1, r = 5); - multmatrix([[1, 0, 0, 0], [0, 1, 0, -6], [0, 0, 1, 0], [0, 0, 0, 1]]) { - square(size = [12, 12], center = true); - } - } - } - diff --git a/tests/regression/dumptest/include test6-expected.txt b/tests/regression/dumptest/include test6-expected.txt deleted file mode 100644 index 8b13789..0000000 --- a/tests/regression/dumptest/include test6-expected.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/tests/regression/dumptest/include-test-expected.txt b/tests/regression/dumptest/include-test-expected.txt deleted file mode 100644 index 871e45d..0000000 --- a/tests/regression/dumptest/include-test-expected.txt +++ /dev/null @@ -1,20 +0,0 @@ -group() { - group() { - group() { - group(); - } - group() { - group(); - } - group() { - group(); - } - group() { - group(); - } - group() { - group(); - } - sphere($fn = 0, $fa = 12, $fs = 1, r = 1); - } -} diff --git a/tests/regression/dumptest/include-test5-expected.txt b/tests/regression/dumptest/include-test5-expected.txt deleted file mode 100644 index 8b13789..0000000 --- a/tests/regression/dumptest/include-test5-expected.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/tests/regression/dumptest/string-test-expected.txt b/tests/regression/dumptest/string-test-expected.txt deleted file mode 100644 index b2915cb..0000000 --- a/tests/regression/dumptest/string-test-expected.txt +++ /dev/null @@ -1,2 +0,0 @@ - group(); - diff --git a/tests/regression/echotest/dim-all-expected.txt b/tests/regression/echotest/dim-all-expected.txt new file mode 100644 index 0000000..702f026 --- /dev/null +++ b/tests/regression/echotest/dim-all-expected.txt @@ -0,0 +1,16 @@ +WARNING: Unsupported DXF Entity `LEADER' (1) in `/Users/kintel/code/OpenSCAD/openscad/testdata/scad/misc/dim-all.dxf'. +ECHO: linearX = 51.44957554275265 +WARNING: Unsupported DXF Entity `LEADER' (1) in `/Users/kintel/code/OpenSCAD/openscad/testdata/scad/misc/dim-all.dxf'. +ECHO: linearY = 29.13025467434841 +WARNING: Unsupported DXF Entity `LEADER' (1) in `/Users/kintel/code/OpenSCAD/openscad/testdata/scad/misc/dim-all.dxf'. +ECHO: aligned = 60.00000000000001 +WARNING: Unsupported DXF Entity `LEADER' (1) in `/Users/kintel/code/OpenSCAD/openscad/testdata/scad/misc/dim-all.dxf'. +ECHO: ordinateX = -49.17542445724735 +WARNING: Unsupported DXF Entity `LEADER' (1) in `/Users/kintel/code/OpenSCAD/openscad/testdata/scad/misc/dim-all.dxf'. +ECHO: ordinateY = 30.86974532565159 +WARNING: Unsupported DXF Entity `LEADER' (1) in `/Users/kintel/code/OpenSCAD/openscad/testdata/scad/misc/dim-all.dxf'. +ECHO: radius = 60 +WARNING: Unsupported DXF Entity `LEADER' (1) in `/Users/kintel/code/OpenSCAD/openscad/testdata/scad/misc/dim-all.dxf'. +ECHO: diameter = 120 +WARNING: Unsupported DXF Entity `LEADER' (1) in `/Users/kintel/code/OpenSCAD/openscad/testdata/scad/misc/dim-all.dxf'. +ECHO: arc = 59.03624346792648 diff --git a/tests/regression/echotest/string-test-expected.txt b/tests/regression/echotest/string-test-expected.txt new file mode 100644 index 0000000..1969a74 --- /dev/null +++ b/tests/regression/echotest/string-test-expected.txt @@ -0,0 +1 @@ +ECHO: "The quick brown fox \tjumps \"over\" the lazy dog.
The quick brown fox.\nThe \\lazy\\ dog." diff --git a/tests/regression/opencsgtest/hull3-tests-expected.png b/tests/regression/opencsgtest/hull3-tests-expected.png Binary files differnew file mode 100644 index 0000000..50d838c --- /dev/null +++ b/tests/regression/opencsgtest/hull3-tests-expected.png diff --git a/tests/regression/opencsgtest/import_stl-tests-expected.png b/tests/regression/opencsgtest/import_stl-tests-expected.png Binary files differnew file mode 100644 index 0000000..e6fdbca --- /dev/null +++ b/tests/regression/opencsgtest/import_stl-tests-expected.png diff --git a/tests/regression/opencsgtest/null-polygons-expected.png b/tests/regression/opencsgtest/null-polygons-expected.png Binary files differnew file mode 100644 index 0000000..ff06c62 --- /dev/null +++ b/tests/regression/opencsgtest/null-polygons-expected.png diff --git a/tests/regression/opencsgtest/testcolornames-expected.png b/tests/regression/opencsgtest/testcolornames-expected.png Binary files differnew file mode 100644 index 0000000..6fc6569 --- /dev/null +++ b/tests/regression/opencsgtest/testcolornames-expected.png diff --git a/tests/regression/throwntogethertest/hull3-tests-expected.png b/tests/regression/throwntogethertest/hull3-tests-expected.png Binary files differnew file mode 100644 index 0000000..50d838c --- /dev/null +++ b/tests/regression/throwntogethertest/hull3-tests-expected.png diff --git a/tests/regression/throwntogethertest/import_stl-tests-expected.png b/tests/regression/throwntogethertest/import_stl-tests-expected.png Binary files differnew file mode 100644 index 0000000..e6fdbca --- /dev/null +++ b/tests/regression/throwntogethertest/import_stl-tests-expected.png diff --git a/tests/regression/throwntogethertest/null-polygons-expected.png b/tests/regression/throwntogethertest/null-polygons-expected.png Binary files differnew file mode 100644 index 0000000..ff06c62 --- /dev/null +++ b/tests/regression/throwntogethertest/null-polygons-expected.png |