Начиная с 27 марта 2025 г. мы рекомендуем использовать android-latest-release
вместо aosp-main
для создания и участия в AOSP. Дополнительные сведения см. в разделе Изменения в AOSP .
Рабочий процесс разработки тестов
Оптимизируйте свои подборки
Сохраняйте и классифицируйте контент в соответствии со своими настройками.
Чтобы интегрировать тесты в службу непрерывного тестирования платформы, необходимо соблюдать рекомендации на этой странице и следовать этому рекомендуемому процессу.
- Используйте систему сборки Soong для простой конфигурации теста .
- Используйте Test Mapping для создания правил тестирования до и после отправки непосредственно в исходном дереве Android.
- Запускайте тесты локально с помощью Atest .
Типы тестов
Поддерживаемые типы тестов:
Функциональные тесты подтверждают успешность или неудачность тестовых случаев, в то время как метрические тесты обычно выполняют действие повторно для сбора временных метрик.
Благодаря стандартизированному формату ввода/вывода необходимость в индивидуальном анализе результатов и постобработке для каждого теста устраняется, и общие тестовые обвязки могут использоваться для всех тестов, которые соответствуют конвенции. См. Обзор Trade Federation для непрерывной тестовой среды, включенной в Android.
Руководство по тестовым случаям
Тестовые случаи, выполняемые через службу непрерывного тестирования, должны быть герметичными , что означает, что все зависимости объявлены и предоставлены вместе с тестами. См. раздел Герметичные серверы в блоге Google Testing для понимания этого принципа. Короче говоря, герметичные тесты не требуют:
- Вход в аккаунт Google
- Настроенное подключение (телефония/Wi-Fi/Bluetooth/NFC)
- Параметры теста переданы
- Настройка или демонтаж, выполняемые тестовой программой для конкретного тестового случая
Контент и образцы кода на этой странице предоставлены по лицензиям. Java и OpenJDK – это зарегистрированные товарные знаки корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2025-07-29 UTC.
[[["Прост для понимания","easyToUnderstand","thumb-up"],["Помог мне решить мою проблему","solvedMyProblem","thumb-up"],["Другое","otherUp","thumb-up"]],[["Отсутствует нужная мне информация","missingTheInformationINeed","thumb-down"],["Слишком сложен/слишком много шагов","tooComplicatedTooManySteps","thumb-down"],["Устарел","outOfDate","thumb-down"],["Проблема с переводом текста","translationIssue","thumb-down"],["Проблемы образцов/кода","samplesCodeIssue","thumb-down"],["Другое","otherDown","thumb-down"]],["Последнее обновление: 2025-07-29 UTC."],[],[],null,["# Test development workflow\n\nTo integrate tests into a platform continuous testing service, they should meet\nthe guidelines on this page and follow this recommended flow.\n\n1. Use the [Soong build system](https://android.googlesource.com/platform/build/soong/) for [Simple Test Configuration](/docs/core/tests/development/blueprints).\n2. Employ [Test Mapping](/docs/core/tests/development/test-mapping) to create pre- and post-submit test rules directly in the Android source tree.\n3. Run tests locally using [Atest](/docs/core/tests/development/atest).\n\nTest types\n----------\n\nSupported test types are:\n\n- [Instrumentation tests](/docs/core/tests/development/instrumentation) support both functional and metrics tests. See [Test your app](https://developer.android.com/studio/test/) for general app testing guidance.\n- [GoogleTest](/docs/core/tests/development/gtest) (GTest) supports the following test types:\n - [Functional GTests](/docs/core/tests/development/gtest-func-e2e) using the [GTest](https://github.com/google/googletest) framework\n - [Metric tests](/docs/core/tests/development/metrics) using [`google-benchmark`](https://github.com/google/benchmark)\n- [JAR host tests](/docs/core/tests/development/jar) using JUnit\n\nFunctional tests make assertions of pass or fail on test cases, while metrics\ntests generally perform an action repeatedly to collect timing metrics.\n\nWith standardized input/output format, the need for customized result parsing\nand post-processing per test is eliminated, and generic test harnesses can be\nused for all tests that fit into the convention. See the [Trade Federation\nOverview](/docs/core/tests/tradefed) for the continuous test framework\nincluded with Android.\n\nTest case guidelines\n--------------------\n\nTest cases executed through the continuous testing service are expected to be\n**hermetic** , meaning that all dependencies are declared and provided with the\ntests. See [Hermetic Servers on the Google Testing\nBlog](https://testing.googleblog.com/2012/10/hermetic-servers.html)\nfor an understanding of this principle. In short, hermetic tests require **no**:\n\n- Google Account sign-in\n- Connectivity configured (telephony/Wi-Fi/Bluetooth/NFC)\n- Test parameters passed in\n- Setup or tear down performed by test harness for a specific test case"]]