X-Git-Url: https://git.hcoop.net/jackhill/guix/guix.git/blobdiff_plain/1b846da8c372bee78851439fd9e72b2499115e5a..cb5fe915d215af6accfc413bea109902f5618e47:/tests/guix-build.sh diff --git a/tests/guix-build.sh b/tests/guix-build.sh index 5821e509af..7842ce87c6 100644 --- a/tests/guix-build.sh +++ b/tests/guix-build.sh @@ -1,5 +1,5 @@ # GNU Guix --- Functional package management for GNU -# Copyright © 2012, 2013, 2014, 2016 Ludovic Courtès +# Copyright © 2012, 2013, 2014, 2016, 2017, 2018 Ludovic Courtès # # This file is part of GNU Guix. # @@ -26,9 +26,9 @@ guix build --version if guix build -e +; then false; else true; fi -# Should fail because this is a source-less package. -if guix build -e '(@ (gnu packages bootstrap) %bootstrap-glibc)' -S -then false; else true; fi +# Source-less packages are accepted; they just return nothing. +guix build -e '(@ (gnu packages bootstrap) %bootstrap-glibc)' -S +test "`guix build -e '(@ (gnu packages bootstrap) %bootstrap-glibc)' -S`" = "" # Should pass. guix build -e '(@@ (gnu packages bootstrap) %bootstrap-guile)' | \ @@ -36,6 +36,14 @@ guix build -e '(@@ (gnu packages bootstrap) %bootstrap-guile)' | \ guix build hello -d | \ grep -e '-hello-[0-9\.]\+\.drv$' +# Passing a URI. +GUIX_DAEMON_SOCKET="file://$NIX_STATE_DIR/daemon-socket/socket" \ +guix build -e '(@@ (gnu packages bootstrap) %bootstrap-guile)' + +( if GUIX_DAEMON_SOCKET="weird://uri" \ + guix build -e '(@@ (gnu packages bootstrap) %bootstrap-guile)'; \ + then exit 1; fi ) + # Check --sources option with its arguments module_dir="t-guix-build-$$" mkdir "$module_dir" @@ -43,6 +51,7 @@ trap "rm -rf $module_dir" EXIT cat > "$module_dir/foo.scm"< "$module_dir/foo.scm"< "$module_dir/foo.scm"< "$module_dir/err" || true +grep "unbound" "$module_dir/err" # actual error +grep "forget.*(gnu packages base)" "$module_dir/err" # hint +rm -f "$module_dir"/* + # Should all return valid log files. drv="`guix build -d -e '(@@ (gnu packages bootstrap) %bootstrap-guile)'`" out="`guix build -e '(@@ (gnu packages bootstrap) %bootstrap-guile)'`" @@ -148,7 +187,7 @@ rm -f "$result" guix build coreutils --target=mips64el-linux-gnu --dry-run --no-substitutes # Replacements. -drv1=`guix build guix --with-input=guile=guile-next -d` +drv1=`guix build guix --with-input=guile@2.0=guile@2.2 -d` drv2=`guix build guix -d` test "$drv1" != "$drv2" @@ -159,9 +198,12 @@ test "$drv1" = "$drv2" if guix build guile --with-input=libunistring=something-really-silly then false; else true; fi +# Deprecated/superseded packages. +test "`guix build superseded -d`" = "`guix build bar -d`" + # Parsing package names and versions. guix build -n time # PASS -guix build -n time@1.7 # PASS, version found +guix build -n time@1.9 # PASS, version found if guix build -n time@3.2; # FAIL, version not found then false; else true; fi if guix build -n something-that-will-never-exist; # FAIL @@ -179,6 +221,10 @@ guix build -e "(begin guix build -e '#~(mkdir #$output)' -d guix build -e '#~(mkdir #$output)' -d | grep 'gexp\.drv' +# Same with a file-like object. +guix build -e '(computed-file "foo" #~(mkdir #$output))' -d +guix build -e '(computed-file "foo" #~(mkdir #$output))' -d | grep 'foo\.drv' + # Building from a package file. cat > "$module_dir/package.scm"<