GTest

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 เพื่อหลีกเลี่ยงข้อจำกัดด้านขนาดของอาร์กิวเมนต์ในระบบปฏิบัติการ

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

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

String getGTestCmdLine(String fullPath, String flags)

เมธอดตัวช่วยในการสร้างคําสั่ง gtest เพื่อเรียกใช้

String loadFilter(String binaryOnDevice)

กำหนดเมธอดตัวกรอง get

boolean shouldRunFile(String fullPath)

เมธอดตัวช่วยเพื่อพิจารณาว่าเราควรเรียกใช้ไฟล์ที่ระบุหรือไม่

ตัวสร้างแบบสาธารณะ

GTest

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 เพื่อหลีกเลี่ยงข้อจำกัดด้านขนาดของอาร์กิวเมนต์ในระบบปฏิบัติการ

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

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

การโยน
DeviceNotAvailableException

executeCommandByScript

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

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

พารามิเตอร์
testDevice ITestDevice: อุปกรณ์ที่จะเรียกใช้คําสั่ง

cmd String: สตริงคำสั่งที่จะเรียกใช้

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

การโยน
DeviceNotAvailableException

getGTestCmdLine

protected String getGTestCmdLine (String fullPath, 
                String flags)

เมธอดตัวช่วยในการสร้างคําสั่ง gtest เพื่อเรียกใช้

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

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

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

loadFilter

protected String loadFilter (String binaryOnDevice)

กำหนดเมธอดตัวกรอง get

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

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

คิกรีเทิร์น
String สตริงตัวกรอง

การโยน
DeviceNotAvailableException

shouldRunFile

protected boolean shouldRunFile (String fullPath)

เมธอดตัวช่วยเพื่อพิจารณาว่าเราควรเรียกใช้ไฟล์ที่ระบุหรือไม่

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

คิกรีเทิร์น
boolean จริงหากเราควรเรียกใช้ไฟล์ดังกล่าว