From 4666142ca57c15ef89759fb22511ab4c1b96ece9 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Sat, 1 Jul 2017 18:52:20 +0200 Subject: repo: Remove dead code. * Makefile.am (dist_pkgmodule_DATA): Remove repo.scm, (TESTS): Remove repo.scm. * build-aux/guix.scm (package)[disable-repo-tests]: Remove phase. * src/cuirass/repo.scm: Remove. * tests/repo.scm: Remove. --- tests/repo.scm | 81 ---------------------------------------------------------- 1 file changed, 81 deletions(-) delete mode 100644 tests/repo.scm (limited to 'tests') diff --git a/tests/repo.scm b/tests/repo.scm deleted file mode 100644 index 8890c0a..0000000 --- a/tests/repo.scm +++ /dev/null @@ -1,81 +0,0 @@ -;;;; repo.scm -- tests for (cuirass repo) module -;;; Copyright © 2016 Mathieu Lirzin -;;; -;;; This file is part of Cuirass. -;;; -;;; Cuirass is free software: you can redistribute it and/or modify -;;; it under the terms of the GNU General Public License as published by -;;; the Free Software Foundation, either version 3 of the License, or -;;; (at your option) any later version. -;;; -;;; Cuirass is distributed in the hope that it will be useful, -;;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with Cuirass. If not, see . - -(use-modules (cuirass repo) - (cuirass utils) - (guix store) - (srfi srfi-64)) - -(test-begin "repo") - -(test-equal " datatype" - ;; Check that all the procedures for manipulating objects are - ;; exported and that the keywords of the constructor matches their slot. - '(1 2 3 4 5 6) - (let ((obj (repo #:id 1 #:url 2 #:location 3 #:ref 4 - #:snapshoter 5 #:updater 6))) - (and (repo? obj) - (list (repo-id obj) - (repo-url obj) - (repo-location obj) - (repo-reference obj) - (repo-snapshoter obj) - (repo-updater obj))))) - -(define file-name - (pk (simple-format #f "tmp-~S" (getpid)))) - -(define store - (open-connection)) - -(define (create-file name) - "Create a dummy file in current directory." - (with-output-to-file name - (λ () (display "test!\n")))) - -(define (in-store? file-name) - "Check if FILE-NAME is in the store. FILE-NAME must be an absolute file -name." - (string-prefix? "/gnu/store" file-name)) - -;;; -;;; File repository. -;;; - -(test-group-with-cleanup "file-repo" - (define rpt (pk (file-repo file-name))) - - ;; Since file doesn't exist yet, 'repo-update' should throw an error. - (test-error "file-repo-update: file not found" - 'system-error - (repo-update rpt)) - - (create-file file-name) - - (test-assert "file-repo-update" - (repo-update rpt)) - - (test-assert "file-repo-snapshot" - (in-store? (repo-snapshot rpt store))) - - ;; Cleanup. - (delete-file file-name)) - -(close-connection store) - -(test-end) -- cgit v1.2.3