]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
buildtools-docs-tarball: Add test for building documentation using sphinx
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 16 Mar 2022 19:58:57 +0000 (19:58 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 18 Mar 2022 23:27:20 +0000 (23:27 +0000)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/sdk/buildtools-docs-cases/README [new file with mode: 0644]
meta/lib/oeqa/sdk/buildtools-docs-cases/build.py [new file with mode: 0644]
meta/recipes-core/meta/buildtools-docs-tarball.bb
meta/recipes-core/meta/buildtools-tarball.bb

diff --git a/meta/lib/oeqa/sdk/buildtools-docs-cases/README b/meta/lib/oeqa/sdk/buildtools-docs-cases/README
new file mode 100644 (file)
index 0000000..f8edbc7
--- /dev/null
@@ -0,0 +1,2 @@
+These test cases are used by build-docs-tarball, and are not used by the testsdk
+class.
diff --git a/meta/lib/oeqa/sdk/buildtools-docs-cases/build.py b/meta/lib/oeqa/sdk/buildtools-docs-cases/build.py
new file mode 100644 (file)
index 0000000..5b0eca0
--- /dev/null
@@ -0,0 +1,17 @@
+#
+# SPDX-License-Identifier: MIT
+#
+
+import tempfile
+from oeqa.sdk.case import OESDKTestCase
+from oeqa.utils.subprocesstweak import errors_have_output
+errors_have_output()
+
+class BuildTests(OESDKTestCase):
+    """
+    Verify that our docs can build using our docs tools tarball.
+    """
+    def test_docs_build(self):
+        with tempfile.TemporaryDirectory(prefix='docs-tarball-build-', dir=self.tc.sdk_dir) as testdir:
+            self._run('git clone git://git.yoctoproject.org/yocto-docs %s' % testdir)
+            self._run('cd %s/documentation && make html' % testdir)
index 72a256cf04a4f351112274c23da94e657e4067fd..72648e3b1cd0545e9f31c2ab7bad9feb5a283aa2 100644 (file)
@@ -13,4 +13,6 @@ TOOLCHAIN_HOST_TASK += "\
 
 TOOLCHAIN_OUTPUTNAME = "${SDK_ARCH}-buildtools-docs-nativesdk-standalone-${DISTRO_VERSION}"
 
-SDK_TITLE = "Docs Build tools tarball"
\ No newline at end of file
+SDK_TITLE = "Docs Build tools tarball"
+
+TESTSDK_CASES = "buildtools-docs-cases"
index 60f6aac837a261692372aa6f55397fd53b111fb9..fac91cfc3cfe58183dcaa396e32bceb5d5312bfe 100644 (file)
@@ -99,11 +99,14 @@ TOOLCHAIN_NEED_CONFIGSITE_CACHE = ""
 # The recipe doesn't need any default deps
 INHIBIT_DEFAULT_DEPS = "1"
 
+# Directory in testsdk that contains testcases
+TESTSDK_CASES = "buildtools-cases"
+
 python do_testsdk() {
     import oeqa.sdk.testsdk
     testsdk = oeqa.sdk.testsdk.TestSDK()
 
-    cases_path = os.path.join(os.path.abspath(os.path.dirname(oeqa.sdk.testsdk.__file__)), "buildtools-cases")
+    cases_path = os.path.join(os.path.abspath(os.path.dirname(oeqa.sdk.testsdk.__file__)), d.getVar("TESTSDK_CASES"))
     testsdk.context_executor_class.default_cases = cases_path
 
     testsdk.run(d)