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/eval-okay-toxml.exp | 1 + tests/lang/eval-okay-toxml.nix | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 tests/lang/eval-okay-toxml.exp create mode 100644 tests/lang/eval-okay-toxml.nix (limited to 'tests/lang') diff --git a/tests/lang/eval-okay-toxml.exp b/tests/lang/eval-okay-toxml.exp new file mode 100644 index 0000000000..379f3c0761 --- /dev/null +++ b/tests/lang/eval-okay-toxml.exp @@ -0,0 +1 @@ +Str("\n\n \n \n \n \n \n\n",[]) diff --git a/tests/lang/eval-okay-toxml.nix b/tests/lang/eval-okay-toxml.nix new file mode 100644 index 0000000000..068c97a6c1 --- /dev/null +++ b/tests/lang/eval-okay-toxml.nix @@ -0,0 +1,3 @@ +# Make sure the expected XML output is produced; in particular, make sure it +# doesn't contain source location information. +builtins.toXML { a = "s"; } -- cgit 1.4.1