Mirror of GNU Guix
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.7 KiB

  1. # Guix --- Nix package management from Guile. -*- coding: utf-8 -*-
  2. # Copyright (C) 2012 Ludovic Courtès <ludo@gnu.org>
  3. #
  4. # This file is part of Guix.
  5. #
  6. # Guix is free software; you can redistribute it and/or modify it
  7. # under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 3 of the License, or (at
  9. # your option) any later version.
  10. #
  11. # Guix is distributed in the hope that it will be useful, but
  12. # WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with Guix. If not, see <http://www.gnu.org/licenses/>.
  18. #
  19. # Test the `guix-build' command-line utility.
  20. #
  21. guix-build --version
  22. # Should fail.
  23. if guix-build -e +;
  24. then false; else true; fi
  25. # Should fail because this is a source-less package.
  26. if guix-build -e '(@ (distro packages bootstrap) %bootstrap-glibc)' -S
  27. then false; else true; fi
  28. # Should pass.
  29. guix-build -e '(@@ (distro packages base) %bootstrap-guile)' | \
  30. grep -e '-guile-'
  31. guix-build hello -d | \
  32. grep -e '-hello-[0-9\.]\+\.drv$'
  33. # Should fail because the name/version combination could not be found.
  34. if guix-build hello-0.0.1 -n; then false; else true; fi
  35. # Keep a symlink to the result, registered as a root.
  36. result="t-result-$$"
  37. guix-build -r "$result" \
  38. -e '(@@ (distro packages base) %bootstrap-guile)'
  39. test -x "$result/bin/guile"
  40. # Should fail, because $result already exists.
  41. if guix-build -r "$result" -e '(@@ (distro packages base) %bootstrap-guile)'
  42. then false; else true; fi
  43. rm -f "$result"