build: Put webpacked unit tests into ./qunit/

This separates the bits which we want to install from the generated
QUnit tests, which should stay in the build tree. This will become
relevant once we drop Makefile.deps and its WEBPACK_INSTALL variable.
This commit is contained in:
Martin Pitt 2023-03-19 07:33:09 +01:00 committed by Martin Pitt
parent e21739eb57
commit 18576f7d18
4 changed files with 6 additions and 3 deletions

1
.gitignore vendored
View file

@ -53,6 +53,7 @@ Makefile.in
/lcov/
/mock-*
/package-lock.json
/qunit/
/socket-activation-helper
/stamp-h1
/tags

View file

@ -1,2 +1,2 @@
# We need to avoid automake seeing this, but want it evaluated at runtime
TESTS += $(wildcard $(srcdir)/dist/*/test-*.html)
TESTS += $(wildcard $(srcdir)/qunit/*/test-*.html)

View file

@ -722,6 +722,8 @@ server_ready (void)
G_CALLBACK (on_handle_resource), NULL);
g_signal_connect (server, "handle-resource::/dist/",
G_CALLBACK (on_handle_source), NULL);
g_signal_connect (server, "handle-resource::/qunit/",
G_CALLBACK (on_handle_source), NULL);
g_signal_connect (server, "handle-resource::/favicon.ico",
G_CALLBACK (on_handle_favicon), NULL);
g_signal_connect (server, "handle-resource::/mock/",

View file

@ -253,10 +253,10 @@ if (section.startsWith('static'))
/* Fill in the tests properly */
info.tests.forEach(test => {
if (!section || test.indexOf(section) === 0) {
entry[test] = pkgfile(test + ".js");
entry['../qunit/' + test] = pkgfile(test + ".js");
plugins.push(new Html({
title: path.basename(test),
filename: test + ".html",
filename: '../qunit/' + test + ".html",
template: libdir + path.sep + "qunit-template.html",
builddir: test.split("/").map(() => "../").join(""),
script: path.basename(test + '.js'),