xref: /curl/tests/testcurl.md (revision dcc52095)
1---
2c: Copyright (C) Daniel Stenberg, <daniel.se>, et al.
3SPDX-License-Identifier: curl
4Title: testcurl.pl
5Section: 1
6Source: testcurl
7See-also:
8 - runtests.pl
9Added-in: 7.11.2
10---
11
12# NAME
13
14testcurl.pl - (automatically) test curl
15
16# SYNOPSIS
17
18**testcurl.pl [options] [dir] \> output**
19
20# DESCRIPTION
21
22*testcurl* is the master script to use for automatic distributed testing of
23curl from git or daily snapshots. It is written for the purpose of being run
24from a crontab job or similar at a regular interval. The output is suitable to
25be mailed to **curl-autocompile@haxx.se** to be dealt with automatically (make
26sure the subject includes the word "autobuild" as the mail gets silently
27discarded otherwise). The most current build status (with a reasonable
28backlog) is published on the curl site, at https://curl.se/dev/builds.html
29
30*options* may be omitted. See *--setup* for what happens then.
31
32*dir* is a curl source directory, possibly a daily snapshot one. Using this
33makes *testcurl* skip the *autoreconf* stage and thus it removes the
34dependency on automake, autoconf, libtool, GNU m4 and possibly a few other
35things.
36
37*testcurl* runs `autoreconf` (or similar), configure, builds curl and libcurl
38in a separate build directory and then runs `make test` to test the fresh
39build.
40
41# OPTIONS
42
43## `--configure=[options]`
44
45Configure options passed to configure.
46
47## `--crosscompile`
48``
49This is a cross-compile. Makes *testcurl* skip a few things.
50
51## `--desc=[desc]`
52
53Description of your test system. Displayed on the build summary page on the
54website.
55
56## `--email=[email]`
57
58Set email address to report as. Displayed in the build logs on the site.
59
60## `--mktarball=[command]`
61
62Generic command to run after completed test.
63
64## `--name=[name]`
65
66Set name to report as. Displayed in the build summary on the site.
67
68## `--nobuildconf`
69
70Do not run autoreconf. Useful when many builds use the same source tree, as
71then only one need to do this. Also, if multiple processes run tests
72simultaneously on the same source tree (like several hosts on a NFS mounted
73directory), simultaneous autoreconf invokes may cause problems. (Added in
747.14.1)
75
76## `--nogitpull`
77
78Do not update from git even though it is a git tree. Useful to still be able
79to test even though your network is down, or similar.
80
81## `--runtestopts=[options]`
82
83Options that is passed to the runtests script. Useful for disabling valgrind
84by force, and similar.
85
86## `--setup=[filename]`
87
88filename to read setup from (deprecated). The old style of providing info. If
89info is missing when *testcurl* is started, it prompts you and then stores the
90info in a 'setup' file, which it looks for on each invoke. Use *--name*,
91*--email*, *--configure* and *--desc* instead.
92
93## `--target=[your os]`
94
95Specify your target environment. Recognized strings include `vc`, `mingw32`,
96and `borland`.
97
98# INITIAL SETUP
99
100First, make a checkout from git (or you write a script that downloads daily
101snapshots automatically):
102
103    $ mkdir curl-testing
104    $ cd curl-testing
105    $ git clone https://github.com/curl/curl.git
106
107With the curl sources checked out, or downloaded, you can start testing right
108away. If you want to use *testcurl* without command line arguments and to have
109it store and remember the config in its 'setup' file, then start it manually
110now and fill in the answers to the questions it prompts you for:
111
112    $ ./curl/tests/testcurl
113
114Now you are ready to go. If you let the script run, it performs a full cycle
115and spit out lots of output. Mail us that output as described above.
116
117# CRONTAB EXAMPLE
118
119The crontab could include something like this:
120
121    # autobuild curl:
122    0 4 * * * cd curl-testing && ./testit.sh
123
124Where `testit.sh` is a shell script that could look similar to this:
125
126    mail="mail -s autobuild curl-autocompile@haxx.se"
127    name="--name=whoami"
128    email="--email=iamme@nowhere"
129    desc='"--desc=supermachine Turbo 2000"'
130    testprog="perl ./curl/tests/testcurl.pl $name $email $desc"
131    opts1="--configure=--enable-debug"
132    opts2="--configure=--enable-ipv6"
133
134    # run first test
135    $testprog $opts1 | $mail
136
137    # run second test
138    $testprog $opts2 | $mail
139