-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdpkg-runtests.8
90 lines (90 loc) · 2.33 KB
/
dpkg-runtests.8
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
.TH dpkg-runtests 8 "Release 1.0" "LLNL" "dpkg-runtests"
.SH NAME
dpkg-runtests \- run package unit tests
.SH SYNOPSIS
.B dpkg-runtests
.I "[package] ..."
.SH DESCRIPTION
.B dpkg-runtests
is part of dpkg-scripts, a collection of utilities for building
/usr/local-based deb packages.
.LP
.B dpkg-runtests
runs package unit tests for the specified packages.
If no packages are specified on the command line, all installed packages
are tested.
.LP
.B dpkg-runtests
accepts the following options
.TP
.I "-v"
Show test output if it fails.
.TP
.I "-V"
Show test output even when it succedes.
.LP
.B dpkg-runtests
exits with 1 if
.B dpkg-runtests
itself failed, 2 if there were any test failures, or 0 if there were
no failures, even if test results include ``notest'' or ``notrun''.
.SH TEST SCRIPTS
A test script will be included in a package if it exists under the
name ``package.test'' in the package source materials during a
.B dpkg-mkdeb(1)
build. When the package is installed, the test is installed as part of
the package's metadata.
.LP
Test scripts are run with their current working directory set to a clean
subdirectory of /tmp and their output redirected to the file ``test.log''
inside that directory.
The directory is removed on success, or retained for examination
otherwise.
.LP
The scripts' exit codes are used to determine the result: 0=success, 1=notrun,
2=failure. All scripts should complete relatively quickly and not
include interactive or GUI components.
.LP
The test is run via
.B dpkg-wrap
so the package's dotkit is used and the package's macro file will have been
sourced, therefore the test script should be able to run the package's
executables just as a user would, and may reference any of the following
macro file variables:
.LP
$dpkg_name
.br
$dpkg_version
.br
$dpkg_arch
.br
$dpkg_maintainer
.br
$dpkg_short_description
.br
$dpkg_section
.br
$dpkg_depends
.br
$dpkg_buildrequires
.br
$dpkg_flags
.br
$dpkg_prefix
.br
$dpkg_subpackages
.br
$dpkg_subpackage
.br
$dpkg_variants
.br
$dpkg_variant
.LP
It is possible to unuse the package dotkit inside the test script with
the command ``unuse $dpkg_name''. This may be useful in a compiler test,
for example, to check behavior of compiler executables run without the
compiler's dotkit environment.
.SH "FILES"
/usr/local/dpkg-db/info/package-name.test
.SH "SEE ALSO"
dpkg-mkdeb(8), dpkg-testdeb(8)