def main(argv):
    test_cases = [
        LoadCapture(capture_file_path="test_data\\OrbitTest_1-64.orbit",
                    expect_fail=True),
        LoadCapture(capture_file_path="test_data\\OrbitTest_1-72.orbit"),
        FilterTracks(filter_string="Scheduler", expected_track_count=1),
        CheckTimers(track_name_filter='Scheduler*'),
        FilterTracks(filter_string="Frame", expected_track_count=1),
        CheckTimers(track_name_filter='Frame track*'
                    ),  # Verify the frame track has timers
        FilterTracks(filter_string="DynamicName_", expected_track_count=5),
        FilterTracks(filter_string="_var", expected_track_count=6),
        FilterTracks(filter_string="OrbitThread_", expected_track_count=1),
        ToggleCollapsedStateOfAllTracks(),
        CheckTimers(track_name_filter="OrbitThread_*"),
        CheckThreadStates(track_name_filter='OrbitThread_*'),
        FilterTracks(filter_string="ORBIT_ASYNC_TASKS",
                     expected_track_count=1),
        CheckTimers(track_name_filter="ORBIT_ASYNC_TASKS"),
        FilterTracks(filter_string="ORBIT_START_ASYNC_TEST",
                     expected_track_count=1),
        CheckTimers(track_name_filter="ORBIT_START_ASYNC_TEST"),
        FilterTracks(filter_string=""),
        VerifyTracksExist(track_names=["Page*", "*System*", "*CGroup*"],
                          allow_duplicates=True),
        AddIterator(function_name="TestFunc2"),
        VerifyFunctionCallCount(function_name='TestFunc2',
                                min_calls=1257,
                                max_calls=1257)
    ]
    suite = E2ETestSuite(test_name="Capture Loading", test_cases=test_cases)
    suite.execute()
def main(argv):
    # During the tests, we want to verify that captures get automatically saved. We will do so by filtering the recent
    # captures list with the current date (in addition to also deleting old captures before this script runs). However,
    # if it is around midnight when this code gets executed and we store the date string, it can be that the capture
    # actually gets taken on the next day. Therefore, we will also check for the next day.
    today = date.today()
    tomorrow = today + timedelta(days=1)
    today_string = today.strftime("%Y_%m_%d")
    tomorrow_string = tomorrow.strftime("%Y_%m_%d")
    test_cases = [
        LoadCapture(capture_file_path="testdata\\OrbitTest_1-64.orbit",
                    expect_fail=True),
        LoadCapture(capture_file_path="testdata\\OrbitTest_1-72.orbit"),
        FilterTracks(filter_string="Scheduler", expected_track_count=1),
        CheckTimers(track_name_filter='Scheduler*'),
        FilterTracks(filter_string="Frame", expected_track_count=1),
        CheckTimers(track_name_filter='Frame track*'
                    ),  # Verify the frame track has timers
        FilterTracks(filter_string="DynamicName_", expected_track_count=5),
        FilterTracks(filter_string="_var", expected_track_count=6),
        FilterTracks(filter_string="OrbitThread_", expected_track_count=1),
        ToggleCollapsedStateOfAllTracks(),
        CheckTimers(track_name_filter="OrbitThread_*"),
        CheckThreadStates(track_name_filter='OrbitThread_*'),
        FilterTracks(filter_string="ORBIT_ASYNC_TASKS",
                     expected_track_count=1),
        CheckTimers(track_name_filter="ORBIT_ASYNC_TASKS"),
        FilterTracks(filter_string="ORBIT_START_ASYNC_TEST",
                     expected_track_count=1),
        CheckTimers(track_name_filter="ORBIT_START_ASYNC_TEST"),
        FilterTracks(filter_string=""),
        VerifyTracksExist(track_names=["Page*", "*System*", "*CGroup*"],
                          allow_duplicates=True),
        AddIterator(function_name="TestFunc2"),
        VerifyFunctionCallCount(function_name="TestFunc2",
                                min_calls=1257,
                                max_calls=1257),

        # Let's take a capture with the current version and verify this can be loaded
        EndSession(),
        ConnectToStadiaInstance(),
        FilterAndSelectFirstProcess(process_filter="hello_ggp"),
        Capture(),
        VerifyTracksExist(track_names="hello_ggp_stand*",
                          allow_duplicates=True),
        EndSession(),
        # If we took the capture around midnight, we need to ensure to also look for the next day. Remember, the strings
        # get created before the tests run. Thus the `today_string` might be actually from the day before the capture
        # gets auto-saved.
        LoadLatestCapture(filter_strings=[
            f"hello_ggp_stand_{today_string}",
            f"hello_ggp_stand_{tomorrow_string}"
        ]),
        VerifyTracksExist(track_names="hello_ggp_stand*",
                          allow_duplicates=True)
    ]
    suite = E2ETestSuite(test_name="Capture Loading", test_cases=test_cases)
    suite.execute()
