summaryrefslogtreecommitdiffstats
path: root/chromium/docs/website/site/chromium-os/testing/anatomy-of-test-test/index.md
blob: a79038cbd38092e71e2cecd726496c257293953f (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
---
breadcrumbs:
- - /chromium-os
  - Chromium OS
- - /chromium-os/testing
  - Testing Home
page_name: anatomy-of-test-test
title: Anatomy of test.test
---

This document will go through the pieces of test.test that are available to use,
describing what each does and when it could be used.

# Attributes

job backreference to the job this test instance is part of

outputdir eg. results/<job>/<testname.tag>

resultsdir eg. results/<job>/<testname.tag>/results

profdir eg. results/<job>/<testname.tag>/profiling

debugdir eg. results/<job>/<testname.tag>/debug

bindir eg. tests/<test>

src eg. tests/<test>/src

tmpdir eg. tmp/<tempname>_<testname.tag>

# initialize()

Everytime a test runs this function runs. For example, if you have
iterations=100 set this will run 100 times. Use this when you need to do
something like ensure a package is there.

# setup()

setup() runs the first time the test is set up. This is often used for compiling
source code one should not need to recompile the source for the test for every
iteration or install the same

# run_once()

This is called by job.run_test N times, where N is controlled by the interations
parameter to run_test (Defaulting to one). it also gets called an additional
time with profilers turn on, if any profilers are enabled.

# postprocess_iteration()

This processes any results generated by the test iteration and writes them out
into a keyval. It's generally not called for the profiling iteration, as that
may have difference performance implications.

warmup()