tests: More fixes for gjs tests
authorColin Walters <walters@verbum.org>
Thu, 20 Jul 2017 14:32:44 +0000 (10:32 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Fri, 21 Jul 2017 15:45:27 +0000 (15:45 +0000)
Previous to this commit, the gjs tests were installed-only; and our
logic for handling the "--enable-installed-tests=exclusive" logic
actually also meant they weren't installed.

It did work for me locally with `--enable-installed-tests`.

However, to make things fully symmetric, let's enable the js tests to also be
run under `make check`.

Also remove `corrupt-repo-ref.js` from the PAPR invocation since it's not
actually a unit test, it's a utility helper.

Closes: #1022
Approved by: jlebon

.papr.yml
Makefile-tests.am
tests/test-core.js [changed mode: 0644->0755]
tests/test-sizes.js [changed mode: 0644->0755]
tests/test-sysroot.js [changed mode: 0644->0755]

index bd4ff47b00e369533a504951dc5d254bbbdf231b..4ec0765c44dff0839a19df81af4ab5c828f59a81 100644 (file)
--- a/.papr.yml
+++ b/.papr.yml
@@ -100,7 +100,7 @@ env:
     CONFIGOPTS: "--with-curl --with-openssl"
     # ASAN conflicts with introspection testing;
     # See https://github.com/ostreedev/ostree/issues/1014
-    INSTALLED_TESTS_PATTERN: "libostree/test-sizes.js libostree/test-sysroot.js libostree/test-core.js libostree/test-corrupt-repo-ref.js"
+    INSTALLED_TESTS_PATTERN: "libostree/test-sizes.js libostree/test-sysroot.js libostree/test-core.js"
 
 tests:
   - ci/build-check.sh
index 7be2ab59f594f3f6ec9b510615a7464f9b0474aa..82ce7209e9a352f63665af899c90e04cb22904fa 100644 (file)
@@ -191,7 +191,7 @@ js_installed_tests = \
        $(NULL)
 
 if BUILDOPT_GJS
-dist_installed_test_scripts = $(js_installed_tests)
+_installed_or_uninstalled_test_scripts += $(js_installed_tests)
 else
 EXTRA_DIST += $(js_installed_tests)
 endif
old mode 100644 (file)
new mode 100755 (executable)
index 64d1b62..8a06b6f
@@ -25,6 +25,8 @@ function assertEquals(a, b) {
        throw new Error("assertion failed " + JSON.stringify(a) + " == " + JSON.stringify(b));
 }
 
+print('1..1')
+
 let testDataDir = Gio.File.new_for_path('test-data');
 testDataDir.make_directory(null);
 testDataDir.get_child('some-file').replace_contents("hello world!", null, false, 0, null);
@@ -66,4 +68,4 @@ repo.commit_transaction(null, null);
 [,readCommit] = repo.resolve_rev('someref', true);
 assertEquals(readCommit, null);
 
-print("test-core complete");
+print("ok test-core");
old mode 100644 (file)
new mode 100755 (executable)
index 5cf765f..71e7651
@@ -26,6 +26,8 @@ function assertEquals(a, b) {
        throw new Error("assertion failed " + JSON.stringify(a) + " == " + JSON.stringify(b));
 }
 
+print('1..1')
+
 let testDataDir = Gio.File.new_for_path('test-data');
 testDataDir.make_directory(null);
 testDataDir.get_child('some-file').replace_contents("hello world!", null, false, 0, null);
@@ -79,4 +81,4 @@ if (expectedUncompressedSizes.length > 0) {
     throw new Error("Failed to match expectedUncompressedSizes: " + JSON.stringify(expectedUncompressedSizes));
 }
 
-print("test-sizes complete");
+print("ok test-sizes");
old mode 100644 (file)
new mode 100755 (executable)
index 7e8fcf7..d7d3dab
@@ -33,11 +33,13 @@ function assertNotEquals(a, b) {
 
 function libtestExec(shellCode) {
     let testdatadir = GLib.getenv("G_TEST_SRCDIR");
-    let libtestPath = GLib.build_filenamev([testdatadir, 'libtest.sh'])
+    let libtestPath = GLib.build_filenamev([testdatadir, 'tests/libtest.sh'])
     let proc = Gio.Subprocess.new(['bash', '-c', 'set -xeuo pipefail; . ' + GLib.shell_quote(libtestPath) + '; ' + shellCode], 0);
     proc.wait_check(null);
 }
 
+print('1..1')
+
 libtestExec('setup_os_repository archive-z2 syslinux');
 
 let upstreamRepo = OSTree.Repo.new(Gio.File.new_for_path('testos-repo'));
@@ -145,3 +147,5 @@ newDeployments = [deployment, newDeployment, thirdDeployment];
 sysroot.write_deployments(newDeployments, null);
 deployments = sysroot.get_deployments();
 assertEquals(deployments.length, 3);
+
+print("ok test-sysroot")