Exemple #3
0
def main(argv):
    test_cases = [
        ConnectToStadiaInstance(),
        FilterAndSelectFirstProcess(process_filter="UE4Game"),
        Capture(),
        VerifyTracksExist(track_names=["gfx"]),
        ExpandTrack(expected_name="gfx"),
        CheckTimers(track_name_filter='gfx_submissions', recursive=True),
        CheckTimers(track_name_filter='gfx_marker', recursive=True),
        CollapseTrack(expected_name="gfx")
    ]
    suite = E2ETestSuite(test_name="Vulkan Layer", test_cases=test_cases)
    suite.execute()
Exemple #4
0
def main(argv):
    tracks = [
        "DynamicName_0", "DynamicName_1", "DynamicName_2", "DynamicName_3", "double_var",
        "float_var", "int64_var", "int_var", "uint64_var", "uint_var", "ORBIT_ASYNC_TASKS",
        "ORBIT_START_ASYNC_TEST"
    ]
    test_cases = [
        ConnectToStadiaInstance(),
        FilterAndSelectFirstProcess(process_filter='OrbitTest'),
        LoadSymbols(module_search_string="OrbitTest"),
        # Take a capture without manual instrumentation and assert that no tracks show up.
        Capture(manual_instrumentation=False),
        VerifyTracksDoNotExist(track_names=tracks),
        # Take a capture with manual instrumentation and check for the existence of the tracks and the timers in the thread tracks.
        Capture(manual_instrumentation=True),
        VerifyTracksExist(track_names=tracks),
        FilterTracks(filter_string="OrbitThread_", expected_track_count=3),
        ToggleCollapsedStateOfAllTracks(),
        CheckTimers(track_name_filter="OrbitThread_*"),
        # Take another capture without manual instrumentation and assert that the tracks are gone.
        Capture(manual_instrumentation=False),
        VerifyTracksDoNotExist(track_names=tracks),
    ]
    suite = E2ETestSuite(test_name="Manual Instrumentation", test_cases=test_cases)
    suite.execute()
Exemple #5
0
    def _execute(self, function_name):
        cell, index = self.find_function_cell(function_name)
        cell.click_input(button='right')
        self.find_context_menu_item('Enable frame track(s)').click_input()

        tree_view = self.find_control('Tree', parent=self._live_tab)
        wait_for_condition(
            lambda: "F" in tree_view.children()[index - 1].window_text())

        logging.info("Verifying existence of track in the Capture window")
        match_tracks = MatchTracks(
            expected_names=["Frame track based on %s" % function_name],
            allow_additional_tracks=True)
        match_tracks.execute(self.suite)

        check_timers = CheckTimers(track_name_contains=function_name)
        check_timers.execute(self.suite)
