summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2012-08-22 03:21:02 (GMT)
committerMarius Kintel <marius@kintel.net>2012-08-22 03:21:02 (GMT)
commit68da5cf2e896b6e482ef4919d23844c21e35124c (patch)
tree7de4c20716284ff0c955e8089337b10611539ece
parentf89b237ab6e06d1f3a8ebf5852c0e188cd6246b7 (diff)
Manual tests for module caching
-rw-r--r--testdata/modulecache-tests/README.txt75
-rw-r--r--testdata/modulecache-tests/circularfirst.scad1
-rw-r--r--testdata/modulecache-tests/circularmain.scad1
-rw-r--r--testdata/modulecache-tests/circularsecond.scad1
-rw-r--r--testdata/modulecache-tests/includefrommodule.scad3
-rw-r--r--testdata/modulecache-tests/moduleoverload.scad7
-rw-r--r--testdata/modulecache-tests/modulewithinclude.scad5
-rw-r--r--testdata/modulecache-tests/multipleA.scad6
-rw-r--r--testdata/modulecache-tests/multipleB.scad6
-rw-r--r--testdata/modulecache-tests/multiplecommon.scad1
-rw-r--r--testdata/modulecache-tests/multiplemain.scad5
-rw-r--r--testdata/modulecache-tests/mymodule-lib.scad3
-rw-r--r--testdata/modulecache-tests/radius.scad1
-rw-r--r--testdata/modulecache-tests/recursive.scad1
-rw-r--r--testdata/modulecache-tests/recursivemain.scad1
-rw-r--r--testdata/modulecache-tests/simpleinclude.scad1
-rw-r--r--testdata/modulecache-tests/simpleleaf.scad1
-rw-r--r--testdata/modulecache-tests/use-mcad.scad3
-rw-r--r--testdata/modulecache-tests/use.scad3
-rw-r--r--testdata/modulecache-tests/used.scad5
-rw-r--r--testdata/modulecache-tests/usenonexistingfile.scad1
21 files changed, 131 insertions, 0 deletions
diff --git a/testdata/modulecache-tests/README.txt b/testdata/modulecache-tests/README.txt
new file mode 100644
index 0000000..463261c
--- /dev/null
+++ b/testdata/modulecache-tests/README.txt
@@ -0,0 +1,75 @@
+Some work is needed to include these into the automated test suite.
+For now, run them manually according to these instructions:
+
+Compile OpenSCAD in debug mode. This will give console output related to module caching, e.g.:
+/path/to/used.scad: 0x103612f70
+Module cache size: 1 modules
+
+Test1:
+------
+
+o Open use.scad
+o Compile twice (F5) - check that module reference is the same
+
+Test2:
+------
+
+o Open use.scad
+o Compile (F5)
+o touch used.scad
+o Compile (F5) - check that the module reference changed
+
+Test3:
+------
+
+o Open use-mcad.scad
+o Compile (F5)
+o Check that you get a rounded box
+
+Test4:
+------
+
+o Open usenonexsistingfile.scad
+o Compile (F5)
+o Verify that you get: WARNING: Can't open 'use' file 'nofile.scad'.
+
+Test5:
+------
+
+o Open moduleoverload.scad
+o Compile (F5)
+o Verify that you get a sphere rather than a cylinder
+
+Test6:
+------
+
+o Open recursivemain.scad
+o Compile (F5)
+o Verify that OpenSCAD won't hang or crash
+
+Test7:
+------
+
+o Open circularmain.scad
+o Compile (F5)
+o Verify that OpenSCAD won't hang or crash
+
+Test8:
+------
+
+o Open multiplemain.scad
+o Compile (F5) - verify that you get a sphere and a cube of approximately the same size
+o Edit multipleB.scad:
+ - cube(1.5*F(), center=true);
+ + cube(2.5*F(), center=true);
+o Reload and Compile (F4) - verify that the cube got larger
+
+Test9:
+------
+
+o Open includefrommodule.scad
+o Compile (F5) - Verify that you get a circular disc
+o Edit radius.scad: Change RADIUS
+o Compile (F5) - Verify that the disc changed size
+
+FIXME: Test circular include
diff --git a/testdata/modulecache-tests/circularfirst.scad b/testdata/modulecache-tests/circularfirst.scad
new file mode 100644
index 0000000..90052a9
--- /dev/null
+++ b/testdata/modulecache-tests/circularfirst.scad
@@ -0,0 +1 @@
+use <circularsecond.scad>
diff --git a/testdata/modulecache-tests/circularmain.scad b/testdata/modulecache-tests/circularmain.scad
new file mode 100644
index 0000000..feb9dde
--- /dev/null
+++ b/testdata/modulecache-tests/circularmain.scad
@@ -0,0 +1 @@
+use <circularfirst.scad>
diff --git a/testdata/modulecache-tests/circularsecond.scad b/testdata/modulecache-tests/circularsecond.scad
new file mode 100644
index 0000000..feb9dde
--- /dev/null
+++ b/testdata/modulecache-tests/circularsecond.scad
@@ -0,0 +1 @@
+use <circularfirst.scad>
diff --git a/testdata/modulecache-tests/includefrommodule.scad b/testdata/modulecache-tests/includefrommodule.scad
new file mode 100644
index 0000000..70bd804
--- /dev/null
+++ b/testdata/modulecache-tests/includefrommodule.scad
@@ -0,0 +1,3 @@
+use <modulewithinclude.scad>
+
+mymodule();
diff --git a/testdata/modulecache-tests/moduleoverload.scad b/testdata/modulecache-tests/moduleoverload.scad
new file mode 100644
index 0000000..1928715
--- /dev/null
+++ b/testdata/modulecache-tests/moduleoverload.scad
@@ -0,0 +1,7 @@
+use <mymodule-lib.scad>
+
+module mymodule() {
+ sphere();
+}
+
+mymodule();
diff --git a/testdata/modulecache-tests/modulewithinclude.scad b/testdata/modulecache-tests/modulewithinclude.scad
new file mode 100644
index 0000000..17ff74a
--- /dev/null
+++ b/testdata/modulecache-tests/modulewithinclude.scad
@@ -0,0 +1,5 @@
+include <radius.scad>
+
+module mymodule() {
+ cylinder(r=RADIUS);
+}
diff --git a/testdata/modulecache-tests/multipleA.scad b/testdata/modulecache-tests/multipleA.scad
new file mode 100644
index 0000000..5f22471
--- /dev/null
+++ b/testdata/modulecache-tests/multipleA.scad
@@ -0,0 +1,6 @@
+use <multiplecommon.scad>
+
+module A()
+{
+ sphere(r=F());
+}
diff --git a/testdata/modulecache-tests/multipleB.scad b/testdata/modulecache-tests/multipleB.scad
new file mode 100644
index 0000000..adee23c
--- /dev/null
+++ b/testdata/modulecache-tests/multipleB.scad
@@ -0,0 +1,6 @@
+use <multiplecommon.scad>
+
+module B()
+{
+ cube(1.5*F(), center=true);
+}
diff --git a/testdata/modulecache-tests/multiplecommon.scad b/testdata/modulecache-tests/multiplecommon.scad
new file mode 100644
index 0000000..666c99f
--- /dev/null
+++ b/testdata/modulecache-tests/multiplecommon.scad
@@ -0,0 +1 @@
+function F() = 20;
diff --git a/testdata/modulecache-tests/multiplemain.scad b/testdata/modulecache-tests/multiplemain.scad
new file mode 100644
index 0000000..6dd75a7
--- /dev/null
+++ b/testdata/modulecache-tests/multiplemain.scad
@@ -0,0 +1,5 @@
+use <multipleA.scad>
+use <multipleB.scad>
+
+A();
+translate([40,0,0]) B();
diff --git a/testdata/modulecache-tests/mymodule-lib.scad b/testdata/modulecache-tests/mymodule-lib.scad
new file mode 100644
index 0000000..9d68581
--- /dev/null
+++ b/testdata/modulecache-tests/mymodule-lib.scad
@@ -0,0 +1,3 @@
+module mymodule() {
+ cylinder(center=true);
+}
diff --git a/testdata/modulecache-tests/radius.scad b/testdata/modulecache-tests/radius.scad
new file mode 100644
index 0000000..7620356
--- /dev/null
+++ b/testdata/modulecache-tests/radius.scad
@@ -0,0 +1 @@
+RADIUS = 5;
diff --git a/testdata/modulecache-tests/recursive.scad b/testdata/modulecache-tests/recursive.scad
new file mode 100644
index 0000000..5c117f4
--- /dev/null
+++ b/testdata/modulecache-tests/recursive.scad
@@ -0,0 +1 @@
+use <recursive.scad>
diff --git a/testdata/modulecache-tests/recursivemain.scad b/testdata/modulecache-tests/recursivemain.scad
new file mode 100644
index 0000000..5c117f4
--- /dev/null
+++ b/testdata/modulecache-tests/recursivemain.scad
@@ -0,0 +1 @@
+use <recursive.scad>
diff --git a/testdata/modulecache-tests/simpleinclude.scad b/testdata/modulecache-tests/simpleinclude.scad
new file mode 100644
index 0000000..9a09502
--- /dev/null
+++ b/testdata/modulecache-tests/simpleinclude.scad
@@ -0,0 +1 @@
+include <simpleleaf.scad>
diff --git a/testdata/modulecache-tests/simpleleaf.scad b/testdata/modulecache-tests/simpleleaf.scad
new file mode 100644
index 0000000..b216b6c
--- /dev/null
+++ b/testdata/modulecache-tests/simpleleaf.scad
@@ -0,0 +1 @@
+cylinder(h=25, r=12);
diff --git a/testdata/modulecache-tests/use-mcad.scad b/testdata/modulecache-tests/use-mcad.scad
new file mode 100644
index 0000000..b4b206a
--- /dev/null
+++ b/testdata/modulecache-tests/use-mcad.scad
@@ -0,0 +1,3 @@
+use <MCAD/boxes.scad>
+
+roundedBox([10,10,10], 2, $fn=16);
diff --git a/testdata/modulecache-tests/use.scad b/testdata/modulecache-tests/use.scad
new file mode 100644
index 0000000..693092a
--- /dev/null
+++ b/testdata/modulecache-tests/use.scad
@@ -0,0 +1,3 @@
+use <used.scad>
+
+used(s());
diff --git a/testdata/modulecache-tests/used.scad b/testdata/modulecache-tests/used.scad
new file mode 100644
index 0000000..cc301b5
--- /dev/null
+++ b/testdata/modulecache-tests/used.scad
@@ -0,0 +1,5 @@
+function s() = 20;
+
+module used(r) {
+ sphere(r);
+}
diff --git a/testdata/modulecache-tests/usenonexistingfile.scad b/testdata/modulecache-tests/usenonexistingfile.scad
new file mode 100644
index 0000000..b5e4dd9
--- /dev/null
+++ b/testdata/modulecache-tests/usenonexistingfile.scad
@@ -0,0 +1 @@
+use <nofile.scad>
contact: Jan Huwald // Impressum