File: testing.md

package info (click to toggle)
thunderbird 1%3A78.14.0-1~deb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,922,628 kB
  • sloc: cpp: 5,990,120; javascript: 4,418,692; ansic: 3,063,889; python: 915,509; asm: 304,197; xml: 206,623; sh: 109,253; java: 108,679; makefile: 22,985; perl: 15,867; yacc: 4,565; objc: 3,026; pascal: 1,787; lex: 1,720; ada: 1,681; cs: 879; exp: 505; awk: 485; sql: 452; php: 436; lisp: 432; ruby: 99; sed: 69; csh: 45
file content (35 lines) | stat: -rw-r--r-- 1,120 bytes parent folder | download | duplicates (4)
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
# Testing

Given the multiple API languages, processes, and dependencies,
testing FOG is a matter of choosing the right tool for the situation.

## Rust

Not all of our Rust code can be tested in a single fashion, unfortunately.

### Using `rusttests`

If the crate you're testing has no Gecko symbols you can write standard
[Rust tests](https://doc.rust-lang.org/book/ch11-01-writing-tests.html).

This supports both unit tests
(inline in the file under test) and integration tests
(in the `tests/` folder in the crate root).

To run FOG's `rusttests` suite use `mach rusttests`

### Using `gtest`

Because Gecko symbols aren't built for the
`rusttests` build,
any test that is written for a crate that uses Gecko symbols should be written as a
[`gtest`](https://github.com/google/googletest)
in `toolkit/components/glean/gtest/`.

By necessity these can only be integration tests against the compiled crate.

**Note:** When adding a new test file, don't forget to add it to
`toolkit/components/glean/gtest/moz.build` and use the
`FOG` prefix in your test names.

To run FOG's Rust `gtest` suite use `mach gtest FOG.*`