gnu: lvm2: Make sure compiled objects are stripped.
[jackhill/guix/guix.git] / tests / guix-build.sh
index 5821e50..e1ec560 100644 (file)
@@ -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)' |       \
@@ -43,6 +43,7 @@ trap "rm -rf $module_dir" EXIT
 
 cat > "$module_dir/foo.scm"<<EOF
 (define-module (foo)
+  #:use-module (guix tests)
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix build-system trivial))
@@ -88,6 +89,13 @@ cat > "$module_dir/foo.scm"<<EOF
     (synopsis "Dummy package")
     (description "bar is a dummy package for testing.")
     (license #f)))
+
+(define-public baz
+  (dummy-package "baz" (replacement foo)))
+
+(define-public superseded
+  (deprecated-package "superseded" bar))
+
 EOF
 
 GUIX_PACKAGE_PATH="$module_dir"
@@ -97,6 +105,10 @@ export GUIX_PACKAGE_PATH
 guix build -d -S foo
 guix build -d -S foo | grep -e 'foo\.tar\.gz'
 
+# 'baz' has a replacement so we should be getting the replacement's source.
+(unset GUIX_BUILD_OPTIONS;
+ test "`guix build -d -S baz`" = "`guix build -d -S foo`")
+
 guix build -d --sources=package foo
 guix build -d --sources=package foo | grep -e 'foo\.tar\.gz'
 
@@ -159,9 +171,13 @@ 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.7         # PASS, deprecated version syntax
 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