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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
<?xml version="1.0" encoding="latin1" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
<header>
<copyright>
<year>2007</year><year>2009</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
The contents of this file are subject to the Erlang Public License,
Version 1.1, (the "License"); you may not use this file except in
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at http://www.erlang.org/.
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
under the License.
</legalnotice>
<title>Installation</title>
<prepared>Peter Andersson</prepared>
<docno></docno>
<date>2007-07-03</date>
<rev></rev>
<file>install_chapter.xml</file>
</header>
<section>
<marker id="general"></marker>
<title>General information</title>
<p>The two main interfaces for running tests with Common Test
are an executable Bourne shell script named <c>run_test</c> and an
erlang module named <c>ct</c>. The shell script will work on Unix/Linux
(and Linux-like environments such as Cygwin on Windows) and the
<c>ct</c> interface functions can be called from the Erlang shell
(or from any Erlang function) on any supported platform.</p>
<p>The Common Test application is installed with the Erlang/OTP
system and no explicit installation is required to start using
Common Test by means of the interface functions in the <c>ct</c>
module. If you wish to use <c>run_test</c>, however, this script
needs to be generated first, according to the instructions below.</p>
</section>
<section>
<title>Unix/Linux</title>
<p>Go to the <c><![CDATA[common_test-<vsn>]]></c> directory, located
among the other OTP applications (under the OTP lib directory). Here you
execute the <c>install.sh</c> script with argument <c>local</c>:</p>
<p><c>
$ ./install.sh local
</c></p>
<p>This generates the executable <c>run_test</c> script in the
<c><![CDATA[common_test-<vsn>/priv/bin]]></c> directory. The script
will include absolute paths to the Common Test and Test Server
application directories, so it's possible to copy or move the script to
a different location on the file system, if desired, without having to
update it. It's of course possible to leave the script under the
<c>priv/bin</c> directory and update the PATH variable accordingly (or
create a link or alias to it).</p>
<p>If you, for any reason, have copied Common Test and Test Server
to a different location than the default OTP lib directory, you can
generate a <c>run_test</c> script with a different top level directory,
simply by specifying the directory, instead of <c>local</c>, when running
<c>install.sh</c>. Example:</p>
<p><c>
$ install.sh /usr/local/test_tools
</c></p>
<p>Note that the <c><![CDATA[common_test-<vsn>]]></c> and
<c><![CDATA[test_server-<vsn>]]></c> directories must be located under the
same top directory. Note also that the install script does not copy files
or update environment variables. It only generates the <c>run_test</c>
script.</p>
<p>Whenever you install a new version of Erlang/OTP, the <c>run_test</c>
script needs to be regenerated, or updated manually with new directory names
(new version numbers), for it to "see" the latest Common Test and Test Server
versions.</p>
<p>For more information on the <c>run_test</c> script and the <c>ct</c>
module, please see the reference manual.</p>
</section>
<section>
<title>Windows</title>
<p>On Windows it is very convenient to use Cygwin (<c>www.cygwin.com</c>)
for running Common Test and Erlang, since it enables you to use the
<c>run_test</c> script for starting Common Test. If you are a Cygwin
user, simply follow the instructions above for generating the <c>run_test</c>
script.</p>
<p>If you do not use Cygwin, you have to rely on the API functions
in the <c>ct</c> module (instead of <c>run_test</c>) for running
Common Test as described initially in this chapter.</p>
<p>If you, for any reason, have chosen to store Common Test and Test Server
in a different location than the default OTP lib directory, make
sure the <c>ebin</c> directories of these applications are included
in the Erlang code server path (so the application modules can be loaded).</p>
</section>
</chapter>
|