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