about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-02-22T13·55+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-02-22T13·55+0000
commitddb78dfc3d209f96101da242f90e5031918af355 (patch)
tree7b090dcd53cadedb3df616b102d373918973b795
parent46f0cb08692713954a4d452da6d7c07e17eb0cac (diff)
* Check whether "nix-store -q --graph" generates a valid dot graph.
* Test "nix-store -q --tree" as well.

-rw-r--r--configure.ac1
-rw-r--r--tests/dependencies.sh18
2 files changed, 19 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 261e4f1107a6..eee73c07be01 100644
--- a/configure.ac
+++ b/configure.ac
@@ -85,6 +85,7 @@ AC_PATH_PROG(flex, flex, false)
 AC_PATH_PROG(bison, bison, false)
 NEED_PROG(perl, perl)
 NEED_PROG(tar, tar)
+AC_PATH_PROG(dot, dot)
                 
 NEED_PROG(cat, cat)
 AC_ARG_WITH(coreutils-bin, AC_HELP_STRING([--with-coreutils-bin=PATH],
diff --git a/tests/dependencies.sh b/tests/dependencies.sh
index 56e1b286b6aa..1e349cdb9bbf 100644
--- a/tests/dependencies.sh
+++ b/tests/dependencies.sh
@@ -2,8 +2,26 @@ drvPath=$($TOP/src/nix-instantiate/nix-instantiate dependencies.nix)
 
 echo "derivation is $drvPath"
 
+$TOP/src/nix-store/nix-store -q --tree "$drvPath" | grep "|   +---.*builder1.sh"
+
+# Test Graphviz graph generation.
+$TOP/src/nix-store/nix-store -q --graph "$drvPath" > $TEST_ROOT/graph
+if test -n "$dot"; then
+    # Does it parse?
+    $dot < $TEST_ROOT/graph
+fi    
+
 outPath=$($TOP/src/nix-store/nix-store -rvv "$drvPath")
 
+# Test Graphviz graph generation.
+$TOP/src/nix-store/nix-store -q --graph "$outPath" > $TEST_ROOT/graph
+if test -n "$dot"; then
+    # Does it parse?
+    $dot < $TEST_ROOT/graph
+fi    
+
+$TOP/src/nix-store/nix-store -q --tree "$outPath" | grep "+---.*dependencies-input-2"
+
 echo "output path is $outPath"
 
 text=$(cat "$outPath"/foobar)