Merge branch 'experiments' of git://gitorious.org/openscad/openscad into giles

git-svn-id: http://svn.clifford.at/openscad/trunk@586 b57f626f-c46c-0410-a088-ec61d464b74c
stl_dim
kintel 2011-01-09 16:08:28 +00:00
commit e0eea53ad5
8 changed files with 68 additions and 0 deletions

View File

@ -202,6 +202,7 @@ void includefile()
yyin = fopen(finfo.absoluteFilePath().toLocal8Bit(), "r");
if (!yyin) {
PRINTA("WARNING: Can't open input file `%1'.", filename);
path_stack.pop();
return;
}
filename.clear();

4
testdata/scad/include test6.scad vendored Normal file
View File

@ -0,0 +1,4 @@
module test6()
{
echo("included from include test6.scad");
}

40
testdata/scad/include-test.scad vendored Normal file
View File

@ -0,0 +1,40 @@
//Test that the entire path is pushed onto the stack upto the last '/'
include <sub1/sub2/sub3/sub4/include-test2.scad>
//Test that a non existent path/file doesn't screw things up
include <non/existent/path/non-file>
//Test with empty path
include <include-test5.scad>
//Test without preceeding space
include<include-test5.scad>
//Test with other strange character that is allowed
include>>>>><include-test5.scad>
//Test that filenames with spaces work
include <include test6.scad>
//Test with empty file
include<test/>
//Test with empty path and file
include </>
//Test with empty
include <>
module test1()
{
test2();
test3();
test4();
test5();
test6();
//Just to give a top level object
sphere(1);
}
test1();

4
testdata/scad/include-test5.scad vendored Normal file
View File

@ -0,0 +1,4 @@
module test5()
{
echo("included from include-test5.scad");
}

1
testdata/scad/string-test.scad vendored Normal file
View File

@ -0,0 +1 @@
echo("The quick brown fox \tjumps \"over\" the lazy dog.\rThe quick brown fox.\nThe \\lazy\\ dog.");

View File

@ -0,0 +1,4 @@
module test4()
{
echo("included from include-test4.scad");
}

View File

@ -0,0 +1,10 @@
//Test nested include
include <include-test3.scad>
//Test relative file location
include <../include-test4.scad>
module test2 ()
{
echo("included from include-test2.scad");
}

View File

@ -0,0 +1,4 @@
module test3()
{
echo("included from include-test3.scad");
}