Skip to content

Use !shouldfail rather than !mayfail on unit tests #2256

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions jbmc/unit/java_bytecode/ci_lazy_methods/lazy_load_lambdas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

SCENARIO(
"Lazy load lambda methods",
"[core][java_bytecode][ci_lazy_methods][lambdas][!mayfail]")
"[core][java_bytecode][ci_lazy_methods][lambdas][!shouldfail]")
{
GIVEN("A class with some locally declared lambdas")
{
Expand Down Expand Up @@ -192,7 +192,7 @@ SCENARIO(

SCENARIO(
"Lazy load lambda methods in seperate class",
"[core][java_bytecode][ci_lazy_methods][lambdas][!mayfail]")
"[core][java_bytecode][ci_lazy_methods][lambdas][!shouldfail]")
{
const symbol_tablet symbol_table = load_java_class_lazy(
"ExternalLambdaAccessor",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ void validate_local_variable_lambda_assignment(
SCENARIO(
"Converting invokedynamic with a local lambda",
"[core]"
"[lambdas][java_bytecode][java_bytecode_convert_method][!mayfail]")
"[lambdas][java_bytecode][java_bytecode_convert_method][!shouldfail]")
{
// NOLINTNEXTLINE(whitespace/braces)
run_test_with_compilers([](const std::string &compiler) {
Expand Down Expand Up @@ -387,7 +387,7 @@ void validate_member_variable_lambda_assignment(
SCENARIO(
"Converting invokedynamic with a member lambda",
"[core]"
"[lamdba][java_bytecode][java_bytecode_convert_method][!mayfail]")
"[lamdba][java_bytecode][java_bytecode_convert_method][!shouldfail]")
{
// NOLINTNEXTLINE(whitespace/braces)
run_test_with_compilers([](const std::string &compiler) {
Expand Down Expand Up @@ -555,7 +555,7 @@ void validate_static_member_variable_lambda_assignment(
SCENARIO(
"Converting invokedynamic with a static member lambda",
"[core]"
"[lamdba][java_bytecode][java_bytecode_convert_method][!mayfail]")
"[lamdba][java_bytecode][java_bytecode_convert_method][!shouldfail]")
{
// NOLINTNEXTLINE(whitespace/braces)
run_test_with_compilers([](const std::string &compiler) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ decision_proceduret::resultt check_sat(const exprt &expr, const namespacet &ns)
return solver();
}

// The [!mayfail] tag allows tests to fail while reporting the failure
// The [!shouldfail] tag checks the tests fail
SCENARIO("instantiate_not_contains",
"[!mayfail][core][solvers][refinement][string_constraint_instantiation]")
"[!shouldfail][core][solvers][refinement][string_constraint_instantiation]")
{
// For printing expression
register_language(new_java_bytecode_language);
Expand Down
4 changes: 2 additions & 2 deletions unit/util/irep_sharing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#ifdef SHARING

SCENARIO("irept_sharing_trade_offs", "[!mayfail][core][utils][irept]")
SCENARIO("irept_sharing_trade_offs", "[!shouldfail][core][utils][irept]")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I agree with this one: it should actually not fail, it's just a currently known bug in the implementation... (the same is true of the other change in this file). I'd suggest @NathanJPhillips comment on this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Nathan is AL atm, though this isn't critical so can wait if you don't agree with below)

I personally think if it starts not failing, we should turn it on (i.e. remove the flag). This current flag allows it to fluctuate between working and not working without anyone ever noticing. By changing it to !shouldfail, if someone fixes it, the tests will fail and they will know to turn them on (and not accidentally write a bunch more!)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might want to take a quick look at #1980 for the related discussion. I'm fine with your approach.

{
GIVEN("An irept created with move_to_sub")
{
Expand Down Expand Up @@ -114,7 +114,7 @@ SCENARIO("irept_sharing", "[core][utils][irept]")

#include <util/expr.h>

SCENARIO("exprt_sharing_trade_offs", "[!mayfail][core][utils][exprt]")
SCENARIO("exprt_sharing_trade_offs", "[!shouldfail][core][utils][exprt]")
{
GIVEN("An expression created with move_to_operands")
{
Expand Down