git » audacity.git » commit 517b368

properly run the tests for audacity

author Christian Heusel
2024-01-16 15:49:20 UTC
committer Christian Heusel
2024-01-16 15:49:20 UTC
parent 66bf9779bd5253cfd1a91ce8dc15d3cf89ce1f83

properly run the tests for audacity

fixes  https://gitlab.archlinux.org/archlinux/packaging/packages/audacity/-/issues/2

PKGBUILD +11 -3
audacity_3_4_2_enable_tests_without_conan.patch +24 -0

diff --git a/PKGBUILD b/PKGBUILD
index 8267853..b5ea8df 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -19,6 +19,7 @@ makedepends=(
   alsa-lib
   chrpath
   cmake
+  catch2-v2
   ffmpeg
   flac
   gcc-libs
@@ -62,17 +63,22 @@ source=(
   https://github.com/audacity/audacity/archive/refs/tags/$_name-$pkgver.tar.gz
   https://github.com/$pkgbase/$pkgbase/releases/download/$_name-$pkgver/$pkgbase-manual-$pkgver.zip
   audacity_3_4_2_update_vst3_cmake_args.patch
+  audacity_3_4_2_enable_tests_without_conan.patch
 )
 sha512sums=('a4a3bc68e46988e5538edbe6d8f42428b69e3f294b8d65337600e6806b516100d20a92135954f073c863d29767b904b781bd3a09cec40b8a85ee4463f52e1759'
             'a840409a98ba570113e445264feac22555585c9a6e64191a3d90d693f55325d9bf0a028869828f0ad3074e451087563ef47064d2774348184fe62bbd88dfde5f'
-            '075ab510b28ce96be049bc62d11d4f978090268376e76865fc41424d2f76ec79f9625ab5479aee488bf357c773346fefd2e0cc3884acb5ba14083c4e79276e35')
+            '075ab510b28ce96be049bc62d11d4f978090268376e76865fc41424d2f76ec79f9625ab5479aee488bf357c773346fefd2e0cc3884acb5ba14083c4e79276e35'
+            'ab92475e599fd4345d33a7ae6cd47231ab614b92ca9a71e732a073b31ec18ad92f3d1384183b0821e75b4ba1bb4987c5369c1398604d6c4ea01a20f94fb7b976')
 b2sums=('f5bcf6adb925c22b74d6bb1f9605e428f00d776715dd221ae2e2026ffe65a03410279f01690c9b671df9a4924940e5a93dc3535b6a41626663ccdda5ccf7554f'
         '3b49bd9ac0ceb8ee36ac8506fbec159ad6ed884ed1a1b5619a7f309c951400699fd92e1e79771bd5ca23055e2b6d24138007e613eddd8cc97ed4b443da4b5f6d'
-        'c3da5f1c01f712053ada2101d489dfab0dcd2a6cafa65a29c17de12274a4373d2e63de65888b1ffaccac85b64508f260596beb301d36d7e305002cd3a76eb679')
+        'c3da5f1c01f712053ada2101d489dfab0dcd2a6cafa65a29c17de12274a4373d2e63de65888b1ffaccac85b64508f260596beb301d36d7e305002cd3a76eb679'
+        '0c176336ca8df12f443e6935e8293afa3408e0e7b6a290417007bbbc0500c8eb8716ae3265665a80d85d689f9b369e5edf7986e8507288af77e8eea4ebedd624')
 
 prepare() {
     cd "$pkgname-$_name-$pkgver"
     patch --forward --strip=1 --input="${srcdir}/audacity_3_4_2_update_vst3_cmake_args.patch"
+    # https://github.com/audacity/audacity/discussions/5841#discussioncomment-8138725
+    patch --forward --strip=1 --input="${srcdir}/audacity_3_4_2_enable_tests_without_conan.patch"
 }
 
 build() {
@@ -89,6 +95,7 @@ build() {
     -D audacity_lib_preference=system
     -D audacity_obey_system_dependencies=ON
     -D audacity_use_vst3sdk=system
+    -D audacity_has_tests=ON
     -S $pkgname-$_name-$pkgver
     -W no-dev
   )
@@ -101,7 +108,8 @@ build() {
 }
 
 check() {
-  ctest --test-dir build --output-on-failure
+  # disable two tests which do not work without an alsa/jack instance
+  ctest --test-dir build --output-on-failure --exclude-regex "lib-stretching-sequence|journal_sanity"
 }
 
 package_audacity() {
diff --git a/audacity_3_4_2_enable_tests_without_conan.patch b/audacity_3_4_2_enable_tests_without_conan.patch
new file mode 100644
index 0000000..ab97af2
--- /dev/null
+++ b/audacity_3_4_2_enable_tests_without_conan.patch
@@ -0,0 +1,24 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index e631e18ad..02e05b147 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -222,15 +222,12 @@ cmd_option( ${_OPT}has_url_schemes_support
+    "Build custom URL schemes support into Audacity"
+    Off)
+ 
+-include( CMakeDependentOption )
+-
+-cmake_dependent_option(
++cmd_option(
+    ${_OPT}has_tests
+    "Enables automated testing support"
+-   On
+-   "${_OPT}conan_enabled"
+-   Off
+-)
++   On)
++
++include( CMakeDependentOption )
+ 
+ cmake_dependent_option(
+    ${_OPT}has_audiocom_upload