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>
This way we can integrate test results from multiple sources.
After the tests have run, you'll see a summary of how many tests
were run. Details of the failed tests are available in
$(builddir)/testsuite.log.
Using TAP with automake requires a special test driver. Instead
of using the inflexible one that comes with automake, we define
our own. It's very important to see stderr failures in our
build logs and CI.
Since we can't depend on the TAP support in glib versions later
than 2.38.x this commit also includes a test output compiler
that converts GTest output to TAP.
Fixes#210
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
We don't use AM_INIT_AUTOMAKE "subdir-objects" option so ./src
does not exist as a subdirectory in builddir when doing out of
tree builds.
This fixes the warning:
cc1: warning: ./src: No such file or directory [enabled by default]