agentleFS
GoogleKnown publishergoogle/skia/_agents/skills/skia-add-test/SKILL.md

skia-add-test

Skill11k starsChanged 4 days agoBSD-3-ClauseView on GitHub

Add a new test to the Skia repository. Use this skill when you need to create a new unit or integration test in the tests/ directory and ensure it's part of the build system.

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Create a new .cpp file in the tests/ directory.

    line 13
  2. Very specific:

    Add the path to your new test file to the tests_sources list in gn/tests.gni.

    line 17
  3. Very specific:

    Use dm with the --match flag to run your specific test.

    line 27
  4. Very specific:

    If condition fails, the error will include "My Subtest".

    line 57

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Skia Add Test Skill

This skill guides you through adding a new test to Skia. Tests are primarily written in C++ and located in the tests/ directory.

Workflow

1. Create the Test File

Create a new .cpp file in the tests/ directory. Use the provided template as a starting point.

  • Template Location: assets/test_template.cpp

2. Update the Build System

Add the path to your new test file to the tests_sources list in gn/tests.gni.

  • Paths in gn/tests.gni should be relative to the directory or use the $_tests variable.

3. Build the Test

Compile the dm tool, which runs the tests.

ninja --quiet -C out/Debug dm

4. Run the Test

Use dm with the --match flag to run your specific test.

out/Debug/dm --match [test_name]

Note: Replace [test_name] with the name provided to the DEF_TEST (or similar) macro.

Key Concepts

Macros for Defining Tests

  • DEF_TEST(name, reporter): Standard CPU test.
  • DEF_GANESH_TEST(name, reporter, options, ctsEnforcement): Ganesh GPU test.
  • DEF_GRAPHITE_TEST_FOR_ALL_CONTEXTS(name, reporter, context, ctsEnforcement): Graphite GPU test.

CtsEnforcement

CtsEnforcement is used to track tests that should be run as part of Android's Conformance Test Suite (CTS) for a specific milestone (e.g., kApiLevel_T) or later.

  • CtsEnforcement::kNever: The test is not part of CTS.
  • CtsEnforcement::kApiLevel_U: The test is required for Android U and later.

Reporter and Assertions

  • REPORTER_ASSERT(reporter, condition, ...): Standard assertion.
  • ERRORF(reporter, ...): Report a failure with a formatted message.
  • skiatest::ReporterContext: Use this stack-allocated object to provide additional context (like subtest names) for failure reports.

Example of ReporterContext:

{
    skiatest::ReporterContext subtest(reporter, SkString("My Subtest"));
    REPORTER_ASSERT(reporter, condition);
}

If condition fails, the error will include "My Subtest".

Download now (ZIP)

Trending

Quiet since July.about the whole repository

Dec 2025: 2 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 1 mentionMay 2026: 0 mentionsJun 2026: 1 mentionJul 2026: 4 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the google/skia repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about google/skia

The biggest 5 of 37 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 37

Talked about on GitHub, Stack Overflow and Hacker News (37 times).

On GitHub · 30

25 more on GitHub

On Hacker News · 1

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.