summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2012-06-04 09:22:09 (GMT)
committerMarius Kintel <marius@kintel.net>2012-06-04 09:22:09 (GMT)
commit38cb06c3f0c62cbbe911a1543128bde610c45031 (patch)
treef9e278f298e44a288b6fb0e97b1b0f8e938ef38d
parent2836f0c37273aa41ba8280ee459ced418dbb74ea (diff)
Added test cases for issue #123
-rw-r--r--testdata/scad/features/import_dxf-tests.scad1
-rw-r--r--testdata/scad/features/import_stl-tests.scad1
-rw-r--r--testdata/scad/templates/import_dxf-tests-template.scad10
-rw-r--r--testdata/scad/templates/import_stl-tests-template.scad4
-rw-r--r--testdata/scad/templates/include-tests-template.scad (renamed from testdata/scad/misc/include-tests-template.scad)0
-rw-r--r--testdata/scad/templates/use-tests-template.scad (renamed from testdata/scad/misc/use-tests-template.scad)0
-rw-r--r--tests/CMakeLists.txt8
-rw-r--r--tests/regression/cgalpngtest/import_dxf-tests-expected.pngbin9919 -> 4286 bytes
-rw-r--r--tests/regression/cgalpngtest/import_stl-tests-expected.pngbin9164 -> 5758 bytes
-rw-r--r--tests/regression/dumptest/import_dxf-tests-expected.txt3
-rw-r--r--tests/regression/dumptest/import_stl-tests-expected.txt3
-rw-r--r--tests/regression/opencsgtest/import_dxf-tests-expected.pngbin9289 -> 4491 bytes
-rw-r--r--tests/regression/opencsgtest/import_stl-tests-expected.pngbin9438 -> 6207 bytes
-rw-r--r--tests/regression/throwntogethertest/import_dxf-tests-expected.pngbin4414 -> 4503 bytes
-rw-r--r--tests/regression/throwntogethertest/import_stl-tests-expected.pngbin9438 -> 6207 bytes
15 files changed, 28 insertions, 2 deletions
diff --git a/testdata/scad/features/import_dxf-tests.scad b/testdata/scad/features/import_dxf-tests.scad
index 736f26e..50a5416 100644
--- a/testdata/scad/features/import_dxf-tests.scad
+++ b/testdata/scad/features/import_dxf-tests.scad
@@ -7,3 +7,4 @@ translate([-200,200,0]) import(file="../../dxf/multiple-layers.dxf", layer="0");
translate([0,200,0]) import(file="../../dxf/multiple-layers.dxf", layer="0");
translate([200,200,0]) import(file="../../dxf/multiple-layers.dxf", layer="noname");
translate([0,200,0]) import(file="../../dxf/multiple-layers.dxf", layer="Layer with a pretty long name including \\ \"special\" /'\\\\ characters");
+translate([200,0,0]) import(file="/Users/kintel/code/OpenSCAD/openscad/tests/../testdata/dxf/polygons.dxf");
diff --git a/testdata/scad/features/import_stl-tests.scad b/testdata/scad/features/import_stl-tests.scad
index 7104078..af42e8d 100644
--- a/testdata/scad/features/import_stl-tests.scad
+++ b/testdata/scad/features/import_stl-tests.scad
@@ -1,3 +1,4 @@
import_stl("import.stl");
translate([2,0,0]) import("import.stl");
translate([4,0,0]) import("import_bin.stl");
+translate([0,2,0]) import("/Users/kintel/code/OpenSCAD/openscad/tests/../testdata/scad/features/import.stl");
diff --git a/testdata/scad/templates/import_dxf-tests-template.scad b/testdata/scad/templates/import_dxf-tests-template.scad
new file mode 100644
index 0000000..f10dd06
--- /dev/null
+++ b/testdata/scad/templates/import_dxf-tests-template.scad
@@ -0,0 +1,10 @@
+import();
+translate([-210,0,0]) import(file="../../dxf/polygons.dxf");
+translate([-210,0,0]) import(file="../../dxf/polygons.dxf", origin=[0,110]);
+translate([-210,0,0]) import(file="../../dxf/polygons.dxf", origin=[110,110], scale=0.5);
+import(file="../../dxf/multiple-layers.dxf");
+translate([-200,200,0]) import(file="../../dxf/multiple-layers.dxf", layer="0");
+translate([0,200,0]) import(file="../../dxf/multiple-layers.dxf", layer="0");
+translate([200,200,0]) import(file="../../dxf/multiple-layers.dxf", layer="noname");
+translate([0,200,0]) import(file="../../dxf/multiple-layers.dxf", layer="Layer with a pretty long name including \\ \"special\" /'\\\\ characters");
+translate([200,0,0]) import(file="@CMAKE_SOURCE_DIR@/../testdata/dxf/polygons.dxf");
diff --git a/testdata/scad/templates/import_stl-tests-template.scad b/testdata/scad/templates/import_stl-tests-template.scad
new file mode 100644
index 0000000..685b868
--- /dev/null
+++ b/testdata/scad/templates/import_stl-tests-template.scad
@@ -0,0 +1,4 @@
+import_stl("import.stl");
+translate([2,0,0]) import("import.stl");
+translate([4,0,0]) import("import_bin.stl");
+translate([0,2,0]) import("@CMAKE_SOURCE_DIR@/../testdata/scad/features/import.stl");
diff --git a/testdata/scad/misc/include-tests-template.scad b/testdata/scad/templates/include-tests-template.scad
index 43bda57..43bda57 100644
--- a/testdata/scad/misc/include-tests-template.scad
+++ b/testdata/scad/templates/include-tests-template.scad
diff --git a/testdata/scad/misc/use-tests-template.scad b/testdata/scad/templates/use-tests-template.scad
index 24591f8..24591f8 100644
--- a/testdata/scad/misc/use-tests-template.scad
+++ b/testdata/scad/templates/use-tests-template.scad
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 569f631..5ec8be7 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -611,10 +611,14 @@ endforeach()
set_directory_properties(PROPERTIES TEST_INCLUDE_FILE "${CMAKE_SOURCE_DIR}/EnforceConfig.cmake")
# Subst files
-configure_file(${CMAKE_SOURCE_DIR}/../testdata/scad/misc/include-tests-template.scad
+configure_file(${CMAKE_SOURCE_DIR}/../testdata/scad/templates/include-tests-template.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/include-tests.scad)
-configure_file(${CMAKE_SOURCE_DIR}/../testdata/scad/misc/use-tests-template.scad
+configure_file(${CMAKE_SOURCE_DIR}/../testdata/scad/templates/use-tests-template.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/use-tests.scad)
+configure_file(${CMAKE_SOURCE_DIR}/../testdata/scad/templates/import_stl-tests-template.scad
+ ${CMAKE_SOURCE_DIR}/../testdata/scad/features/import_stl-tests.scad)
+configure_file(${CMAKE_SOURCE_DIR}/../testdata/scad/templates/import_dxf-tests-template.scad
+ ${CMAKE_SOURCE_DIR}/../testdata/scad/features/import_dxf-tests.scad)
# Find all scad files
file(GLOB MINIMAL_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/minimal/*.scad)
diff --git a/tests/regression/cgalpngtest/import_dxf-tests-expected.png b/tests/regression/cgalpngtest/import_dxf-tests-expected.png
index 7c8a63e..f885b09 100644
--- a/tests/regression/cgalpngtest/import_dxf-tests-expected.png
+++ b/tests/regression/cgalpngtest/import_dxf-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
index 08aa225..de7638a 100644
--- a/tests/regression/cgalpngtest/import_stl-tests-expected.png
+++ b/tests/regression/cgalpngtest/import_stl-tests-expected.png
Binary files differ
diff --git a/tests/regression/dumptest/import_dxf-tests-expected.txt b/tests/regression/dumptest/import_dxf-tests-expected.txt
index 977efcc..d98b3e2 100644
--- a/tests/regression/dumptest/import_dxf-tests-expected.txt
+++ b/tests/regression/dumptest/import_dxf-tests-expected.txt
@@ -21,4 +21,7 @@
multmatrix([[1, 0, 0, 0], [0, 1, 0, 200], [0, 0, 1, 0], [0, 0, 0, 1]]) {
import(file = "../../dxf/multiple-layers.dxf", layer = "Layer with a pretty long name including \\ \"special\" /'\\\\ characters", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 2);
}
+ multmatrix([[1, 0, 0, 200], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
+ import(file = "../../dxf/polygons.dxf", layer = "", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 2);
+ }
diff --git a/tests/regression/dumptest/import_stl-tests-expected.txt b/tests/regression/dumptest/import_stl-tests-expected.txt
index 648a207..947f137 100644
--- a/tests/regression/dumptest/import_stl-tests-expected.txt
+++ b/tests/regression/dumptest/import_stl-tests-expected.txt
@@ -5,4 +5,7 @@
multmatrix([[1, 0, 0, 4], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
import(file = "import_bin.stl", layer = "", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 2);
}
+ multmatrix([[1, 0, 0, 0], [0, 1, 0, 2], [0, 0, 1, 0], [0, 0, 0, 1]]) {
+ import(file = "import.stl", layer = "", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 2);
+ }
diff --git a/tests/regression/opencsgtest/import_dxf-tests-expected.png b/tests/regression/opencsgtest/import_dxf-tests-expected.png
index 6e568c7..010a222 100644
--- a/tests/regression/opencsgtest/import_dxf-tests-expected.png
+++ b/tests/regression/opencsgtest/import_dxf-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
index 19e233a..0bd9ab6 100644
--- a/tests/regression/opencsgtest/import_stl-tests-expected.png
+++ b/tests/regression/opencsgtest/import_stl-tests-expected.png
Binary files differ
diff --git a/tests/regression/throwntogethertest/import_dxf-tests-expected.png b/tests/regression/throwntogethertest/import_dxf-tests-expected.png
index e8173d9..f5ef9fc 100644
--- a/tests/regression/throwntogethertest/import_dxf-tests-expected.png
+++ b/tests/regression/throwntogethertest/import_dxf-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
index 19e233a..0bd9ab6 100644
--- a/tests/regression/throwntogethertest/import_stl-tests-expected.png
+++ b/tests/regression/throwntogethertest/import_stl-tests-expected.png
Binary files differ
contact: Jan Huwald // Impressum