diff options
author | Cole Faust <colefaust@google.com> | 2021-12-09 21:32:53 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2021-12-09 21:32:53 +0000 |
commit | 598cbbcde724845c16363c9f2e55e6f6f35da894 (patch) | |
tree | b098e4fb997762da7f91e6dcfb1401eb8f7ee894 | |
parent | f02c28d8ab395cf166bc851927f05c0f1f7298b4 (diff) | |
parent | fdff6b1e9c268c64f45887a28a2a2af187d70d66 (diff) | |
download | build-598cbbcde724845c16363c9f2e55e6f6f35da894.tar.gz |
Merge "Allow multiple patterns in rblf_wildcard"
-rw-r--r-- | core/product_config.rbc | 5 | ||||
-rw-r--r-- | tests/run.rbc | 13 |
2 files changed, 17 insertions, 1 deletions
diff --git a/core/product_config.rbc b/core/product_config.rbc index 45eca9f567..f26b428cd3 100644 --- a/core/product_config.rbc +++ b/core/product_config.rbc @@ -533,7 +533,10 @@ def _require_artifacts_in_path_relaxed(paths, allowed_paths): def _expand_wildcard(pattern): """Expands shell wildcard pattern.""" - return rblf_wildcard(pattern) + result = [] + for word in __words(pattern): + result.extend(rblf_wildcard(word)) + return result def _mkdist_for_goals(g, goal, src_dst_list): """Implements dist-for-goals macro.""" diff --git a/tests/run.rbc b/tests/run.rbc index 53eda160df..b82887f003 100644 --- a/tests/run.rbc +++ b/tests/run.rbc @@ -59,6 +59,19 @@ assert_eq("foo.c no_folder", rblf.notdir("src/foo.c no_folder")) assert_eq("", rblf.notdir("/")) assert_eq("", rblf.notdir("")) +assert_eq( + ["build/make/tests/board.rbc", "build/make/tests/board_input_vars.rbc"], + rblf.expand_wildcard("build/make/tests/board*.rbc") +) +assert_eq( + ["build/make/tests/run.rbc", "build/make/tests/product.rbc"], + rblf.expand_wildcard("build/make/tests/run.rbc build/make/tests/product.rbc") +) +assert_eq( + ["build/make/tests/run.rbc"], + rblf.expand_wildcard("build/make/tests/run.rbc build/make/tests/nonexistent.rbc") +) + (globals, config, globals_base) = rblf.product_configuration("test/device", init, input_variables_init) assert_eq( { |