Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
scripts/sanitycheck: fix merging OVERLAY_CONFIG extra args
Overlay files were concatenated into single string with no whitespace between them. If '--extra-args OVERLAY_CONFIG="overlay-1.conf" --extra-args OVERLAY_CONFIG="overlay-2.conf"' was used, then the result was OVERLAY_CONFIG="overlay-1.confoverlay-2.conf". Another thing was that overlay extra args were not properly removed from the list of regular arguments. As a result we had incorrect list of overlays and incorrect list of other arguments. Rework code to extract overlays in loop in a safe manner. Use for that a list of strings instead of string directly. Join those strings and form a single OVERLAY_CONFIG argument just before running cmake. Tested with following testcase.yaml line: extra_args: ARG1 OVERLAY_CONFIG="overlay-1.conf" ARG2 OVERLAY_CONFIG="overlay-2.conf" Before this patch we got: args = ['OVERLAY_CONFIG="overlay-1.conf"', 'OVERLAY_CONFIG="overlay-2.conf"'] After this patch we get: args = ['ARG1', 'ARG2', 'OVERLAY_CONFIG="overlay-1.conf overlay-2.conf"'] While at it, fix also regex pattern by removing requirement of double quotes around value. Match any option value instead and strip both single and double quotes when match is positive. Tested with: $ ./scripts/sanitycheck -T samples/hello_world/ -p qemu_x86 \ --extra-args OVERLAY_CONFIG=overlay1.conf ' --extra-args OVERLAY_CONFIG=\"overlay2.conf\" ' --extra-args OVERLAY_CONFIG=\'overlay3.conf\' Signed-off-by: Marcin Niestroj <[email protected]>
- Loading branch information