From d411e681e571ac054352b9665487f10037d9325d Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Tue, 9 Feb 2010 18:58:56 -0500 Subject: Support #include. --- tests/dimension/directives.inc | 21 +++++++++++++++++++++ tests/dimension/directives.pov | 7 ++++++- tests/dimension/directives.sh | 5 ++++- 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 tests/dimension/directives.inc (limited to 'tests/dimension') diff --git a/tests/dimension/directives.inc b/tests/dimension/directives.inc new file mode 100644 index 0000000..515b2f5 --- /dev/null +++ b/tests/dimension/directives.inc @@ -0,0 +1,21 @@ +/************************************************************************* + * Copyright (C) 2010 Tavian Barnes * + * * + * This file is part of The Dimension Test Suite. * + * * + * The Dimension Test Suite is free software; you can redistribute it * + * and/or modify it under the terms of the GNU General Public License as * + * published by the Free Software Foundation; either version 3 of the * + * License, or (at your option) any later version. * + * * + * The Dimension Test Suite is distributed in the hope that it will be * + * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see . * + *************************************************************************/ + +#declare Center = 0; +#local Local = -1; diff --git a/tests/dimension/directives.pov b/tests/dimension/directives.pov index b621709..75c8a81 100644 --- a/tests/dimension/directives.pov +++ b/tests/dimension/directives.pov @@ -21,13 +21,18 @@ #version 3.6; -#declare Center = 0; +#include "directives.inc" + #declare R = 1; #local Color = rgb <1, 0, 1>; #declare Unused = -1; #undef Unused +#ifdef (Local) + Illegal +#end + #ifdef (Unused) Illegal #end diff --git a/tests/dimension/directives.sh b/tests/dimension/directives.sh index 8d0bbb9..3893acc 100755 --- a/tests/dimension/directives.sh +++ b/tests/dimension/directives.sh @@ -22,11 +22,14 @@ directives=$(${top_builddir}/dimension/dimension --tokenize --parse ${srcdir}/directives.pov) directives_exp="$(echo -n \ '(#version (float "3.6") ; - #declare (identifier "Center") = (integer "0") ; + #include (string "directives.inc") #declare (identifier "R") = (integer "1") ; #local (identifier "Color") = rgb < (integer "1") , (integer "0") , (integer "1") > ; #declare (identifier "Unused") = - (integer "1") ; #undef (identifier "Unused") + #ifdef \( (identifier "Local") \) + (identifier "Illegal") + #end #ifdef \( (identifier "Unused") \) (identifier "Illegal") #end -- cgit v1.2.3