summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDon Bright <hugh.m.bright@gmail.com>2011-11-13 16:40:20 (GMT)
committerDon Bright <hugh.m.bright@gmail.com>2011-11-13 16:40:20 (GMT)
commit1f9ce62573b65715e7b134ad4d8c8079fc28aa44 (patch)
tree40ac192b4d368cccc12e7b4e36c3dc7da5fba72f
parent3eb466b5a9dcb7507045898efc7ad52226f54782 (diff)
parent2cfcdf557d7742422965035a64ef617ac043a429 (diff)
Merge branch 'master' into cakebaby
-rw-r--r--RELEASE_NOTES1
-rw-r--r--doc/TODO.txt69
-rw-r--r--doc/testing.txt3
m---------libraries/MCAD0
-rw-r--r--src/ProgressWidget.cc5
-rw-r--r--src/ProgressWidget.h1
-rw-r--r--src/func.cc14
-rw-r--r--src/mainwin.cc3
-rw-r--r--src/value.cc5
-rw-r--r--testdata/dxf/null-polygons.dxf (renamed from testdata/scad/features/null-polygons.dxf)0
-rw-r--r--testdata/scad/dxf/null-polygons.scad2
-rw-r--r--testdata/scad/features/null-polygons.scad2
-rw-r--r--testdata/scad/functions/len-tests.scad12
-rw-r--r--testdata/scad/minimal/allfunctions.scad1
-rw-r--r--testdata/scad/misc/dim-all.dxf (renamed from testdata/scad/features/dim-all.dxf)0
-rw-r--r--testdata/scad/misc/dim-all.scad (renamed from testdata/scad/features/dim-all.scad)0
-rw-r--r--testdata/scad/misc/dxf-export.scad (renamed from testdata/scad/features/dxf-export.scad)0
-rw-r--r--testdata/scad/misc/echo-tests.scad (renamed from testdata/scad/features/echo-tests.scad)2
-rw-r--r--testdata/scad/misc/string-test.scad (renamed from testdata/scad/features/string-test.scad)0
-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
-rw-r--r--version.pri5
43 files changed, 143 insertions, 137 deletions
diff --git a/RELEASE_NOTES b/RELEASE_NOTES
index d67766c..65162fb 100644
--- a/RELEASE_NOTES
+++ b/RELEASE_NOTES
@@ -15,6 +15,7 @@ o The version_num() function will return the OpenSCAD version as a number, e.g.
o Added PI constant.
o Now uses standard shortcuts for save and reload on Linux and Windows. F2/F3 will still work but is deprecated.
o Number literals in scientific notation are now accepted by the parser
+o Added len() function. Takes one vector or string parameter and returns its length.
Bugfixes:
o square() crashed if any of the dimensions were zero
diff --git a/doc/TODO.txt b/doc/TODO.txt
index 7df6a4d..b491a3d 100644
--- a/doc/TODO.txt
+++ b/doc/TODO.txt
@@ -37,10 +37,6 @@ Using STL-imported models is tricky and triggers multiple issues:
import_stl("adns2610_dev_circuit_inv.stl");
}
-CRASH BUGS
-----------
-o Broken polyhedron() entities are not correctly detected and cause CGAL segfaults
-
USER INTERFACE
--------------
o Preferences
@@ -72,13 +68,8 @@ o 3D View
- View All
- Allow specifying viewpoint in the scad file
- overlay indicator displaying current view mode
- - OpenCSG rendering: Coincident surfaces causes z-buffer fighting. Is this somehow
- avoidable tuning the depth tests in OpenCSG?
- - Make the 10.000 element OpenCSG limit configurable (Preferences) ?
- Use OpenGL picking to facilitate ray-tracing like features like measuring
thicknesses, distances, slot thicknesses etc.
- - When specifying a transparency with the color() statement,
- the object is not sorted and will be rendered wrongly
- Add option to change lights, e.g. add an optional camera light
o Editor wishlist
- More infrastructure for external editor (allow communication from the outside)
@@ -122,6 +113,16 @@ o Misc
o Cmd-line
- Add verbose option (PRINT command from mainwin.cc and progress output)
+OpenCSG-related
+---------------
+o OpenCSG rendering: Coincident surfaces causes z-buffer fighting. Is this somehow
+ avoidable tuning the depth tests in OpenCSG?
+o Make the 10.000 element OpenCSG limit configurable (Preferences) ?
+o When specifying a transparency with the color() statement,
+ the object is not sorted and will be rendered wrongly
+o Bug: Using the background operator (%) on the only object in a scene triggers a
+ CSG error: No top level object found
+
ENGINE
------
o Primitives
@@ -149,7 +150,6 @@ o Language Frontend
- Rethink for vs. intersection_for vs. group. Should for loops
generate child lists instead, and make these passable to other
modules or accessible by child()?
- - constants: PI, OpenSCAD version
o DXF Import/Export
- Use dxflib from RibbonSoft for import/export? -> investigate
- Import
@@ -167,8 +167,6 @@ o Misc
- Add 'lines' object type for non-solid 2d drawings
- Is there a reason why modules like echo, empty if, empty for loop returns an
empty AbstractNode instead of being ignored?
- - Bug: Using the background operator (%) on the only object in a scene triggers a
- CSG error: No top level object found
- Dependency tracking of libraries (USE'd modules) isn't implemented. See Mail from nophead 20110823.
o Grammar
- dim->name -> dim->label
@@ -214,6 +212,16 @@ BUILD SYSTEM
o Fedora is reported to ship with byacc, which doesn't support bison extensions (e.g. %debuig). Look into this, either be yacc-compatible or force the build system to use bison.
o We currently link in -lboost_thread. Should we always use -lboost_thread-mt under Linux or can we pick this up using qmake?
+INFRASTRUCTURE
+--------------
+o Use a logging framework to get debugging/info output more under control?
+ (check log4j, google project)
+
+DOCUMENTATION
+-------------
+o Write checklists for typical extension work (add new module, add new function)
+ -> make sure new test files are added
+
TESTING
-------
o Caching and MDI looks suspicious when the code relies on external resources
@@ -221,16 +229,31 @@ o Caching and MDI looks suspicious when the code relies on external resources
-> we might get a false cache hit
o Collect "all" available OpenSCAD scripts from the internets and run the integration
tests on them all
-o dumptest tests:
- - filename are dumped as absolute filenames - this will fail on other systems
-o Write a regression test for the hexagonal cylinder orientation issue
-INFRASTRUCTURE
+MISSING TESTS:
--------------
-o Use a logging framework to get debugging/info output more under control?
- (check log4j, google project)
-
-MISC
-----
-o Write checklists for typical extension work (add new module, add new function)
- -> make sure new test files are added
+o all functions
+o mirror
+o scale
+o 3D hull
+o open polyline from dxf using new method
+o linear_extrude DXF
+o rotate_extrude DXF
+o import_stl
+o import_off
+o import_*
+ - open polylines
+o include: test subdirs under librarydir (e.g. include <MCAD/gears.scad> doesn't work
+o use: Basically same tests as include. + use restrictions
+o include and use: remember filenames with space
+o variants of module transparent() { %child(); }
+o define modules
+o define functions
+o built-in variables and constants (builtin-tests.scad)
+o Write a regression test for the hexagonal cylinder orientation issue
+o other tests
+ - export
+ - cmd-line tests
+ - leaf nodes having children, e.g. cube() cylinder();
+ - caching
+ - dependency tracking
diff --git a/doc/testing.txt b/doc/testing.txt
index 089d18e..b2974fc 100644
--- a/doc/testing.txt
+++ b/doc/testing.txt
@@ -45,9 +45,6 @@ Adding a new regression test:
7) run the test normally and verify that it passes:
$ ctest -R mytest
-Note that test files which don't have an *-expected.<suffix> file will
-be ignored for the test apps in question.
-
Troubleshooting a failed test:
------------------------------
diff --git a/libraries/MCAD b/libraries/MCAD
-Subproject 60490ebd2c722d70e06a5c12fb55d85b6f1aa1c
+Subproject 4330afe5e726b910e0b60039c86afa809f94923
diff --git a/src/ProgressWidget.cc b/src/ProgressWidget.cc
index a386192..112e239 100644
--- a/src/ProgressWidget.cc
+++ b/src/ProgressWidget.cc
@@ -29,3 +29,8 @@ void ProgressWidget::setValue(int progress)
{
this->progressBar->setValue(progress);
}
+
+int ProgressWidget::value() const
+{
+ return this->progressBar->value();
+}
diff --git a/src/ProgressWidget.h b/src/ProgressWidget.h
index 715272b..83e4d40 100644
--- a/src/ProgressWidget.h
+++ b/src/ProgressWidget.h
@@ -15,6 +15,7 @@ public:
public slots:
void setRange(int minimum, int maximum);
void setValue(int progress);
+ int value() const;
void cancel();
signals:
diff --git a/src/func.cc b/src/func.cc
index a9d5948..1138173 100644
--- a/src/func.cc
+++ b/src/func.cc
@@ -290,6 +290,17 @@ Value builtin_exp(const Context *, const std::vector<std::string>&, const std::v
return Value();
}
+Value builtin_length(const Context *, const std::vector<std::string>&, const std::vector<Value> &args)
+{
+ if (args.size() == 1){
+ if (args[0].type == Value::VECTOR)
+ return Value((double) args[0].vec.size());
+ if (args[0].type == Value::STRING)
+ return Value((double) args[0].text.size());
+ }
+ return Value();
+}
+
Value builtin_log(const Context *, const std::vector<std::string>&, const std::vector<Value> &args)
{
if (args.size() == 2 && args[0].type == Value::NUMBER && args[1].type == Value::NUMBER)
@@ -311,7 +322,7 @@ Value builtin_str(const Context *, const std::vector<std::string>&, const std::v
std::stringstream stream;
for (size_t i = 0; i < args.size(); i++) {
- stream << args[i];
+ stream << args[i].toString();
}
return Value(stream.str());
}
@@ -391,6 +402,7 @@ void register_builtin_functions()
Builtins::init("pow", new BuiltinFunction(&builtin_pow));
Builtins::init("sqrt", new BuiltinFunction(&builtin_sqrt));
Builtins::init("exp", new BuiltinFunction(&builtin_exp));
+ Builtins::init("len", new BuiltinFunction(&builtin_length));
Builtins::init("log", new BuiltinFunction(&builtin_log));
Builtins::init("ln", new BuiltinFunction(&builtin_ln));
Builtins::init("str", new BuiltinFunction(&builtin_str));
diff --git a/src/mainwin.cc b/src/mainwin.cc
index a6f5be6..22fb82c 100644
--- a/src/mainwin.cc
+++ b/src/mainwin.cc
@@ -433,7 +433,8 @@ static void report_func(const class AbstractNode*, void *vp, int mark)
#ifdef USE_PROGRESSWIDGET
ProgressWidget *pw = static_cast<ProgressWidget*>(vp);
int v = (int)((mark*100.0) / progress_report_count);
- pw->setValue(v < 100 ? v : 99);
+ int percent = v < 100 ? v : 99;
+ if (percent > pw->value()) pw->setValue(percent);
QApplication::processEvents();
if (pw->wasCanceled()) throw ProgressCancelException();
#else
diff --git a/src/value.cc b/src/value.cc
index e08b2d8..ab78c2a 100644
--- a/src/value.cc
+++ b/src/value.cc
@@ -343,7 +343,7 @@ std::string Value::toString() const
switch (this->type) {
case STRING:
- stream << '"' << this->text << '"';
+ stream << this->text;
break;
case VECTOR:
stream << '[';
@@ -411,7 +411,8 @@ void Value::append(Value *val)
std::ostream &operator<<(std::ostream &stream, const Value &value)
{
- stream << value.toString();
+ if (value.type == Value::STRING) stream << QuotedString(value.toString());
+ else stream << value.toString();
return stream;
}
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/functions/len-tests.scad b/testdata/scad/functions/len-tests.scad
new file mode 100644
index 0000000..fba7ae1
--- /dev/null
+++ b/testdata/scad/functions/len-tests.scad
@@ -0,0 +1,12 @@
+a=[1,2,3,4];
+b="abcd";
+c=[];
+d="";
+e=[[1,2,3,4],[1,2,3]];
+echo(len(a));
+echo(len(b));
+echo(len(c));
+echo(len(d));
+echo(len(e));
+echo(len(e[1]));
+echo(len(e[2])); \ No newline at end of file
diff --git a/testdata/scad/minimal/allfunctions.scad b/testdata/scad/minimal/allfunctions.scad
index ef21a90..2aebe54 100644
--- a/testdata/scad/minimal/allfunctions.scad
+++ b/testdata/scad/minimal/allfunctions.scad
@@ -24,3 +24,4 @@ a = dxf_dim();
a = dxf_cross();
a = version();
a = version_num();
+a = len();
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/echo-tests.scad b/testdata/scad/misc/echo-tests.scad
index b07d444..c42a67e 100644
--- a/testdata/scad/features/echo-tests.scad
+++ b/testdata/scad/misc/echo-tests.scad
@@ -10,3 +10,5 @@ echo(r);
echo(vec = [1,2,3]);
echo(range = [0:2]);
+
+echo(str("string generated by str()"));
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 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
diff --git a/version.pri b/version.pri
index 5cce3d5..195c51a 100644
--- a/version.pri
+++ b/version.pri
@@ -56,4 +56,9 @@ isEmpty(VERSION) {
VERSION_MONTH=$$member(VERSION_SPLIT, 1)
VERSION_DAY=$$member(VERSION_SPLIT, 2)
}
+ # Fix for problem with integers with leading zeros
+ # being interpreted by C++ as octals. Now they're doubles.
+ VERSION_YEAR=$${VERSION_YEAR}.0
+ VERSION_MONTH=$${VERSION_MONTH}.0
+ VERSION_DAY=$${VERSION_DAY}.0
}
contact: Jan Huwald // Impressum