จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ

จีเทส

public class GTest
extends GTestBase implements IDeviceTest

java.lang.Object
. com.android.tradefed.testtype.GTestBase
. com.android.tradefed.testtype.GTest


การทดสอบที่รันแพ็คเกจการทดสอบดั้งเดิมบนอุปกรณ์ที่กำหนด

สรุป

ผู้สร้างสาธารณะ

GTest ()

วิธีการสาธารณะ

ITestDevice getDevice ()

รับอุปกรณ์ภายใต้การทดสอบ

boolean isRebootBeforeTestEnabled ()
void run ( TestInformation testInfo, ITestInvocationListener listener)

void setDevice ( ITestDevice device)

ฉีดอุปกรณ์ภายใต้การทดสอบ

void setNativeTestDevicePath (String path)

วิธีการป้องกัน

String createFlagFile (String filter)

สร้างไฟล์ที่มีตัวกรองที่จะใช้ผ่าน --gtest_flagfile เพื่อหลีกเลี่ยงข้อจำกัดของระบบปฏิบัติการในขนาด args

void executeCommandByScript ( ITestDevice testDevice, String cmd, IShellOutputReceiver resultParser)

เมธอด Helper เพื่อรันคำสั่ง gtest จากสคริปต์ชั่วคราว ในกรณีที่คำสั่งยาวเกินไปที่จะรันโดย adb โดยตรง

String getGTestCmdLine (String fullPath, String flags)

เมธอด Helper เพื่อสร้างคำสั่ง gtest ให้รัน

String loadFilter (String binaryOnDevice)

กำหนดรับวิธีการกรอง

boolean shouldRunFile (String fullPath)

วิธี Helper เพื่อตรวจสอบว่าเราควรรันไฟล์ที่กำหนดหรือไม่

ผู้สร้างสาธารณะ

จีเทส

public GTest ()

วิธีการสาธารณะ

getDevice

public ITestDevice getDevice ()

รับอุปกรณ์ภายใต้การทดสอบ

คืนสินค้า
ITestDevice ITestDevice

isRebootBeforeTestEnabled

public boolean isRebootBeforeTestEnabled ()

คืนสินค้า
boolean

วิ่ง

public void run (TestInformation testInfo, 
                ITestInvocationListener listener)

พารามิเตอร์
testInfo TestInformation

listener ITestInvocationListener

ขว้าง
DeviceNotAvailableException

setDevice

public void setDevice (ITestDevice device)

ฉีดอุปกรณ์ภายใต้การทดสอบ

พารามิเตอร์
device ITestDevice : ITestDevice ที่จะใช้

setNativeTestDevicePath

public void setNativeTestDevicePath (String path)

พารามิเตอร์
path String

วิธีการป้องกัน

createFlagFile

protected String createFlagFile (String filter)

สร้างไฟล์ที่มีตัวกรองที่จะใช้ผ่าน --gtest_flagfile เพื่อหลีกเลี่ยงข้อจำกัดของระบบปฏิบัติการในขนาด args

พารามิเตอร์
filter String : สตริงตัวกรอง

คืนสินค้า
String พาธไปยังไฟล์ที่มีตัวกรอง

ขว้าง
DeviceNotAvailableException

รัน CommandByScript

protected void executeCommandByScript (ITestDevice testDevice, 
                String cmd, 
                IShellOutputReceiver resultParser)

เมธอด Helper เพื่อรันคำสั่ง gtest จากสคริปต์ชั่วคราว ในกรณีที่คำสั่งยาวเกินไปที่จะรันโดย adb โดยตรง

พารามิเตอร์
testDevice ITestDevice : อุปกรณ์ที่จะรันคำสั่ง

cmd String : สตริงคำสั่งที่จะรัน

resultParser IShellOutputReceiver : ตัวรับเอาต์พุตสำหรับอ่านผลการทดสอบ

ขว้าง
DeviceNotAvailableException

getGTestCmdLine

protected String getGTestCmdLine (String fullPath, 
                String flags)

เมธอด Helper เพื่อสร้างคำสั่ง gtest ให้รัน

พารามิเตอร์
fullPath String : เส้นทางระบบไฟล์แบบสัมบูรณ์ไปยัง gtest binary บนอุปกรณ์

flags String : gtest การดำเนินการแฟล็ก

คืนสินค้า
String บรรทัดคำสั่งเชลล์ที่จะรันสำหรับ gtest

loadFilter

protected String loadFilter (String binaryOnDevice)

กำหนดรับวิธีการกรอง

คลาสย่อยต้องใช้วิธีการรับตัวกรองของตัวเอง

พารามิเตอร์
binaryOnDevice String : เส้นทางแบบเต็มของไฟล์ตัวกรอง

คืนสินค้า
String สตริงตัวกรอง

ขว้าง
DeviceNotAvailableException

ควรเรียกใช้ไฟล์

protected boolean shouldRunFile (String fullPath)

วิธี Helper เพื่อตรวจสอบว่าเราควรรันไฟล์ที่กำหนดหรือไม่

พารามิเตอร์
fullPath String : เส้นทางแบบเต็มของไฟล์ที่เป็นปัญหา

คืนสินค้า
boolean จริงถ้าเราควรรันไฟล์ดังกล่าว

ขว้าง
DeviceNotAvailableException