This pull request primarily refactors the way custom tests are set up and executed in the custom_tests directory. The changes include modifying the test command in CMakeLists.txt, adding a new function to get the program string from command line arguments or standard input, and updating various test files to use this new function.
Changes to test setup:
custom_tests/CMakeLists.txt: Modified the test command to directly execute the test executable with a --program argument pointing to the potential input file, instead of using a Windows command script to pipe the input file into the test executable.
custom_tests/srcs/ubpf_custom_test_support.cc: Added a new function get_program_string that gets the program string from command line arguments or standard input. This function is used to replace the previous method of getting the program string from standard input in various test files.
Several test files in custom_tests/srcs/: Replaced the previous method of getting the program string from standard input with the new get_program_string function. This includes error handling for when the program string cannot be obtained. [1][2][3][4][5][6][7]
Removal of unnecessary files:
custom_tests/windows/test.cmd: Removed this Windows command script as it is no longer used after the modification to the test command in CMakeLists.txt.
coverage: 80.354% (-1.0%) from 81.344%
when pulling 66cf27cd7f79a99469949c523b8ee2f326a83d04 on Alan-Jowett:improve_cli_handling
into a0f7abbb0271149560d1ddd493b0bb59110fac11 on iovisor:main.
This pull request primarily refactors the way custom tests are set up and executed in the
custom_tests
directory. The changes include modifying the test command inCMakeLists.txt
, adding a new function to get the program string from command line arguments or standard input, and updating various test files to use this new function.Changes to test setup:
custom_tests/CMakeLists.txt
: Modified the test command to directly execute the test executable with a--program
argument pointing to the potential input file, instead of using a Windows command script to pipe the input file into the test executable.custom_tests/srcs/ubpf_custom_test_support.cc
: Added a new functionget_program_string
that gets the program string from command line arguments or standard input. This function is used to replace the previous method of getting the program string from standard input in various test files.custom_tests/srcs/ubpf_custom_test_support.h
: Added a function declaration forget_program_string
.Updates to test files:
custom_tests/srcs/
: Replaced the previous method of getting the program string from standard input with the newget_program_string
function. This includes error handling for when the program string cannot be obtained. [1] [2] [3] [4] [5] [6] [7]Removal of unnecessary files:
custom_tests/windows/test.cmd
: Removed this Windows command script as it is no longer used after the modification to the test command inCMakeLists.txt
.