summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/CMakeLists.txt71
-rw-r--r--tests/regression/cgalpngtest/hull3-tests-expected.pngbin0 -> 4408 bytes
-rw-r--r--tests/regression/cgalpngtest/import_stl-tests-expected.pngbin0 -> 7857 bytes
-rw-r--r--tests/regression/cgalpngtest/null-polygons-expected.pngbin0 -> 6886 bytes
-rw-r--r--tests/regression/csgtexttest/dim-all-expected.txt1
-rw-r--r--tests/regression/dumptest/dim-all-expected.txt9
-rw-r--r--tests/regression/dumptest/dxf-export-expected.txt16
-rw-r--r--tests/regression/dumptest/echo-tests-expected.txt9
-rw-r--r--tests/regression/dumptest/include test6-expected.txt1
-rw-r--r--tests/regression/dumptest/include-test-expected.txt20
-rw-r--r--tests/regression/dumptest/include-test5-expected.txt1
-rw-r--r--tests/regression/dumptest/string-test-expected.txt2
-rw-r--r--tests/regression/echotest/dim-all-expected.txt16
-rw-r--r--tests/regression/echotest/echo-tests-expected.txt1
-rw-r--r--tests/regression/echotest/len-tests-expected.txt7
-rw-r--r--tests/regression/echotest/string-test-expected.txt1
-rw-r--r--tests/regression/opencsgtest/hull3-tests-expected.pngbin0 -> 4408 bytes
-rw-r--r--tests/regression/opencsgtest/import_stl-tests-expected.pngbin0 -> 7991 bytes
-rw-r--r--tests/regression/opencsgtest/null-polygons-expected.pngbin0 -> 7152 bytes
-rw-r--r--tests/regression/opencsgtest/testcolornames-expected.pngbin0 -> 20822 bytes
-rw-r--r--tests/regression/throwntogethertest/hull3-tests-expected.pngbin0 -> 4408 bytes
-rw-r--r--tests/regression/throwntogethertest/import_stl-tests-expected.pngbin0 -> 7991 bytes
-rw-r--r--tests/regression/throwntogethertest/null-polygons-expected.pngbin0 -> 7152 bytes
23 files changed, 50 insertions, 105 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 69e43a9..393055b 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -374,8 +374,12 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ctest_pretty_print.py
# 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 FUNCTION_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/functions/*.scad)
file(GLOB EXAMPLE_FILES ${CMAKE_SOURCE_DIR}/../examples/*.scad)
list(APPEND DUMPTEST_FILES ${MINIMAL_FILES} ${FEATURES_FILES} ${EXAMPLE_FILES})
@@ -394,12 +398,14 @@ list(REMOVE_ITEM DUMPTEST_FILES ${CMAKE_SOURCE_DIR}/../examples/example016.scad)
list(REMOVE_ITEM DUMPTEST_FILES ${CMAKE_SOURCE_DIR}/../examples/example020.scad)
list(REMOVE_ITEM DUMPTEST_FILES ${CMAKE_SOURCE_DIR}/../examples/example021.scad)
-list(APPEND ECHO_FILES
+list(APPEND ECHO_FILES ${FUNCTION_FILES}
${CMAKE_SOURCE_DIR}/../testdata/scad/minimal/echo.scad
- ${CMAKE_SOURCE_DIR}/../testdata/scad/features/echo-tests.scad
+ ${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})
@@ -414,55 +420,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
new file mode 100644
index 0000000..50d838c
--- /dev/null
+++ b/tests/regression/cgalpngtest/hull3-tests-expected.png
Binary files differ
diff --git a/tests/regression/cgalpngtest/import_stl-tests-expected.png b/tests/regression/cgalpngtest/import_stl-tests-expected.png
new file mode 100644
index 0000000..31395c2
--- /dev/null
+++ b/tests/regression/cgalpngtest/import_stl-tests-expected.png
Binary files differ
diff --git a/tests/regression/cgalpngtest/null-polygons-expected.png b/tests/regression/cgalpngtest/null-polygons-expected.png
new file mode 100644
index 0000000..3368f13
--- /dev/null
+++ b/tests/regression/cgalpngtest/null-polygons-expected.png
Binary files differ
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/echo-tests-expected.txt b/tests/regression/dumptest/echo-tests-expected.txt
deleted file mode 100644
index 98a9bd9..0000000
--- a/tests/regression/dumptest/echo-tests-expected.txt
+++ /dev/null
@@ -1,9 +0,0 @@
- group();
- group();
- group();
- group();
- group();
- group();
- group();
- group();
-
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/echo-tests-expected.txt b/tests/regression/echotest/echo-tests-expected.txt
index cc548f6..ee9705f 100644
--- a/tests/regression/echotest/echo-tests-expected.txt
+++ b/tests/regression/echotest/echo-tests-expected.txt
@@ -6,3 +6,4 @@ ECHO: [1, "vecstr", 2.34, false]
ECHO: [1 : 2 : 10]
ECHO: vec = [1, 2, 3]
ECHO: range = [0 : 1 : 2]
+ECHO: "string generated by str()"
diff --git a/tests/regression/echotest/len-tests-expected.txt b/tests/regression/echotest/len-tests-expected.txt
new file mode 100644
index 0000000..2a776c0
--- /dev/null
+++ b/tests/regression/echotest/len-tests-expected.txt
@@ -0,0 +1,7 @@
+ECHO: 4
+ECHO: 4
+ECHO: 0
+ECHO: 0
+ECHO: 2
+ECHO: 3
+ECHO: undef
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
new file mode 100644
index 0000000..50d838c
--- /dev/null
+++ b/tests/regression/opencsgtest/hull3-tests-expected.png
Binary files differ
diff --git a/tests/regression/opencsgtest/import_stl-tests-expected.png b/tests/regression/opencsgtest/import_stl-tests-expected.png
new file mode 100644
index 0000000..e6fdbca
--- /dev/null
+++ b/tests/regression/opencsgtest/import_stl-tests-expected.png
Binary files differ
diff --git a/tests/regression/opencsgtest/null-polygons-expected.png b/tests/regression/opencsgtest/null-polygons-expected.png
new file mode 100644
index 0000000..ff06c62
--- /dev/null
+++ b/tests/regression/opencsgtest/null-polygons-expected.png
Binary files differ
diff --git a/tests/regression/opencsgtest/testcolornames-expected.png b/tests/regression/opencsgtest/testcolornames-expected.png
new file mode 100644
index 0000000..6fc6569
--- /dev/null
+++ b/tests/regression/opencsgtest/testcolornames-expected.png
Binary files differ
diff --git a/tests/regression/throwntogethertest/hull3-tests-expected.png b/tests/regression/throwntogethertest/hull3-tests-expected.png
new file mode 100644
index 0000000..50d838c
--- /dev/null
+++ b/tests/regression/throwntogethertest/hull3-tests-expected.png
Binary files differ
diff --git a/tests/regression/throwntogethertest/import_stl-tests-expected.png b/tests/regression/throwntogethertest/import_stl-tests-expected.png
new file mode 100644
index 0000000..e6fdbca
--- /dev/null
+++ b/tests/regression/throwntogethertest/import_stl-tests-expected.png
Binary files differ
diff --git a/tests/regression/throwntogethertest/null-polygons-expected.png b/tests/regression/throwntogethertest/null-polygons-expected.png
new file mode 100644
index 0000000..ff06c62
--- /dev/null
+++ b/tests/regression/throwntogethertest/null-polygons-expected.png
Binary files differ
contact: Jan Huwald // Impressum