diff options
author | Sam Delmerico <delmerico@google.com> | 2023-01-05 20:41:43 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2023-01-05 20:41:43 +0000 |
commit | cbb9b42cc3962d3f512517fba3117eecd9a28c55 (patch) | |
tree | 888cce637671dca4e7d4c728983ecbd4bf24db3a /rules/test_common | |
parent | 89318f00525509b977ae13d75c596f2df89707a6 (diff) | |
parent | cd5ec922cccf489b95605440315b331525297e7c (diff) | |
download | bazel-cbb9b42cc3962d3f512517fba3117eecd9a28c55.tar.gz |
Merge "small fixes for action_flags_test_impl"
Diffstat (limited to 'rules/test_common')
-rw-r--r-- | rules/test_common/flags.bzl | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/rules/test_common/flags.bzl b/rules/test_common/flags.bzl index d9ecdbc3..6d383906 100644 --- a/rules/test_common/flags.bzl +++ b/rules/test_common/flags.bzl @@ -85,13 +85,23 @@ def _action_flags_test_impl(ctx): exclusive_with_flags or action.mnemonic in ctx.attr.mnemonics_with_flags ): + if action.argv == None: + asserts.true( + env, + False, + "expected %s action to have arguments, but argv was None" % ( + action.mnemonic, + ), + ) + continue for flag in ctx.attr.expected_flags: asserts.true( env, flag in action.argv, - "%s action did not contain flag %s" % ( + "%s action did not contain flag %s; argv: %s" % ( action.mnemonic, flag, + action.argv, ), ) elif ( @@ -102,9 +112,10 @@ def _action_flags_test_impl(ctx): asserts.false( env, flag in action.argv, - "%s action unexpectedly contained flag %s" % ( + "%s action unexpectedly contained flag %s; argv: %s" % ( action.mnemonic, flag, + action.argv, ), ) return analysistest.end(env) |