tap-compiler: Don't skip tests if tests crash

We got a 'TAP plan' error if a test would crash or abort without
running all the tests. Account for this in our tap-compiler script.

So here's how this works.

 1. The tap-compiler now runs its test cases with the '--tap -l --verbose'
    arguments. In the case of GTest tests, this causes it to output a list
    of the available test cases. Non-GTest tests (such as test-server) are
    expected to ignore the -l and just start testing, and producing TAP
    output on their own.

 2. If we see that it's a GTest list of test cases, then we rerun the
    test without the -l argument for actual testing. We keep track of
    which tests have run.

 3. If the tests crash half-way, we can run the remaining tests with the
    GTest -p argument, individually each in their own process.

We try to run everything in one process initially for speed, falling back
to slower -p behavior once something errors out.

Reviewd-by: Marius Vollmer <redhat.com>
Closes: #228
configure: We no longer depend on pyscss

This dependency was removed as part of the patternfly migration

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
tools: Move js-lint and minify into the tools directory

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
tap-phantom: Make qunit and phantomjs work well together

QUnit and phantomjs interact poorly. By overriding window.onerror
before QUnit.start(), QUnit catches errors during loading such
as syntax errors. It correctly returns false from its window.onerror
handler, however phantomjs does not act like a browser here. A false
return should normally cause the default behavior, but phantomjs
doesn't do this.

So we unset window.onerror until everything has loaded and the
unit tests have started, at which point we put back the QUnit
window.onerror handler.

Build our own qunit.js, along with qunit-tap, and our own custom
javascript at the end, which comes from qunit-config.js

Move the QUnit settings into qunit-config.js

Add checks for test cases that don't include qunit.js properly or
don't call QUnit.start() at some point. Bail out of testing when
this is the case. This results in a skipped test.

Add a test-dummy.html test case for verifying that this works, and
also as an example of how to write a pure html test, and have it
run by the automake TAP infrastructure.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
tap-missing: Run a dummy TAP compiler when phantomjs is missing

This just produces a 'Bail out!' TAP testing directive.

Check for phantomjs in configure

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
Makefile-tools.am: Simpler tracking of qunit make dependencies

Use a common makefile variable for qunit testing dependencies

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
dbus-test.html: Move closer to dbus.js implementation

Move dbus-test.html closer to dbus.js implementation, and also
place the dbus-test.js stuff right into dbus-test.html to follow
the model of having our QUnit tests in html files directly.

We still can't run this test directly, so it's a bit of an odd case
as it requires test-server to be running. As before we still run this
from the 'test-server --tap' test case.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
test-journal-renderer.html: Migrate journal renderer tests to QUnit

Done a straight forward migration of the journal renderer tests
so they now run within 'make check'.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
doc: Document updated protocol with channels and commands

Note that this changed from earlier iterations. The channel number
is not an MSB integer, but rather a decimal followed by a newline.
This was because binary data cannot be transferred over some older
websocket standards.
ws: Split out mock dbus service into into its own file

I'd like to use it from other tests
ws: Implement a unit test case for dbus-server.c

We want to start testing dbus-server.c directly, so build straightforward
test case for it that doesn't involve running javascript.
ws: Split out transport framing and io into CockpitTransport

An interface called CockpitTransport handles the high level
concept of sending messages to the various hosts/sessions that
we support.

CockpitFdTransport is a concrete implementation of this which
transfers data over file descriptors.

This simplifies CockpitWebsocket significantly, so that we
can expand it to handle multiple hosts/transports/channels
per WebSocket.

Although there's the concept of channels in the CockpitTransport
API, these are not implemented in this commit. All channels must
be set to zero at this point.
websocket: Allow basic message assembly during send

Our use of GBytes allows us to try to avoid excessive copies of large
amounts of payload data. This isn't always implemented, but it's possible
with this API.

One exception is how websocket messages are sent. We want to be able to
prefix messages simply without copying and reassembling the entire
message.

So add a @prefix argument to web_socket_conneciton_send(). The @prefix
and @message arguments are concatenated when sent.

Later CockpitWebsocket commits will take advantage of this capability.
ws: Start passing around channel numbers

We start passing around channel numbers before messages. As noted in
PROTOCOL.md these are decimal digits followed by a newline.
channel.js: Implement cockpit transport code in cockpit-web

This is a new file called cockpit-channel.js the API is documented
in the file itself. The API is purposefully sparse with predictable
behavior to build off of. In particular most of the transport stuff
is hidden in a private class.

Tested in test-channel.html, which runs from 'make check' or
in a web browser.
dbus.js: Include dbus.js in cockpit.js

It will soon depend on channel.js, and we also need to include it in
all the lint goodness. Side effect of this is that it speeds up loading.

dbus.js will no longer be a generic thing, but very cockpit specific
using the channels for transport.

Fix all the various coding lint issues in dbus.js that jsl found.
ws: Add cockpit_transport_parse_command() helper function

This parses a control channel command from JSON into its most important
parts and validates that it's all there as expected.

Added tests for this.
WIP use channels
WIP websocket protocol refactor
WIP basic channels