tests/ directory in ImsStack contains all the ImsStack's Unit Tests.ImsStackJavaTestsImsStackNativeTestsImsStack-alltests - consists two major testmodules explained above.ImsStack-javatests - consists all junit testmodules.ImsStack-nativetests - consists all gtest testmodules.ImsStackJavaTestsImsStackNativeTestsImsStackNativeConfigTestsImsStackNativeEnablerTestsImsStackNativeEnablerAosTestsImsStackNativeEnablerMediaTestsImsStackNativeEnablerMtcTestsImsStackNativeEnablerMtsTestsImsStackNativeEngineTestsImsStackNativePlatformTestsImsStackNativeProtocolTestsImsStackNativeProtocolSipTestsImsStackNativeJniTestsImsStackNativeMainTestsCreate and connect Cuttlefish before executing atest commands.
gcert acloud create --local-image acloud reconnect
atest -c --rebuild-module-info
A testgroup is a collection of multiple testmodules.
atest --test-mapping :<TESTGROUP>
Example: To run all testmodules in ImsStack-nativetests testgroup.
atest --test-mapping :ImsStack-nativetests
Example: To run all testmodules in ImsStack-javatests testgroup.
atest --test-mapping :ImsStack-javatests
atest <TESTMODULE>
Example: To run all tests in ImsStackNativeTests testmodule
atest ImsStackNativeTests
atest <TESTMODULE>:<TESTCLASS>
Example: To run all tests in SipViaHeaderTest test class in ImsStackNativeTests testmodule
atest ImsStackNativeTests:SipViaHeaderTest
--rebuild-module-info as last argument for any atest command to build and run.-c as first argument for any atest command to clean old cache.Example: To build and run a test module along with clear cache:
atest -c <TESTMODULE> --rebuild-module-info
Example: To build and run ImsStackNativeTests testmodule if new test is added
atest -c ImsStackNativeTests --rebuild-module-info
After building ImsStack with mm command, connect Cuttlefish.
$ adb root $ adb remount $ adb sync
adb shell ./data/nativetest64/<TESTMODULE>/<TESTMODULE>
Example: To run ImsStackNativeTests testmodule on CVD/device
adb shell ./data/nativetest64/ImsStackNativeTests/ImsStackNativeTests
Testapk should be installed on device
adb shell am instrument -w <test_package_name>/<runner_class>
Example: To run ImsStackJavaTests testmodule on CVD/device
adb shell am instrument -w com.android.imsstack.tests.java.imsapp/androidx.test.runner.AndroidJUnitRunner
| TESTMODULE | TESTCASES PATH |
|---|---|
| ImsStackJavaTests | /java/ |
| ImsStackNativeTests | /native/libimsstack/ |
| ImsStackNativeConfigTests | /native/libimsstack/config/ |
| ImsStackNativeEnablerTests | /native/libimsstack/enabler/ |
| ImsStackNativeEnablerAosTests | /native/libimsstack/enabler/aos/ |
| ImsStackNativeEnablerMediaTests | /native/libimsstack/enabler/media/ |
| ImsStackNativeEnablerMtcTests | /native/libimsstack/enabler/mtc/ |
| ImsStackNativeEnablerMtsTests | /native/libimsstack/enabler/mts/ |
| ImsStackNativeEngineTests | /native/libimsstack/engine/ |
| ImsStackNativeJniTests | /native/libimsstack/jni/ |
| ImsStackNativeMainTests | /native/libimsstack/main/ |
| ImsStackNativePlatformTests | /native/libimsstack/platform/ |
| ImsStackNativeProtocolTests | /native/libimsstack/protocol/ |
| ImsStackNativeEnablerMtsTests | /native/libimsstack/protocol/sip/ |