Merge branch 'master' into no-testprograms

Conflicts:
	tests/CMakeLists.txt
	tests/regression/csgtermtest/assign-expected.term
	tests/regression/csgtermtest/child-expected.term
	tests/regression/csgtermtest/circle-expected.term
	tests/regression/csgtermtest/color-expected.term
	tests/regression/csgtermtest/cube-expected.term
	tests/regression/csgtermtest/cylinder-expected.term
	tests/regression/csgtermtest/difference-expected.term
	tests/regression/csgtermtest/dxf_linear_extrude-expected.term
	tests/regression/csgtermtest/dxf_rotate_extrude-expected.term
	tests/regression/csgtermtest/echo-expected.term
	tests/regression/csgtermtest/for-expected.term
	tests/regression/csgtermtest/glide-expected.term
	tests/regression/csgtermtest/group-expected.term
	tests/regression/csgtermtest/hull-expected.term
	tests/regression/csgtermtest/if-expected.term
	tests/regression/csgtermtest/import-expected.term
	tests/regression/csgtermtest/import_dxf-expected.term
	tests/regression/csgtermtest/import_off-expected.term
	tests/regression/csgtermtest/import_stl-expected.term
	tests/regression/csgtermtest/intersection-expected.term
	tests/regression/csgtermtest/intersection_for-expected.term
	tests/regression/csgtermtest/linear_extrude-expected.term
	tests/regression/csgtermtest/minkowski-expected.term
	tests/regression/csgtermtest/mirror-expected.term
	tests/regression/csgtermtest/multmatrix-expected.term
	tests/regression/csgtermtest/polygon-expected.term
	tests/regression/csgtermtest/polyhedron-expected.term
	tests/regression/csgtermtest/projection-expected.term
	tests/regression/csgtermtest/render-expected.term
	tests/regression/csgtermtest/rotate-expected.term
	tests/regression/csgtermtest/rotate_extrude-expected.term
	tests/regression/csgtermtest/scale-expected.term
	tests/regression/csgtermtest/sphere-expected.term
	tests/regression/csgtermtest/square-expected.term
	tests/regression/csgtermtest/subdiv-expected.term
	tests/regression/csgtermtest/surface-expected.term
	tests/regression/csgtermtest/translate-expected.term
	tests/regression/csgtermtest/union-expected.term
	tests/regression/dumptest/circle-expected.csg
	tests/regression/dumptest/color-expected.csg
	tests/regression/dumptest/cube-expected.csg
	tests/regression/dumptest/cylinder-expected.csg
	tests/regression/dumptest/difference-expected.csg
	tests/regression/dumptest/dxf_linear_extrude-expected.csg
	tests/regression/dumptest/dxf_rotate_extrude-expected.csg
	tests/regression/dumptest/glide-expected.csg
	tests/regression/dumptest/import-expected.csg
	tests/regression/dumptest/import_dxf-expected.csg
	tests/regression/dumptest/import_off-expected.csg
	tests/regression/dumptest/import_stl-expected.csg
	tests/regression/dumptest/intersection-expected.csg
	tests/regression/dumptest/intersection_for-expected.csg
	tests/regression/dumptest/linear_extrude-expected.csg
	tests/regression/dumptest/minkowski-expected.csg
	tests/regression/dumptest/mirror-expected.csg
	tests/regression/dumptest/multmatrix-expected.csg
	tests/regression/dumptest/polygon-expected.csg
	tests/regression/dumptest/polyhedron-expected.csg
	tests/regression/dumptest/projection-expected.csg
	tests/regression/dumptest/render-expected.csg
	tests/regression/dumptest/rotate-expected.csg
	tests/regression/dumptest/rotate_extrude-expected.csg
	tests/regression/dumptest/scale-expected.csg
	tests/regression/dumptest/sphere-expected.csg
	tests/regression/dumptest/square-expected.csg
	tests/regression/dumptest/subdiv-expected.csg
	tests/regression/dumptest/surface-expected.csg
	tests/regression/dumptest/translate-expected.csg
