Skip to content
Snippets Groups Projects
  1. Aug 21, 2024
    • Gustavo Sousa's avatar
      runner: Make it easier to extend argv · fe4d0a3a
      Gustavo Sousa authored and Matt Roper's avatar Matt Roper committed
      
      In an upcoming change, we will be adding the option to forward the
      --hook option to the test cases, which will require updating
      execute_test_process() to add the option when asked by the user.
      
      The current implementation makes that task not quite straightforward:
      filling of argv is already dependent on stuff like entry->subtest_count
      and dynbegin; if we want to keep on using constant indices, we would
      need several conditional branches for adding arguments for --hook.
      
      Let us change the current implementation to use a dynamic vector, to
      make it easier to extend argv with more stuff as needed.
      
      v2:
        - Squash the logic from patch "runner: Use dynamic vector for test
          argv" directly instead of using the original logic, which used a
          statically sized array. (Lucas)
      
      Reviewed-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
      Signed-off-by: default avatarGustavo Sousa <gustavo.sousa@intel.com>
      Link: https://lore.kernel.org/r/20240814204822.95283-3-gustavo.sousa@intel.com
      
      
      Signed-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
      fe4d0a3a
    • Gustavo Sousa's avatar
      igt_hook: Add feature · bc35cf56
      Gustavo Sousa authored and Matt Roper's avatar Matt Roper committed
      
      For development purposes, sometimes it is useful to have a way of
      running custom scripts at certain points of test executions. A
      real-world example I bumped into recently is to collect information from
      sysfs before and after running each entry of a testlist.
      
      While it is possible for the user to handcraft a script that calls each
      test with the correct actions before and after execution, we can provide
      a better experience by adding built-in support for running hooks during
      test execution.
      
      That would be even better when adding the same kind of support for
      igt_runner (which is done in an upcoming change), since the user can
      also nicely resume with igt_resume with the hook already setup in case a
      crash happens during execution of the test list.
      
      As such provide implement support for hooks, integrate it into
      igt_core and expose the functionality via --hook CLI option on test
      executables.
      
      v2:
        - s/igt_hook_init/igt_hook_create/ (Lucas)
        - Use SPDX License Identifier instead of license text. (Lucas)
        - Do not rely on hard-coded length 3 when generating full test name.
          (Lucas)
        - Do not pollute current environment variables when running hooks.
          (Lucas)
        - Change hook string in run_tests_and_match_env() to use "printf"
          instead of "echo" to be compatible with CI environment.
      
      v3:
        - igt_hook_create() only errors out for invalid input.
        - Use igt_hook_free() instead of simply free() in the error path for
          common_init().
        - Go back to the simpler logic for calling hooks instead of using
          fork: setenv() calls followed by system().
        - Change igt_hook_create() to return error number and receive
          reference to destination pointer instead of the opposite. (Lucas)
        - Remove checks for non-existing negative return of igt_hook_create().
          (Lucas)
        - s/igt_hook_push_evt/igt_hook_event_notify/. (Lucas)
        - Simplify call sites for igt_hook_event_notify() by allowing argument
          to igt_hook to be NULL and using compount literals for the event
          struct. (Lucas)
        - Fix style for igt_hook_calc_test_fullname_size(). (Lucas)
      
      v4:
        - Remove needless parentheses. (Lucas)
      
      Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com> # v3
      Signed-off-by: default avatarGustavo Sousa <gustavo.sousa@intel.com>
      Link: https://lore.kernel.org/r/20240814204822.95283-2-gustavo.sousa@intel.com
      
      
      Signed-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
      bc35cf56
  2. Aug 20, 2024
  3. Aug 19, 2024
  4. Aug 16, 2024
  5. Aug 15, 2024
  6. Aug 14, 2024
  7. Aug 13, 2024
  8. Aug 11, 2024
  9. Aug 09, 2024
  10. Aug 08, 2024
  11. Aug 07, 2024
Loading