Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: site/dev/contrib/tests.md

Issue 954523004: Add testing section of docs (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove content, update build description Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « site/dev/contrib/testing.md ('k') | site/dev/testing/buildbot.md » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 Writing Unit and Rendering Tests
2 ================================
3
4 Writing a Unit Test
5 -------------------
6
7 1. Add a file `tests/NewUnitTest.cpp`:
8
9 <!--?prettify lang=cc?-->
10
11 /*
12 * Copyright ........
13 *
14 * Use of this source code is governed by a BSD-style license
15 * that can be found in the LICENSE file.
16 */
17 #include "Test.h"
18 DEF_TEST(NewUnitTest, reporter) {
19 if (1 + 1 != 2) {
20 ERRORF(reporter, "%d + %d != %d", 1, 1, 2);
21 }
22 bool lifeIsGood = true;
23 REPORTER_ASSERT(reporter, lifeIsGood);
24 }
25
26 2. Add a line to `gyp/tests.gypi`:
27
28 '../tests/NewUnitTest.cpp',
29
30 3. Recompile and run test:
31
32 ./gyp_skia
33 ninja -C out/Debug dm
34 out/Debug/dm --match NewUnitTest
35
36 Writing a Rendering Test
37 ------------------------
38
39 1. Add a file `gm/newgmtest.cpp`:
40
41 <!--?prettify lang=cc?-->
42
43 /*
44 * Copyright ........
45 *
46 * Use of this source code is governed by a BSD-style license
47 * that can be found in the LICENSE file.
48 */
49 #include "gm.h"
50 DEF_SIMPLE_GM(newgmtest, canvas, 128, 128) {
51 canvas->clear(SK_ColorWHITE);
52 SkPaint p;
53 p.setStrokeWidth(2);
54 canvas->drawLine(16, 16, 112, 112, p);
55 }
56
57 2. Add a line to `gyp/gmslides.gypi`:
58
59 '../gm/newgmtest.cpp',
60
61 3. Recompile and run test:
62
63 ./gyp_skia
64 ninja -C out/Debug dm
65 out/Debug/dm --match newgmtest
OLDNEW
« no previous file with comments | « site/dev/contrib/testing.md ('k') | site/dev/testing/buildbot.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698