[welcome] Add debugging checks slow-false and slow-true

This commit is contained in:
Adriaan de Groot 2022-06-10 01:00:27 +02:00
parent 26751f2acd
commit 0fd0e9a1af
2 changed files with 23 additions and 1 deletions

View File

@ -228,6 +228,15 @@ GeneralRequirements::checkRequirements()
false, false,
required } ); required } );
} }
if ( entry == "slow-false" )
{
sleep(3);
checkEntries.append( { entry,
[] { return tr( "is always false (slowly)" ); },
[] { return tr( "The computer says no (slowly)." ); },
false,
required } );
}
if ( entry == "true" ) if ( entry == "true" )
{ {
checkEntries.append( { entry, checkEntries.append( { entry,
@ -236,6 +245,15 @@ GeneralRequirements::checkRequirements()
true, true,
required } ); required } );
} }
if ( entry == "slow-true" )
{
sleep(3);
checkEntries.append( { entry,
[] { return tr( "is always true (slowly)" ); },
[] { return tr( "The computer says yes (slowly)." ); },
true,
required } );
}
if ( entry == "snark" ) if ( entry == "snark" )
{ {
static unsigned int snark_count = 0; static unsigned int snark_count = 0;

View File

@ -67,9 +67,13 @@ requirements:
# #
# Note that the last three checks are for testing-purposes only, # Note that the last three checks are for testing-purposes only,
# and shouldn't be used in production (they are only available # and shouldn't be used in production (they are only available
# when building Calamares in development mode): # when building Calamares in development mode). There are five
# special checks:
# - *false* is a check that is always false (unsatisfied) # - *false* is a check that is always false (unsatisfied)
# - *true* is a check that is always true (satisfied) # - *true* is a check that is always true (satisfied)
# - *slow-false* takes 3 seconds, and then is false; use this one to
# show off the waiting-spinner before the first results come in
# - *slow-true* takes 3 seconds, and then is true
# - *snark* is a check that is only satisfied once it has been checked # - *snark* is a check that is only satisfied once it has been checked
# at least three times ("what I tell you three times is true"). # at least three times ("what I tell you three times is true").
check: check: