asynctypes-685526: Add options/error to audits

testTooltip was using setInput in a synchronous way, so we added the
checks that it made to audits, and converted the test.
helpers also benefits from an outputArray utility that cuts down a bunch
of duplicated lines.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
asynctypes-685526: Remove helpers.exec

Convert the few remaining uses of helpers.exec from testCanon converting
to helpers.audit, and we can remove the function form helpers.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
asynctypes-685526: Minor tidy-ups

Update TODO file, minor test re-ordering, comment out some tests that
were failing intermittently.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
asynctypes-685526: s/setup: '/setup:    '/g

Many of the tests attempt to line up the typed input with the tested
output, the hints, validations, and so on. This brings things into line
a bit better.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
asynctypes-685526: Add <RETURN> to the magic key presses

More reliable setup of tests.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
asynctypes-685526: Simplify helpers.audit

Minor refactor which makes check optional, and makes logging optional
too.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
asynctypes-685526: Move promise/etc to util

We have kept testing code separate from main gcli code for good reason
but this has meant that utilities (like promise) have not been available
to test code (also the test code came first). So we're creating a new
top level package called util that will hold promise, and other utils.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
asynctypes-685526: Use promises in test harness

This slashes a ton of complex code by removing checkCalled. From now on
a test is done when its promise completes so tests are directly in
control of when they're done. This fixes an long standing bug where when
we flipped the forceAsync flag to true, we got results coming in when we
thought the test had completed, which was because function wrapped in
checkCalled could be called several times.

Tests that wish to complete asynchronously will now need to return a
promise rather than call checkCalled. For most tests this is an easy
job of doing "return helpers.audit([…]);" rather than just calling
"helpers.audit".

The Firefox test integration will need an update, but we're saving that
until later.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
asynctypes-685526: Fix failing util.synchronize

ParameterType is never required to be synchronous, so we don't need to
pretend it is in testing.
Type.stringify is defined as being synchronous, so types just need to
find a way to make it so. In the case of selection, we add
object.toString as a fail-safe in case getLookup can't be done in a
synchronous way.

Signed-off-by: Joe Walker <jwalker@mozilla.com>