aboutsummaryrefslogtreecommitdiff
path: root/tests/pkg-verify.test
blob: 9d9c714ddf499eb8753e0ec1b1569b97e4b315c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# file      : tests/pkg-verify.test
# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
# license   : MIT; see accompanying LICENSE file

.include common.test

# Source repository:
#
# pkg-verify
# |-- foo-1.tar.gz
# |-- foo-2.tar.gz         (manifest with unknown name)
# `-- not-a-package.tar.gz

: valid-package
:
$* $src/foo-1.tar.gz 2>'valid package foo 1'

: no-package
:
$* 2>>EOE != 0
error: archive path argument expected
  info: run 'bpkg help pkg-verify' for more information
EOE

: not-a-package
:
{
  : verbose
  :
  $* $src/not-a-package.tar.gz 2>>/~%EOE% != 0
  %.+
  %error: .+/not-a-package.tar.gz does not appear to be a bpkg package%
  EOE

  : silent
  :
  $* --silent $src/not-a-package.tar.gz != 0
}

: unknown-name
:
: Test that package manifest that contains an unknown name is properly handled.
:
{
  : verbose
  :
  $* $src/foo-2.tar.gz 2>>/~%EOE% != 0
  foo-2/manifest:8:1: error: unknown name 'color' in package manifest
  %  info: package archive .+/foo-2.tar.gz%
  EOE

  : silent
  :
  $* --silent $src/foo-2.tar.gz != 0

  : ignore
  :
  $* --ignore-unknown $src/foo-2.tar.gz 2>'valid package foo 2'
}