issue480
chrysn 2013-06-26 18:06:00 +02:00
commit ad1a11a28e
124 changed files with 53 additions and 169 deletions

View File

@ -1,15 +0,0 @@
export OPENSCAD_LIBRARIES=$PWD/../libraries/install
export DYLD_LIBRARY_PATH=$OPENSCAD_LIBRARIES/lib
export DYLD_FRAMEWORK_PATH=$OPENSCAD_LIBRARIES/lib
#export QMAKESPEC=macx-g++
#export OPENCSGDIR=$PWD/../OpenCSG-1.3.0
#export CGALDIR=$PWD/../install/CGAL-3.6
#export DYLD_LIBRARY_PATH=$OPENCSGDIR/lib
# Our own Qt
export PATH=$OPENSCAD_LIBRARIES/bin:$PATH
# ccache:
export PATH=/opt/local/libexec/ccache:$PATH
export CCACHE_BASEDIR=$PWD/..

View File

@ -105,8 +105,7 @@ Value Expression::evaluate(const Context *context) const
if (this->type == ">")
return this->children[0]->evaluate(context) > this->children[1]->evaluate(context);
if (this->type == "?:") {
Value v = this->children[0]->evaluate(context);
return this->children[v.toBool() ? 1 : 2]->evaluate(context);
return this->children[this->children[0]->evaluate(context) ? 1 : 2]->evaluate(context);
}
if (this->type == "[]") {
return this->children[0]->evaluate(context)[this->children[1]->evaluate(context)];

View File

@ -300,11 +300,6 @@ Value &Value::operator=(const Value &v)
return *this;
}
Value Value::operator!() const
{
return Value(!this->toBool());
}
class equals_visitor : public boost::static_visitor<bool>
{
public:
@ -327,16 +322,6 @@ bool Value::operator!=(const Value &v) const
return !(*this == v);
}
bool Value::operator&&(const Value &v) const
{
return this->toBool() && v.toBool();
}
bool Value::operator||(const Value &v) const
{
return this->toBool() || v.toBool();
}
class less_visitor : public boost::static_visitor<bool>
{
public:

View File

@ -80,12 +80,11 @@ public:
bool getVec3(double &x, double &y, double &z, double defaultval = 0.0) const;
RangeType toRange() const;
operator bool() const { return this->toBool(); }
Value &operator=(const Value &v);
Value operator!() const;
bool operator==(const Value &v) const;
bool operator!=(const Value &v) const;
bool operator&&(const Value &v) const;
bool operator||(const Value &v) const;
bool operator<(const Value &v) const;
bool operator<=(const Value &v) const;
bool operator>=(const Value &v) const;
@ -98,16 +97,6 @@ public:
Value operator/(const Value &v) const;
Value operator%(const Value &v) const;
/*
bool getnum(double &v) const;
bool getv2(double &x, double &y) const;
bool getv3(double &x, double &y, double &z, double defaultval = 0.0) const;
bool toBool() const;
void append(Value *val);
*/
friend std::ostream &operator<<(std::ostream &stream, const Value &value) {
if (value.type() == Value::STRING) stream << QuotedString(value.toString());
else stream << value.toString();

View File

@ -1 +0,0 @@
assign();

View File

@ -1 +0,0 @@
child();

View File

@ -1 +0,0 @@
circle();

View File

@ -1 +0,0 @@
color();

View File

@ -1 +0,0 @@
cube();

View File

@ -1 +0,0 @@
cylinder();

View File

@ -1 +0,0 @@
difference();

View File

@ -1 +0,0 @@
dxf_linear_extrude();

View File

@ -1 +0,0 @@
dxf_rotate_extrude();

View File

@ -1 +0,0 @@
echo();

View File

@ -1 +0,0 @@
for();

View File

@ -1 +0,0 @@
glide();

View File

@ -1 +0,0 @@
group();

View File

@ -1 +0,0 @@
hull();

View File

@ -1 +0,0 @@
if(true) { }

View File

@ -1 +0,0 @@
import();

View File

@ -1 +0,0 @@
import_dxf();

View File

@ -1 +0,0 @@
import_off();

View File

@ -1 +0,0 @@
import_stl();

View File

@ -1 +0,0 @@
intersection();

View File

@ -1 +0,0 @@
intersection_for();

View File

@ -1 +0,0 @@
linear_extrude();

View File

@ -1 +0,0 @@
minkowski();

View File

@ -1 +0,0 @@
mirror();

View File

@ -1 +0,0 @@
multmatrix();

View File

@ -1 +0,0 @@
polygon();

View File

@ -1 +0,0 @@
polyhedron();

View File

@ -1 +0,0 @@
projection();

View File

@ -1 +0,0 @@
render();

View File

@ -1 +0,0 @@
rotate();

View File

@ -1 +0,0 @@
rotate_extrude();

View File

@ -1 +0,0 @@
scale();

View File

@ -1 +0,0 @@
sphere();

View File

@ -1 +0,0 @@
square();

View File

@ -1 +0,0 @@
subdiv();

View File

@ -1 +0,0 @@
surface();

View File

@ -1 +0,0 @@
translate();

View File

@ -1 +0,0 @@
union();

View File

@ -0,0 +1,27 @@
function foo() = search(undef,undef);
if (false && foo()) {
echo("Fail");
} else {
echo("Pass");
}
if (true || foo()) {
echo("Pass");
} else {
echo("Fail");
}
if (true && true) {
echo("Pass");
}
if (false || true) {
echo("Pass");
}
function ternarytest() = true ? true : foo();
if (ternarytest()) {
echo("Pass");
}

View File

@ -713,7 +713,6 @@ configure_file(${CMAKE_SOURCE_DIR}/../testdata/scad/templates/import_dxf-tests-t
${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)
file(GLOB FEATURES_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/features/*.scad)
file(GLOB BUGS_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/bugs/*.scad)
file(GLOB SCAD_DXF_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/dxf/*.scad)
@ -721,7 +720,6 @@ file(GLOB FUNCTION_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/functions/*.scad)
file(GLOB EXAMPLE_FILES ${CMAKE_SOURCE_DIR}/../examples/*.scad)
list(APPEND ECHO_FILES ${FUNCTION_FILES}
${CMAKE_SOURCE_DIR}/../testdata/scad/minimal/echo.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
@ -735,14 +733,18 @@ list(APPEND ECHO_FILES ${FUNCTION_FILES}
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/value-reassignment-tests.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/value-reassignment-tests2.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/variable-scope-tests.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/lookup-tests.scad)
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/lookup-tests.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/expression-shortcircuit-tests.scad)
list(APPEND DUMPTEST_FILES ${MINIMAL_FILES} ${FEATURES_FILES} ${EXAMPLE_FILES})
list(APPEND DUMPTEST_FILES ${FEATURES_FILES} ${EXAMPLE_FILES})
list(APPEND DUMPTEST_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/escape-test.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/include-tests.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/use-tests.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/localfiles-test.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/localfiles_dir/localfiles-compatibility-test.scad)
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/localfiles_dir/localfiles-compatibility-test.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/allexpressions.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/allfunctions.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/allmodules.scad)
list(APPEND CGALPNGTEST_FILES ${FEATURES_FILES} ${SCAD_DXF_FILES} ${EXAMPLE_FILES})
list(APPEND CGALPNGTEST_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/include-tests.scad
@ -877,11 +879,17 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/CTestCustom.cmake ${TMP})
add_cmdline_test(echotest SUFFIX txt FILES ${ECHO_FILES})
add_cmdline_test(dumptest SUFFIX csg FILES ${DUMPTEST_FILES})
add_cmdline_test(moduledumptest EXE ${GUI_BINPATH} ARGS -o SUFFIX ast FILES
${CMAKE_SOURCE_DIR}/../testdata/scad/minimal/allmodules.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/minimal/allfunctions.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/minimal/allexpressions.scad)
add_cmdline_test(csgtexttest SUFFIX txt FILES ${MINIMAL_FILES})
add_cmdline_test(csgtermtest EXE ${GUI_BINPATH} ARGS -o SUFFIX term FILES ${MINIMAL_FILES})
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/allmodules.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/allfunctions.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/allexpressions.scad)
add_cmdline_test(csgtexttest SUFFIX txt FILES
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/allexpressions.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/allfunctions.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/allmodules.scad)
add_cmdline_test(csgtermtest EXE ${GUI_BINPATH} ARGS -o SUFFIX term FILES
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/allexpressions.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/allfunctions.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/allmodules.scad)
add_cmdline_test(cgalpngtest EXE ${GUI_BINPATH} ARGS --render -o SUFFIX png FILES ${CGALPNGTEST_FILES})
add_cmdline_test(opencsgtest EXE ${GUI_BINPATH} ARGS -o SUFFIX png FILES ${OPENCSGTEST_FILES})
add_cmdline_test(throwntogethertest SUFFIX png FILES ${THROWNTOGETHERTEST_FILES})

View File

@ -1 +0,0 @@
No top-level CSG object

View File

@ -1 +0,0 @@
No top-level CSG object

View File

@ -1 +0,0 @@
circle2

View File

@ -1 +0,0 @@
No top-level CSG object

View File

@ -1 +0,0 @@
cube2

View File

@ -1 +0,0 @@
cylinder2

View File

@ -1 +0,0 @@
No top-level CSG object

View File

@ -1 +0,0 @@
No top-level CSG object

View File

@ -1 +0,0 @@
No top-level CSG object

View File

@ -1 +0,0 @@
No top-level CSG object

View File

@ -1 +0,0 @@
No top-level CSG object

View File

@ -1 +0,0 @@
No top-level CSG object

View File

@ -1 +0,0 @@
No top-level CSG object

View File

@ -1 +0,0 @@
No top-level CSG object

View File

@ -1 +0,0 @@
No top-level CSG object

View File

@ -1 +0,0 @@
No top-level CSG object

View File

@ -1 +0,0 @@
import2

View File

@ -1 +0,0 @@
No top-level CSG object

View File

@ -1 +0,0 @@
No top-level CSG object

View File

@ -1 +0,0 @@
No top-level CSG object

View File

@ -1 +0,0 @@
No top-level CSG object

View File

@ -1 +0,0 @@
No top-level CSG object

View File

@ -1 +0,0 @@
No top-level CSG object

View File

@ -1 +0,0 @@
No top-level CSG object

View File

@ -1 +0,0 @@
No top-level CSG object

View File

@ -1 +0,0 @@
polygon2

View File

@ -1 +0,0 @@
polyhedron2

View File

@ -1 +0,0 @@
No top-level CSG object

View File

@ -1 +0,0 @@
No top-level CSG object

View File

@ -1 +0,0 @@
No top-level CSG object

View File

@ -1 +0,0 @@
No top-level CSG object

View File

@ -1 +0,0 @@
No top-level CSG object

View File

@ -1 +0,0 @@
sphere2

View File

@ -1 +0,0 @@
square2

View File

@ -1 +0,0 @@
No top-level CSG object

View File

@ -1 +0,0 @@
No top-level CSG object

View File

@ -1 +0,0 @@
No top-level CSG object

View File

@ -1 +0,0 @@
No top-level CSG object

View File

@ -1 +0,0 @@
group1(group2)

View File

@ -1 +0,0 @@
group1

View File

@ -1 +0,0 @@
group1(circle)

View File

@ -1 +0,0 @@
group1(color2)

View File

@ -1 +0,0 @@
group1(cube)

View File

@ -1 +0,0 @@
group1(cylinder)

View File

@ -1 +0,0 @@
group1(difference2)

View File

@ -1 +0,0 @@
group1(linear_extrude)

View File

@ -1 +0,0 @@
group1(rotate_extrude)

View File

@ -1 +0,0 @@
group1(group2)

View File

@ -1 +0,0 @@
group1(group2)

View File

@ -1 +0,0 @@
group1(glide2)

View File

@ -1 +0,0 @@
group1(group2)

View File

@ -1 +0,0 @@
group1(hull2)

View File

@ -1 +0,0 @@
group1(group2)

Some files were not shown because too many files have changed in this diff Show More