Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
  • linux
  • tools
  • testing
  • memblock
  • tests
  • basic_api.c
Find file BlameHistoryPermalink
  • Rebecca Mckeever's avatar
    memblock tests: add verbose output to memblock tests · 76586c00
    Rebecca Mckeever authored Jul 03, 2022
    
    
    Add and use functions and macros for printing verbose testing output.
    
    If the Memblock simulator was compiled with VERBOSE=1:
    - prefix_push(): appends the given string to a prefix string that will be
      printed in test_fail() and test_pass*().
    
    - prefix_pop(): removes the last prefix from the prefix string.
    
    - prefix_reset(): clears the prefix string.
    
    - test_fail(): prints a message after a test fails containing the test
      number of the failing test and the prefix.
    
    - test_pass(): prints a message after a test passes containing its test
      number and the prefix.
    
    - test_print(): prints the given formatted output string.
    
    - test_pass_pop(): runs test_pass() followed by prefix_pop().
    
    - PREFIX_PUSH(): runs prefix_push(__func__).
    
    If the Memblock simulator was not compiled with VERBOSE=1, these
    functions/macros do nothing.
    
    Add the assert wrapper macros ASSERT_EQ(), ASSERT_NE(), and ASSERT_LT().
    If the assert condition fails, these macros call test_fail() before
    executing assert().
    
    Acked-by: default avatarDavid Hildenbrand <david@redhat.com>
    Reviewed-by: default avatarShaoqin Huang <shaoqin.huang@intel.com>
    Signed-off-by: default avatarRebecca Mckeever <remckee0@gmail.com>
    Signed-off-by: default avatarMike Rapoport <rppt@linux.ibm.com>
    Link: https://lore.kernel.org/r/f234d443fe154d5ae8d8aa07284aff69edfb6f61.1656907314.git.remckee0@gmail.com
    76586c00
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7