Od 27 marca 2025 r. zalecamy używanie android-latest-release zamiast aosp-main do kompilowania i wspołtworzenia AOSP. Więcej informacji znajdziesz w artykule o zmianach w AOSP.
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Zestaw testów dostawców Androida (VTS) zapewnia kompleksowe testowanie tych elementów:
Bąbelki
Warstwa abstrakcji sprzętowej (HAL)
VTS działa na komputerze stacjonarnym i uruchamia przypadki testowe bezpośrednio na podłączonych urządzeniach lub na emulatorach. Podobnie jak CTS, VTS to automatyczny zestaw testów, który korzysta z tych głównych komponentów oprogramowania:
Testowy zestaw narzędzi VTS Trade Federation działa na komputerze hosta i zarządza wykonywaniem testów. Umożliwia konfigurowanie dzielenia na fragmenty na wielu testowanych urządzeniach. Możesz też użyć funkcji Ponowne uruchomienie testu, aby ponownie uruchomić tylko nieudane testy, a nie całe testy, co znacznie skróci czas ponownego uruchamiania.
Poszczególne przypadki testowe są wykonywane na DUT. Przypadki testowe mogą być testami w stylu GTest, testami jądra lub testami w stylu JUnit napisanymi w języku Java.
Typy testów
Różne typy testów VTS są opisane w następnych sekcjach.
Testy w stylu GTest
Większość testów w VTS to testy w stylu GTest, które sprawdzają implementację HAL. Test jest napisany w C++ i uruchamiany na urządzeniu. Typowy test GTest w VTS przechodzi przez każdą instancję danego interfejsu i uruchamia na niej wszystkie przypadki testowe. Przykładem jest VtsHalHealthStorageV1_0TargetTest.
Testy jądra Linuksa
Kselftest (external/linux-kselftest) to zbiór testów dostępnych w repozytorium jądra Linuxa tools/testing/selftests, z których 23 są uwzględnione w VTS do uruchamiania na ARM.
Projekt testów Linuksa (external/ltp) weryfikuje niezawodność, odporność i stabilność jądra Linuksa.
Testy w stylu JUnit
Niewielki zestaw testów sterowanych przez hosta w VTS to testy w stylu JUnit, na przykład:
KernelApiSysfsTest.
Testy w języku Java są implementowane jako BaseHostJUnit4Test, które jest powiązane z urządzeniem testowym i może wykonywać polecenia powłoki w celu weryfikacji.
Samodzielne testy Pythona 3
Niektóre testy VTS, takie jak vts_treble_sys_prop_test, są napisane w Pythonie 3. Testy oparte na języku Python są implementowane jako unittest.TestCase, a każdy przypadek testowy może wchodzić w interakcję z urządzeniem za pomocą poleceń powłoki.
Treść strony i umieszczone na niej fragmenty kodu podlegają licencjom opisanym w Licencji na treści. Java i OpenJDK są znakami towarowymi lub zastrzeżonymi znakami towarowymi należącymi do firmy Oracle lub jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-27 UTC.
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 2025-07-27 UTC."],[],[],null,["# Vendor Test Suite (VTS) and infrastructure\n\nThe Android Vendor Test Suite (VTS) provides\nextensive testing on the following:\n\n- Kernel\n- Hardware abstraction layer (HAL)\n\nVTS runs on a\ndesktop machine and executes test cases directly on attached devices or\non the emulators. Similar to [CTS](/docs/compatibility/cts), VTS is\nan automated test suite that uses the following major software components:\n\n- The VTS [Trade Federation](/docs/core/tests/tradefed) test harness runs on your host machine and manages test execution. It offers the ability to [Configure sharding](/docs/core/tests/tradefed/testing/through-suite/android-test-tuning) across multiple devices under test (DUTs). You can also use the [Suite Retry](/devices/tech/test_infra/tradefed/testing/through-suite/suite-retry) feature to retry only the failures rather than the entire test suites, which greatly reduces the re-run time.\n- Individual test cases are executed on the DUT. The test cases can be GTest-style tests, kernel tests, or JUnit-style tests written in Java.\n\nTypes of tests\n--------------\n\nThe various types of VTS tests are described in the following sections.\n\n### GTest-style tests\n\nMost tests in VTS are GTest-style tests that check the HAL\nimplementation. The test is\nwritten in C++ and runs on the device. A typical VTS GTest iterates through\neach instance of a given interface, and runs all the test cases\nagainst it. Refer to [`VtsHalHealthStorageV1_0TargetTest`](https://cs.android.com/android/platform/superproject/+/android-latest-release:hardware/interfaces/health/storage/1.0/vts/functional/)\nfor an example.\n\n### Linux kernel tests\n\n- Kselftest ([external/linux-kselftest](https://github.com/torvalds/linux/tree/master/tools/testing/selftests/kselftest))\n is a collection of tests included within the Linux kernel repository\n at `tools/testing/selftests`, of which 23 are included in VTS to run on ARM.\n\n- Linux Test Project ([external/ltp](https://cs.android.com/android/platform/superproject/+/android-latest-release:external/ltp/))\n tests validate the reliability, robustness, and stability of the Linux kernel.\n\n### JUnit-style tests\n\nA small set of host-driven tests in VTS are JUnit-style tests, for example,\n[`KernelApiSysfsTest`](https://cs.android.com/android/platform/superproject/+/android-latest-release:test/vts-testcase/kernel/api/sysfs/src/com/android/tests/sysfs/KernelApiSysfsTest.java).\nThe Java tests are implemented as\n[`BaseHostJUnit4Test`](https://cs.android.com/android/platform/superproject/+/android-latest-release:tools/tradefederation/core/test_framework/com/android/tradefed/testtype/junit4/BaseHostJUnit4Test.java),\nwhich is associated with a test device and can run shell\ncommands to perform validation.\n\n### Standalone Python3 tests\n\nSome VTS tests, such as\n[`vts_treble_sys_prop_test`](https://cs.android.com/android/platform/superproject/+/android-latest-release:test/vts-testcase/security/system_property/vts_treble_sys_prop_test.py)\nare written in Python3. The\nPython-based tests are implemented as `unittest.TestCase` and each test\ncase can interact with the device through shell commands.\n| **Caution:** The Python tests aren't recommended due to limited support in the Android tree. We highly recommend writing the VTS tests as GTest, or at least as JUnit-style tests."]]