aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMathieu Othacehe <othacehe@gnu.org>2020-10-14 16:28:59 +0200
committerMathieu Othacehe <othacehe@gnu.org>2020-10-14 16:28:59 +0200
commit38ee2c5b5b21404f383fc5066af8141785676e56 (patch)
tree623432d977a432ece3adb812180b098b973d65a5 /src
parent65e3624bf8356e3a42297a118814b7e4c6d9783c (diff)
downloadcuirass-38ee2c5b5b21404f383fc5066af8141785676e56.tar
cuirass-38ee2c5b5b21404f383fc5066af8141785676e56.tar.gz
Fix tests.
This is a follow-up of b67f38a7b91c8605a3ae9eba1e2bd3da4b579622. * src/cuirass/database.scm (catch-sqlite-error): New macro. (SQLITE_CONSTRAINT_PRIMARYKEY, SQLITE_CONSTRAINT_UNIQUE, %db-writer-channel): New variables. * tests/database.scm (with-temporary-database): Set "%db-writer-channel". (db-add-build-with-fixed-output): Catch sqlite error. (db-get-pending-derivations): Do not add builds with duplicated outputs.
Diffstat (limited to 'src')
-rw-r--r--src/cuirass/database.scm5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cuirass/database.scm b/src/cuirass/database.scm
index 5706a80..c566b50 100644
--- a/src/cuirass/database.scm
+++ b/src/cuirass/database.scm
@@ -85,10 +85,15 @@
read-quoted-string
%sqlite-exec
sqlite-exec
+ catch-sqlite-error
+ ;; Constants.
+ SQLITE_CONSTRAINT_PRIMARYKEY
+ SQLITE_CONSTRAINT_UNIQUE
;; Parameters.
%package-database
%package-schema-file
%db-channel
+ %db-writer-channel
%record-events?
;; Macros.
with-db-worker-thread