def main(argv):
    test_cases = [
        LoadCapture(relative_capture_file_path=
                    "automation_tests\\test_data\\OrbitTest_1-64.orbit"),
        VerifyModalWindowExistsAndClickOkay(
            window_name="Error while loading capture"),
        LoadCapture(relative_capture_file_path=
                    "automation_tests\\test_data\\OrbitTest_1-72.orbit"),
        FilterTracks(filter_string="Scheduler", expected_track_count=1),
        CheckTimers(track_name_filter='Scheduler*'),
        FilterTracks(filter_string="Frame", expected_track_count=1),
        CheckTimers(track_name_filter='Frame track*'
                    ),  # Verify the frame track has timers
        FilterTracks(filter_string="DynamicName_", expected_track_count=5),
        FilterTracks(filter_string="_var", expected_track_count=6),
        FilterTracks(filter_string="OrbitThread_", expected_track_count=1),
        ToggleCollapsedStateOfAllTracks(),
        CheckTimers(track_name_filter="OrbitThread_*"),
        CheckThreadStates(track_name_filter='OrbitThread_*'),
        FilterTracks(filter_string="ORBIT_ASYNC_TASKS",
                     expected_track_count=1),
        CheckTimers(track_name_filter="ORBIT_ASYNC_TASKS"),
        FilterTracks(filter_string="ORBIT_Start_ASYNC_TEST",
                     expected_track_count=1),
        CheckTimers(track_name_filter="ORBIT_Start_ASYNC_TEST"),
        FilterTracks(filter_string="Page", expected_track_count=1),
        ExpandTrack(expected_name="Page Faults"),
        CollapseTrack(expected_name="Page Faults"),
        FilterTracks(filter_string="System", expected_track_count=1),
        ExpandTrack(expected_name="Memory Usage: System (MB)"),
        CollapseTrack(expected_name="Memory Usage: System (MB)"),
        FilterTracks(filter_string="CGroup", expected_track_count=1),
        ExpandTrack(expected_name="Memory Usage: CGroup (MB)"),
        CollapseTrack(expected_name="Memory Usage: CGroup (MB)"),
        FilterTracks(filter_string=""),
        AddIterator(function_name="TestFunc2"),
        VerifyFunctionCallCount(function_name='TestFunc2',
                                min_calls=1257,
                                max_calls=1257)
    ]
    suite = E2ETestSuite(test_name="Capture Loading", test_cases=test_cases)
    suite.execute()
def main(argv):
    test_cases = [
        ConnectToStadiaInstance(),
        FilterAndSelectFirstProcess(process_filter="triangle.exe"),
        LoadSymbols(module_search_string="triangle.exe"),
        Capture(manual_instrumentation=True),
        VerifyTracksExist(track_names=[
            "Frame time, ms (double)", "Frame time, ms (float)",
            "Frame time, us (int)", "Frame time, us (int64)",
            "Frame time, us (uint)", "Frame time, us (uint64)",
            "Render (async)"
        ]),
        VerifyTracksExist(track_names="triangle.exe", allow_duplicates=True),
        CheckTimers(track_name_filter="Render (async)"),
        # There are multiple tracks with the name of the process, and we can't rename threads on Windows,
        # hence `require_all=False`.
        CheckTimers(track_name_filter="triangle.exe", require_all=False),
    ]
    suite = E2ETestSuite(test_name="Manual Instrumentation on Silenus",
                         test_cases=test_cases)
    suite.execute()
Exemple #8
0
def main(argv):
    test_cases = [
        ConnectToStadiaInstance(),
        FilterAndSelectFirstProcess(process_filter="hello_ggp"),
        LoadSymbols(module_search_string="hello_ggp"),
        FilterAndHookFunction(function_search_string='DrawFrame'),
        Capture(),
        AddFrameTrack(function_name="DrawFrame"),
        VerifyTracksExist(track_names="Frame track*"),  # Verify there's exactly one frame track
        CheckTimers(track_name_filter='Frame track*')  # Verify the frame track has timers
    ]
    suite = E2ETestSuite(test_name="Add Frame Track", test_cases=test_cases)
    suite.execute()
Exemple #9
0
def main(argv):
    test_cases = [
        ConnectToStadiaInstance(),
        FilterAndSelectFirstProcess(process_filter='hello_'),
        LoadSymbols(module_search_string="hello_ggp"),
        Capture(),
        CheckTimers(track_name_filter='Scheduler'),
        CheckTimers(track_name_filter='gfx'),
        CheckTimers(track_name_filter="All Threads", expect_exists=False),
        CheckTimers(track_name_filter="hello_ggp_stand", expect_exists=False),
        FilterAndHookFunction(function_search_string='DrawFrame'),
        Capture(),
        VerifyFunctionCallCount(function_name='DrawFrame', min_calls=30, max_calls=3000),
        CheckTimers(track_name_filter="All Threads", expect_exists=False),
        CheckTimers(track_name_filter="hello_ggp_stand")
    ]
    suite = E2ETestSuite(test_name="Instrument Function", test_cases=test_cases)
    suite.execute()