selftests/resctrl: Modularize resctrl test suite main() function
authorFenghua Yu <fenghua.yu@intel.com>
Wed, 17 Mar 2021 02:22:50 +0000 (02:22 +0000)
committerShuah Khan <skhan@linuxfoundation.org>
Fri, 2 Apr 2021 19:58:14 +0000 (13:58 -0600)
commitc9fb4e7cee1ebf38257c93f7f5c8915a1424611e
tree6628b093261c61426daf8a9f1b46f4ecb5708925
parent09a67934625a5941737c566b48e4e574ac4d1d99
selftests/resctrl: Modularize resctrl test suite main() function

Resctrl test suite main() function does the following things
1. Parses command line arguments passed by user
2. Some setup checks
3. Logic that calls into each unit test
4. Print result and clean up after running each unit test

Introduce wrapper functions for steps 3 and 4 to modularize the main()
function. Adding these wrapper functions makes it easier to add any logic
to each individual test.

Please note that this is a preparatory patch for the next one and no
functional changes are intended.

Suggested-by: Reinette Chatre <reinette.chatre@intel.com>
Tested-by: Babu Moger <babu.moger@amd.com>
Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/resctrl/resctrl_tests.c