From 09381cccffe675ccbc8d183f043788f99dc018cd Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 31 Mar 2010 12:38:31 +0000 Subject: Make source location info in the XML output optional. * src/libexpr/expr-to-xml.cc (nix::showAttrs): Add `location' parameter. Provide location XML attributes when it's true. Update callers. (nix::printTermAsXML): Likewise. * src/libexpr/expr-to-xml.hh (nix::printTermAsXML): Update prototype; have `location' default to `false'. * src/nix-instantiate/nix-instantiate.cc (printResult, processExpr): Add `location' parameter; update callers. (run): Add support for `--no-location'. * src/nix-instantiate/help.txt: Update accordingly. * tests/lang.sh: Invoke `nix-instantiate' with `--no-location' for the XML tests. * tests/lang/eval-okay-toxml.exp, tests/lang/eval-okay-to-xml.nix: New files. --- tests/lang.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests/lang.sh') diff --git a/tests/lang.sh b/tests/lang.sh index 18eb0278cf..54f0107637 100644 --- a/tests/lang.sh +++ b/tests/lang.sh @@ -54,7 +54,8 @@ for i in lang/eval-okay-*.nix; do fi if test -e lang/$i.exp.xml; then - if ! $nixinstantiate --eval-only --xml --strict lang/$i.nix > lang/$i.out.xml; then + if ! $nixinstantiate --eval-only --xml --no-location --strict \ + lang/$i.nix > lang/$i.out.xml; then echo "FAIL: $i should evaluate" fail=1 elif ! cmp -s lang/$i.out.xml lang/$i.exp.xml; then -- cgit 1.4.1