gtk and wayland update
[jackhill/guix/guix.git] / tests / guix-environment.sh
index f8be48f..95fe95b 100644 (file)
@@ -1,5 +1,5 @@
 # GNU Guix --- Functional package management for GNU
-# Copyright © 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
+# Copyright © 2015, 2016, 2017, 2018, 2019, 2021 Ludovic Courtès <ludo@gnu.org>
 #
 # This file is part of GNU Guix.
 #
@@ -119,8 +119,21 @@ test `readlink "$gcroot"` = "$expected"
 guix environment --bootstrap -r "$gcroot" --ad-hoc guile-bootstrap \
      -- guile -c 1
 test `readlink "$gcroot"` = "$expected"
+
+# Make sure '-p' works as expected.
+test $(guix environment -p "$gcroot" -- "$SHELL" -c 'echo $GUIX_ENVIRONMENT') = "$expected"
+paths1="$(guix environment -p "$gcroot" --search-paths)"
+paths2="$(guix environment --bootstrap --ad-hoc guile-bootstrap --search-paths)"
+test "$paths1" = "$paths2"
+
 rm "$gcroot"
 
+# Try '-r' with a relative file name.
+(cd "$tmpdir"; mkdir "gc-root";
+ guix environment --bootstrap -r "gc-root/r" --ad-hoc guile-bootstrap \
+      -- guile -c 1;
+ rm "gc-root/r"; rmdir "gc-root")
+
 # Same with an absolute file name.
 guix environment --bootstrap -r "$PWD/$gcroot" --ad-hoc guile-bootstrap \
      -- guile -c 1
@@ -186,7 +199,7 @@ then
 
     # Make sure the bootstrap binaries are all listed where they belong.
     grep -E "^export PATH=\"$profile/bin\""         "$tmpdir/a"
-    grep -E "^export CPATH=\"$profile/include\""    "$tmpdir/a"
+    grep -E "^export C_INCLUDE_PATH=\"$profile/include\"" "$tmpdir/a"
     grep -E "^export LIBRARY_PATH=\"$profile/lib\"" "$tmpdir/a"
     for dep in bootstrap-binaries-0 gcc-bootstrap-0 glibc-bootstrap-0
     do
@@ -200,8 +213,8 @@ then
     # as returned by '--search-paths'.
     guix environment --bootstrap --no-substitutes --pure \
          -e '(@ (guix tests) gnu-make-for-tests)' \
-         -- /bin/sh -c 'echo $PATH $CPATH $LIBRARY_PATH' > "$tmpdir/b"
-    ( . "$tmpdir/a" ; echo $PATH $CPATH $LIBRARY_PATH ) > "$tmpdir/c"
+         -- /bin/sh -c 'echo $PATH $C_INCLUDE_PATH $LIBRARY_PATH' > "$tmpdir/b"
+    ( . "$tmpdir/a" ; echo $PATH $C_INCLUDE_PATH $LIBRARY_PATH ) > "$tmpdir/c"
     cmp "$tmpdir/b" "$tmpdir/c"
 
     rm "$tmpdir"/*
@@ -222,7 +235,7 @@ then
 
     # Make sure the bootstrap binaries are all listed where they belong.
     grep -E "^export PATH=\"$profile/bin\""         "$tmpdir/a"
-    grep -E "^export CPATH=\"$profile/include\""    "$tmpdir/a"
+    grep -E "^export C_INCLUDE_PATH=\"$profile/include\"" "$tmpdir/a"
     grep -E "^export LIBRARY_PATH=\"$profile/lib\"" "$tmpdir/a"
     for dep in bootstrap-binaries-0 gcc-bootstrap-0 glibc-bootstrap-0 \
                                    guile-bootstrap