mirror of https://github.com/vitalif/openscad
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.csgissue480
commit
ad1a11a28e
|
@ -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/..
|
|
@ -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)];
|
||||
|
|
15
src/value.cc
15
src/value.cc
|
@ -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:
|
||||
|
|
15
src/value.h
15
src/value.h
|
@ -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();
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
assign();
|
|
@ -1 +0,0 @@
|
|||
child();
|
|
@ -1 +0,0 @@
|
|||
circle();
|
|
@ -1 +0,0 @@
|
|||
color();
|
|
@ -1 +0,0 @@
|
|||
cube();
|
|
@ -1 +0,0 @@
|
|||
cylinder();
|
|
@ -1 +0,0 @@
|
|||
difference();
|
|
@ -1 +0,0 @@
|
|||
dxf_linear_extrude();
|
|
@ -1 +0,0 @@
|
|||
dxf_rotate_extrude();
|
|
@ -1 +0,0 @@
|
|||
echo();
|
|
@ -1 +0,0 @@
|
|||
for();
|
|
@ -1 +0,0 @@
|
|||
glide();
|
|
@ -1 +0,0 @@
|
|||
group();
|
|
@ -1 +0,0 @@
|
|||
hull();
|
|
@ -1 +0,0 @@
|
|||
if(true) { }
|
|
@ -1 +0,0 @@
|
|||
import();
|
|
@ -1 +0,0 @@
|
|||
import_dxf();
|
|
@ -1 +0,0 @@
|
|||
import_off();
|
|
@ -1 +0,0 @@
|
|||
import_stl();
|
|
@ -1 +0,0 @@
|
|||
intersection();
|
|
@ -1 +0,0 @@
|
|||
intersection_for();
|
|
@ -1 +0,0 @@
|
|||
linear_extrude();
|
|
@ -1 +0,0 @@
|
|||
minkowski();
|
|
@ -1 +0,0 @@
|
|||
mirror();
|
|
@ -1 +0,0 @@
|
|||
multmatrix();
|
|
@ -1 +0,0 @@
|
|||
polygon();
|
|
@ -1 +0,0 @@
|
|||
polyhedron();
|
|
@ -1 +0,0 @@
|
|||
projection();
|
|
@ -1 +0,0 @@
|
|||
render();
|
|
@ -1 +0,0 @@
|
|||
rotate();
|
|
@ -1 +0,0 @@
|
|||
rotate_extrude();
|
|
@ -1 +0,0 @@
|
|||
scale();
|
|
@ -1 +0,0 @@
|
|||
sphere();
|
|
@ -1 +0,0 @@
|
|||
square();
|
|
@ -1 +0,0 @@
|
|||
subdiv();
|
|
@ -1 +0,0 @@
|
|||
surface();
|
|
@ -1 +0,0 @@
|
|||
translate();
|
|
@ -1 +0,0 @@
|
|||
union();
|
|
@ -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");
|
||||
}
|
|
@ -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})
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
No top-level CSG object
|
|
@ -1 +0,0 @@
|
|||
No top-level CSG object
|
|
@ -1 +0,0 @@
|
|||
circle2
|
|
@ -1 +0,0 @@
|
|||
No top-level CSG object
|
|
@ -1 +0,0 @@
|
|||
cube2
|
|
@ -1 +0,0 @@
|
|||
cylinder2
|
|
@ -1 +0,0 @@
|
|||
No top-level CSG object
|
|
@ -1 +0,0 @@
|
|||
No top-level CSG object
|
|
@ -1 +0,0 @@
|
|||
No top-level CSG object
|
|
@ -1 +0,0 @@
|
|||
No top-level CSG object
|
|
@ -1 +0,0 @@
|
|||
No top-level CSG object
|
|
@ -1 +0,0 @@
|
|||
No top-level CSG object
|
|
@ -1 +0,0 @@
|
|||
No top-level CSG object
|
|
@ -1 +0,0 @@
|
|||
No top-level CSG object
|
|
@ -1 +0,0 @@
|
|||
No top-level CSG object
|
|
@ -1 +0,0 @@
|
|||
No top-level CSG object
|
|
@ -1 +0,0 @@
|
|||
import2
|
|
@ -1 +0,0 @@
|
|||
No top-level CSG object
|
|
@ -1 +0,0 @@
|
|||
No top-level CSG object
|
|
@ -1 +0,0 @@
|
|||
No top-level CSG object
|
|
@ -1 +0,0 @@
|
|||
No top-level CSG object
|
|
@ -1 +0,0 @@
|
|||
No top-level CSG object
|
|
@ -1 +0,0 @@
|
|||
No top-level CSG object
|
|
@ -1 +0,0 @@
|
|||
No top-level CSG object
|
|
@ -1 +0,0 @@
|
|||
No top-level CSG object
|
|
@ -1 +0,0 @@
|
|||
polygon2
|
|
@ -1 +0,0 @@
|
|||
polyhedron2
|
|
@ -1 +0,0 @@
|
|||
No top-level CSG object
|
|
@ -1 +0,0 @@
|
|||
No top-level CSG object
|
|
@ -1 +0,0 @@
|
|||
No top-level CSG object
|
|
@ -1 +0,0 @@
|
|||
No top-level CSG object
|
|
@ -1 +0,0 @@
|
|||
No top-level CSG object
|
|
@ -1 +0,0 @@
|
|||
sphere2
|
|
@ -1 +0,0 @@
|
|||
square2
|
|
@ -1 +0,0 @@
|
|||
No top-level CSG object
|
|
@ -1 +0,0 @@
|
|||
No top-level CSG object
|
|
@ -1 +0,0 @@
|
|||
No top-level CSG object
|
|
@ -1 +0,0 @@
|
|||
No top-level CSG object
|
|
@ -1 +0,0 @@
|
|||
group1(group2)
|
|
@ -1 +0,0 @@
|
|||
group1
|
|
@ -1 +0,0 @@
|
|||
group1(circle)
|
|
@ -1 +0,0 @@
|
|||
group1(color2)
|
|
@ -1 +0,0 @@
|
|||
group1(cube)
|
|
@ -1 +0,0 @@
|
|||
group1(cylinder)
|
|
@ -1 +0,0 @@
|
|||
group1(difference2)
|
|
@ -1 +0,0 @@
|
|||
group1(linear_extrude)
|
|
@ -1 +0,0 @@
|
|||
group1(rotate_extrude)
|
|
@ -1 +0,0 @@
|
|||
group1(group2)
|
|
@ -1 +0,0 @@
|
|||
group1(group2)
|
|
@ -1 +0,0 @@
|
|||
group1(glide2)
|
|
@ -1 +0,0 @@
|
|||
group1(group2)
|
|
@ -1 +0,0 @@
|
|||
group1(hull2)
|
|
@ -1 +0,0 @@
|
|||
group1(group2)
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue