diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2004-10-27 13:12:58 +0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2004-10-27 13:12:58 +0000 |
commit | ed09821859e8e585c8479a3c3bf95e76d518d66f (patch) | |
tree | f7c4d452439733183c354494f7b6d69e5bf4e599 | |
parent | 3277c9432ab718c8b80c54b228f8d5fbf94fb033 (diff) | |
download | guix-ed09821859e8e585c8479a3c3bf95e76d518d66f.tar.gz |
* Use `atdiff' instead of `cmp' for checking test output.
* Don't use local file names in tests since they will produce different parse trees depending on the current directory.
-rw-r--r-- | configure.ac | 3 | ||||
-rw-r--r-- | tests/Makefile.am | 1 | ||||
-rw-r--r-- | tests/lang.sh | 4 | ||||
-rw-r--r-- | tests/lang/parse-okay-subversion.exp | 2 | ||||
-rw-r--r-- | tests/lang/parse-okay-subversion.nix | 4 |
5 files changed, 9 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac index 2ba8e92384..872c0b6f95 100644 --- a/configure.ac +++ b/configure.ac @@ -128,12 +128,15 @@ AM_CONDITIONAL(HAVE_ATERM, test -n "$aterm") if test -z "$aterm"; then aterm_lib='-L${top_builddir}/externals/inst-aterm/lib -lATerm' aterm_include='-I${top_builddir}/externals/inst-aterm/include' + aterm_bin='${top_builddir}/externals/inst-aterm/bin' else aterm_lib="-L$aterm/lib -lATerm" aterm_include="-I$aterm/include" + aterm_bin="$aterm/bin" fi AC_SUBST(aterm_lib) AC_SUBST(aterm_include) +AC_SUBST(aterm_bin) AC_CHECK_LIB(pthread, pthread_mutex_init) diff --git a/tests/Makefile.am b/tests/Makefile.am index 038503aaad..50bac138c7 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -11,6 +11,7 @@ TESTS_ENVIRONMENT = TEST_ROOT=$(TEST_ROOT) \ NIX_BUILD_HOOK= \ TOP=$(shell pwd)/.. \ SHARED=$(extra1) \ + aterm_bin=$(aterm_bin) \ $(SHELL) -e simple.sh: simple.nix diff --git a/tests/lang.sh b/tests/lang.sh index 55aaa46f37..bbdb3fb8a9 100644 --- a/tests/lang.sh +++ b/tests/lang.sh @@ -16,7 +16,7 @@ for i in lang/parse-okay-*.nix; do echo "FAIL: $i should parse" fail=1 fi - if ! cmp lang/$i.ast lang/$i.exp; then + if ! $aterm_bin/atdiff lang/$i.ast lang/$i.exp; then echo "FAIL: parse tree of $i not as expected" fail=1 fi @@ -38,7 +38,7 @@ for i in lang/eval-okay-*.nix; do echo "FAIL: $i should evaluate" fail=1 fi - if ! cmp lang/$i.out lang/$i.exp; then + if ! $aterm_bin/atdiff lang/$i.out lang/$i.exp; then echo "FAIL: evaluation result of $i not as expected" fail=1 fi diff --git a/tests/lang/parse-okay-subversion.exp b/tests/lang/parse-okay-subversion.exp index caf2bf29f2..0524c38c19 100644 --- a/tests/lang/parse-okay-subversion.exp +++ b/tests/lang/parse-okay-subversion.exp @@ -1 +1 @@ -Function([DefFormal("localServer",Var("false")),DefFormal("httpServer",Var("false")),DefFormal("sslSupport",Var("false")),DefFormal("pythonBindings",Var("false")),DefFormal("javaSwigBindings",Var("false")),DefFormal("javahlBindings",Var("false")),NoDefFormal("stdenv"),NoDefFormal("fetchurl"),DefFormal("openssl",Var("null")),DefFormal("httpd",Var("null")),DefFormal("db4",Var("null")),NoDefFormal("expat"),DefFormal("swig",Var("null")),DefFormal("j2sdk",Var("null"))],Assert(OpNEq(Var("expat"),Var("null")),Assert(OpImpl(Var("localServer"),OpNEq(Var("db4"),Var("null"))),Assert(OpImpl(Var("httpServer"),OpAnd(OpNEq(Var("httpd"),Var("null")),OpEq(Select(Var("httpd"),"expat"),Var("expat")))),Assert(OpImpl(Var("sslSupport"),OpAnd(OpNEq(Var("openssl"),Var("null")),OpImpl(Var("httpServer"),OpEq(Select(Var("httpd"),"openssl"),Var("openssl"))))),Assert(OpImpl(Var("pythonBindings"),OpAnd(OpNEq(Var("swig"),Var("null")),Select(Var("swig"),"pythonSupport"))),Assert(OpImpl(Var("javaSwigBindings"),OpAnd(OpNEq(Var("swig"),Var("null")),Select(Var("swig"),"javaSupport"))),Assert(OpImpl(Var("javahlBindings"),OpNEq(Var("j2sdk"),Var("null"))),Call(Select(Var("stdenv"),"mkDerivation"),Attrs([Bind("name",Str("subversion-1.1.1"),Pos("(string)",20,7)),Bind("builder",Path("/home/eelco/nix/tests/builder.sh"),Pos("(string)",22,10)),Bind("src",Call(Var("fetchurl"),Attrs([Bind("url",Uri("http://subversion.tigris.org/tarballs/subversion-1.1.1.tar.bz2"),Pos("(string)",24,8)),Bind("md5",Str("a180c3fe91680389c210c99def54d9e0"),Pos("(string)",25,8))])),Pos("(string)",23,6)),Bind("patches",If(Var("javahlBindings"),List([Path("/home/eelco/nix/tests/javahl.patch")]),List([])),Pos("(string)",31,10)),Bind("openssl",If(Var("sslSupport"),Var("openssl"),Var("null")),Pos("(string)",33,10)),Bind("httpd",If(Var("httpServer"),Var("httpd"),Var("null")),Pos("(string)",34,8)),Bind("db4",If(Var("localServer"),Var("db4"),Var("null")),Pos("(string)",35,6)),Bind("swig",If(OpOr(Var("pythonBindings"),Var("javaSwigBindings")),Var("swig"),Var("null")),Pos("(string)",36,7)),Bind("python",If(Var("pythonBindings"),Select(Var("swig"),"python"),Var("null")),Pos("(string)",37,9)),Bind("j2sdk",If(Var("javaSwigBindings"),Select(Var("swig"),"j2sdk"),If(Var("javahlBindings"),Var("j2sdk"),Var("null"))),Pos("(string)",38,8)),Bind("expat",Var("expat"),Pos("(string)",41,10)),Bind("localServer",Var("localServer"),Pos("(string)",41,10)),Bind("httpServer",Var("httpServer"),Pos("(string)",41,10)),Bind("sslSupport",Var("sslSupport"),Pos("(string)",41,10)),Bind("pythonBindings",Var("pythonBindings"),Pos("(string)",41,10)),Bind("javaSwigBindings",Var("javaSwigBindings"),Pos("(string)",41,10)),Bind("javahlBindings",Var("javahlBindings"),Pos("(string)",41,10))])),Pos("(string)",17,7)),Pos("(string)",16,7)),Pos("(string)",15,7)),Pos("(string)",14,7)),Pos("(string)",13,7)),Pos("(string)",12,7)),Pos("(string)",11,7)),Pos("(string)",1,2)) +Function([DefFormal("localServer",Var("false")),DefFormal("httpServer",Var("false")),DefFormal("sslSupport",Var("false")),DefFormal("pythonBindings",Var("false")),DefFormal("javaSwigBindings",Var("false")),DefFormal("javahlBindings",Var("false")),NoDefFormal("stdenv"),NoDefFormal("fetchurl"),DefFormal("openssl",Var("null")),DefFormal("httpd",Var("null")),DefFormal("db4",Var("null")),NoDefFormal("expat"),DefFormal("swig",Var("null")),DefFormal("j2sdk",Var("null"))],Assert(OpNEq(Var("expat"),Var("null")),Assert(OpImpl(Var("localServer"),OpNEq(Var("db4"),Var("null"))),Assert(OpImpl(Var("httpServer"),OpAnd(OpNEq(Var("httpd"),Var("null")),OpEq(Select(Var("httpd"),"expat"),Var("expat")))),Assert(OpImpl(Var("sslSupport"),OpAnd(OpNEq(Var("openssl"),Var("null")),OpImpl(Var("httpServer"),OpEq(Select(Var("httpd"),"openssl"),Var("openssl"))))),Assert(OpImpl(Var("pythonBindings"),OpAnd(OpNEq(Var("swig"),Var("null")),Select(Var("swig"),"pythonSupport"))),Assert(OpImpl(Var("javaSwigBindings"),OpAnd(OpNEq(Var("swig"),Var("null")),Select(Var("swig"),"javaSupport"))),Assert(OpImpl(Var("javahlBindings"),OpNEq(Var("j2sdk"),Var("null"))),Call(Select(Var("stdenv"),"mkDerivation"),Attrs([Bind("name",Str("subversion-1.1.1"),Pos("(string)",20,7)),Bind("builder",Path("/foo/bar"),Pos("(string)",22,10)),Bind("src",Call(Var("fetchurl"),Attrs([Bind("url",Uri("http://subversion.tigris.org/tarballs/subversion-1.1.1.tar.bz2"),Pos("(string)",24,8)),Bind("md5",Str("a180c3fe91680389c210c99def54d9e0"),Pos("(string)",25,8))])),Pos("(string)",23,6)),Bind("patches",If(Var("javahlBindings"),List([Path("/javahl.patch")]),List([])),Pos("(string)",31,10)),Bind("openssl",If(Var("sslSupport"),Var("openssl"),Var("null")),Pos("(string)",33,10)),Bind("httpd",If(Var("httpServer"),Var("httpd"),Var("null")),Pos("(string)",34,8)),Bind("db4",If(Var("localServer"),Var("db4"),Var("null")),Pos("(string)",35,6)),Bind("swig",If(OpOr(Var("pythonBindings"),Var("javaSwigBindings")),Var("swig"),Var("null")),Pos("(string)",36,7)),Bind("python",If(Var("pythonBindings"),Select(Var("swig"),"python"),Var("null")),Pos("(string)",37,9)),Bind("j2sdk",If(Var("javaSwigBindings"),Select(Var("swig"),"j2sdk"),If(Var("javahlBindings"),Var("j2sdk"),Var("null"))),Pos("(string)",38,8)),Bind("expat",Var("expat"),Pos("(string)",41,10)),Bind("localServer",Var("localServer"),Pos("(string)",41,10)),Bind("httpServer",Var("httpServer"),Pos("(string)",41,10)),Bind("sslSupport",Var("sslSupport"),Pos("(string)",41,10)),Bind("pythonBindings",Var("pythonBindings"),Pos("(string)",41,10)),Bind("javaSwigBindings",Var("javaSwigBindings"),Pos("(string)",41,10)),Bind("javahlBindings",Var("javahlBindings"),Pos("(string)",41,10))])),Pos("(string)",17,7)),Pos("(string)",16,7)),Pos("(string)",15,7)),Pos("(string)",14,7)),Pos("(string)",13,7)),Pos("(string)",12,7)),Pos("(string)",11,7)),Pos("(string)",1,2)) diff --git a/tests/lang/parse-okay-subversion.nix b/tests/lang/parse-okay-subversion.nix index 5909da88f8..356272815d 100644 --- a/tests/lang/parse-okay-subversion.nix +++ b/tests/lang/parse-okay-subversion.nix @@ -19,7 +19,7 @@ assert javahlBindings -> j2sdk != null; stdenv.mkDerivation { name = "subversion-1.1.1"; - builder = ./builder.sh; + builder = /foo/bar; src = fetchurl { url = http://subversion.tigris.org/tarballs/subversion-1.1.1.tar.bz2; md5 = "a180c3fe91680389c210c99def54d9e0"; @@ -28,7 +28,7 @@ stdenv.mkDerivation { # This is a hopefully temporary fix for the problem that # libsvnjavahl.so isn't linked against libstdc++, which causes # loading the library into the JVM to fail. - patches = if javahlBindings then [./javahl.patch] else []; + patches = if javahlBindings then [/javahl.patch] else []; openssl = if sslSupport then openssl else null; httpd = if httpServer then httpd else null; |