sqlite3-test: First whack at running sqlite3 tests from pkgsrc.
authorTaylor R Campbell <riastradh@NetBSD.org>
Wed, 2 Apr 2025 02:39:26 +0000 (02:39 +0000)
committerTaylor R Campbell <riastradh@NetBSD.org>
Wed, 2 Apr 2025 02:40:11 +0000 (02:40 +0000)
Doesn't quite work yet: it doesn't test the sqlite3 that we built in
pkgsrc; it builds its own.

PR pkg/59243: databases/sqlite3: missing test target

Makefile
sqlite3-test/COMMIT_MSG [new file with mode: 0644]
sqlite3-test/DESCR [new file with mode: 0644]
sqlite3-test/Makefile [new file with mode: 0644]
sqlite3-test/distinfo [new file with mode: 0644]
sqlite3-test/patches/patch-test_testrunner.tcl [new file with mode: 0644]

index 30a37016554743d71d77880e5c085884f913bfa5..3fefb5c520613e2a3cb7b0411c4a26cbf92e85c9 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -5413,6 +5413,7 @@ SUBDIR+=  spread4
 SUBDIR+=       spyder
 SUBDIR+=       sq
 SUBDIR+=       sqlc
+SUBDIR+=       sqlite3-test
 SUBDIR+=       sqlitewrite
 SUBDIR+=       sqlux
 SUBDIR+=       squeak3
diff --git a/sqlite3-test/COMMIT_MSG b/sqlite3-test/COMMIT_MSG
new file mode 100644 (file)
index 0000000..418963a
--- /dev/null
@@ -0,0 +1,10 @@
+sqlite3-test: New package for running sqlite3 automatic tests.
+
+This is a separate package because the sqlite3 autoconf distribution
+doesn't have any automatic tests itself.
+
+XXX This doesn't actually test the sqlite3 that was built and installed
+for pkgsrc -- it builds several of its own sqlite3 binaries, under
+different build configurations, and tests those instead.  To be fixed.
+
+PR pkg/59243: databases/sqlite3: missing test target
diff --git a/sqlite3-test/DESCR b/sqlite3-test/DESCR
new file mode 100644 (file)
index 0000000..40cd590
--- /dev/null
@@ -0,0 +1 @@
+Package for running sqlite3 automatic tests.
diff --git a/sqlite3-test/Makefile b/sqlite3-test/Makefile
new file mode 100644 (file)
index 0000000..8ac6633
--- /dev/null
@@ -0,0 +1,32 @@
+#      $NetBSD$
+
+.include "../../databases/sqlite3/Makefile.common"
+
+DISTNAME=      sqlite-src-${SQLITE3_DISTVERSION}
+PKGNAME=       sqlite3-test-${SQLITE3_VERSION}
+CATEGORIES=    databases
+EXTRACT_SUFX=  .zip
+
+MAINTAINER=    pkgsrc-users@NetBSD.org
+COMMENT=       Package for running sqlite3 automatic tests
+
+RESTRICTED=            Just for test build purposes
+NO_BIN_ON_CDROM=       ${RESTRICTED}
+NO_BIN_ON_FTP=         ${RESTRICTED}
+
+NO_CONFIGURE=  yes
+NO_BUILD=      yes
+PLIST_SRC=     # none
+CHECK_PERMS=   no
+
+USE_LANGUAGES+=        c
+
+do-test:
+       ${RUN}cd ${WRKSRC} && \
+       ${SETENV} ${TEST_ENV} ${TCLSH} ${WRKSRC}/test/testrunner.tcl mdevtest \
+               --jobs ${MAKE_JOBS:U1}
+
+BUILDLINK_API_DEPENDS.sqlite3+=        sqlite3-${SQLITE3_VERSION}{,nb*}
+.include "../../databases/sqlite3/buildlink3.mk"
+.include "../../lang/tcl/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/sqlite3-test/distinfo b/sqlite3-test/distinfo
new file mode 100644 (file)
index 0000000..35b8820
--- /dev/null
@@ -0,0 +1,6 @@
+$NetBSD$
+
+BLAKE2s (sqlite-src-3490100.zip) = 9eec3fef2bbe6fa0c550303b537e277e93ee345adbf97164dd5b0b3d616a376f
+SHA512 (sqlite-src-3490100.zip) = 24c81cee52e5655f4e9d6496a366e4787352b5108ea27eb5ce3dc07ef3e1975205bb250584b0758fb2832add84ca922b09a4d925e0dc2f55dd3613a58b414ec3
+Size (sqlite-src-3490100.zip) = 14372402 bytes
+SHA1 (patch-test_testrunner.tcl) = 485ee6c69b489bc9405159e3319abe57095c6bc9
diff --git a/sqlite3-test/patches/patch-test_testrunner.tcl b/sqlite3-test/patches/patch-test_testrunner.tcl
new file mode 100644 (file)
index 0000000..5f28b18
--- /dev/null
@@ -0,0 +1,22 @@
+$NetBSD$
+
+Add NetBSD support.
+
+--- test/testrunner.tcl.orig   2025-02-18 14:09:33.000000000 +0000
++++ test/testrunner.tcl
+@@ -246,6 +246,15 @@ switch -nocase -glob -- $tcl_platform(os
+     set TRG(run)         run.sh
+     set TRG(runcmd)      "bash run.sh"
+   }
++  *netbsd* {
++    set TRG(platform)    linux
++    set TRG(make)        make.sh
++    set TRG(makecmd)     "sh make.sh"
++    set TRG(testfixture) testfixture
++    set TRG(shell)       sqlite3
++    set TRG(run)         run.sh
++    set TRG(runcmd)      "sh run.sh"
++  }
+   *openbsd* {
+     set TRG(platform)    linux
+     set TRG(make)        make.sh