summaryrefslogtreecommitdiff
path: root/testdata/modulecache-tests
diff options
context:
space:
mode:
authordon bright <hugh.m.bright@gmail.com>2013-01-28 02:42:20 (GMT)
committerdon bright <hugh.m.bright@gmail.com>2013-01-28 02:42:20 (GMT)
commit1e64dddf1ea30282c89de7f35854a68614234652 (patch)
tree165d37c1c66f6ff79d48c74794238b3f0bed09da /testdata/modulecache-tests
parent5c779159c208ca3d88c88479ab29f9cd66574859 (diff)
parentd0856efe6da545693f9c50a8a2514a9f999ab5ef (diff)
Merge branch 'master' of github.com:openscad/openscad into issue159
Diffstat (limited to 'testdata/modulecache-tests')
-rw-r--r--testdata/modulecache-tests/README.txt81
-rw-r--r--testdata/modulecache-tests/circularfirst.scad1
-rw-r--r--testdata/modulecache-tests/circularincludefirst.scad1
-rw-r--r--testdata/modulecache-tests/circularincludemain.scad1
-rw-r--r--testdata/modulecache-tests/circularincludesecond.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
24 files changed, 140 insertions, 0 deletions
diff --git a/testdata/modulecache-tests/README.txt b/testdata/modulecache-tests/README.txt
new file mode 100644
index 0000000..277cff8
--- /dev/null
+++ b/testdata/modulecache-tests/README.txt
@@ -0,0 +1,81 @@
+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: Basic cache
+------
+
+o Open use.scad
+o Compile twice (F5) - check that module reference is the same
+
+Test2: Dependency tracking of USE
+------
+
+o Open use.scad
+o Compile (F5)
+o touch used.scad
+o Compile (F5) - check that the module reference changed
+
+Test3: MCAD
+------
+
+o Open use-mcad.scad
+o Compile (F5)
+o Check that you get a rounded box
+
+Test4: USE Non-existing file
+------
+
+o Open usenonexsistingfile.scad
+o Compile (F5)
+o Verify that you get: WARNING: Can't open 'use' file 'nofile.scad'.
+
+Test5: Overload USEd module
+------
+
+o Open moduleoverload.scad
+o Compile (F5)
+o Verify that you get a sphere rather than a cylinder
+
+Test6: Recursive USE
+------
+
+o Open recursivemain.scad
+o Compile (F5)
+o Verify that OpenSCAD won't hang or crash
+
+Test7: Circular USE
+------
+
+o Open circularmain.scad
+o Compile (F5)
+o Verify that OpenSCAD won't hang or crash
+
+Test8: Dependency tracking of common file USEd by multiple modules
+------
+
+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: Dependency tracking of file included from module
+------
+
+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
+
+Test9: Circular include
+------
+
+o Open circularincludemain.scad
+o Compile (F5)
+o Verify that OpenSCAD won't hang or crash
+
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/circularincludefirst.scad b/testdata/modulecache-tests/circularincludefirst.scad
new file mode 100644
index 0000000..f94606a
--- /dev/null
+++ b/testdata/modulecache-tests/circularincludefirst.scad
@@ -0,0 +1 @@
+include <circularincludesecond.scad>
diff --git a/testdata/modulecache-tests/circularincludemain.scad b/testdata/modulecache-tests/circularincludemain.scad
new file mode 100644
index 0000000..b973956
--- /dev/null
+++ b/testdata/modulecache-tests/circularincludemain.scad
@@ -0,0 +1 @@
+include <circularincludefirst.scad>
diff --git a/testdata/modulecache-tests/circularincludesecond.scad b/testdata/modulecache-tests/circularincludesecond.scad
new file mode 100644
index 0000000..b973956
--- /dev/null
+++ b/testdata/modulecache-tests/circularincludesecond.scad
@@ -0,0 +1 @@
+include <circularincludefirst.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