store: Remove the `fixed?' parameter from `add-to-store'.
[jackhill/guix/guix.git] / tests / guix-build.sh
CommitLineData
233e7676 1# GNU Guix --- Functional package management for GNU
5401dd75 2# Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org>
97298ffa 3#
233e7676 4# This file is part of GNU Guix.
97298ffa 5#
233e7676 6# GNU Guix is free software; you can redistribute it and/or modify it
97298ffa
LC
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#
233e7676 11# GNU Guix is distributed in the hope that it will be useful, but
97298ffa
LC
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
233e7676 17# along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
97298ffa
LC
18
19#
20# Test the `guix-build' command-line utility.
21#
22
23guix-build --version
24
25# Should fail.
912209ee
LC
26if guix-build -e +;
27then false; else true; fi
28
29# Should fail because this is a source-less package.
1ffa7090 30if guix-build -e '(@ (gnu packages bootstrap) %bootstrap-glibc)' -S
912209ee 31then false; else true; fi
97298ffa
LC
32
33# Should pass.
1ffa7090 34guix-build -e '(@@ (gnu packages base) %bootstrap-guile)' | \
97298ffa
LC
35 grep -e '-guile-'
36guix-build hello -d | \
37 grep -e '-hello-[0-9\.]\+\.drv$'
38
39# Should fail because the name/version combination could not be found.
40if guix-build hello-0.0.1 -n; then false; else true; fi
41
42# Keep a symlink to the result, registered as a root.
43result="t-result-$$"
44guix-build -r "$result" \
1ffa7090 45 -e '(@@ (gnu packages base) %bootstrap-guile)'
97298ffa
LC
46test -x "$result/bin/guile"
47
48# Should fail, because $result already exists.
1ffa7090 49if guix-build -r "$result" -e '(@@ (gnu packages base) %bootstrap-guile)'
97298ffa
LC
50then false; else true; fi
51
52rm -f "$result"
5401dd75
LC
53
54# Parsing package names and versions.
55guix-build -n time # PASS
56guix-build -n time-1.7 # PASS, version found
57if guix-build -n time-3.2; # FAIL, version not found
58then false; else true; fi
59if guix-build -n something-that-will-never-exist; # FAIL
60then false; else true; fi