%%%% Starting test lint Group begin: lint Test begin: test-name: "description: not empty" source-file: "tests/lint.scm" source-line: 141 source-form: (test-assert "description: not empty" (->bool (string-contains (with-warnings (let ((pkg (dummy-package "x" (description "")))) (check-description-style pkg))) "description should not be empty"))) Test end: result-kind: pass actual-value: #t Test begin: test-name: "description: valid Texinfo markup" source-file: "tests/lint.scm" source-line: 149 source-form: (test-assert "description: valid Texinfo markup" (->bool (string-contains (with-warnings (check-description-style (dummy-package "x" (description "f{oo}b@r")))) "Texinfo markup in description is invalid"))) Test end: result-kind: pass actual-value: #t Test begin: test-name: "description: does not start with an upper-case letter" source-file: "tests/lint.scm" source-line: 156 source-form: (test-assert "description: does not start with an upper-case letter" (->bool (string-contains (with-warnings (let ((pkg (dummy-package "x" (description "bad description.")))) (check-description-style pkg))) "description should start with an upper-case letter"))) Test end: result-kind: pass actual-value: #t Test begin: test-name: "description: may start with a digit" source-file: "tests/lint.scm" source-line: 164 source-form: (test-assert "description: may start with a digit" (string-null? (with-warnings (let ((pkg (dummy-package "x" (description "2-component library.")))) (check-description-style pkg))))) Test end: result-kind: pass actual-value: #t Test begin: test-name: "description: may start with lower-case package name" source-file: "tests/lint.scm" source-line: 171 source-form: (test-assert "description: may start with lower-case package name" (string-null? (with-warnings (let ((pkg (dummy-package "x" (description "x is a dummy package.")))) (check-description-style pkg))))) Test end: result-kind: pass actual-value: #t Test begin: test-name: "description: two spaces after end of sentence" source-file: "tests/lint.scm" source-line: 178 source-form: (test-assert "description: two spaces after end of sentence" (->bool (string-contains (with-warnings (let ((pkg (dummy-package "x" (description "Bad. Quite bad.")))) (check-description-style pkg))) "sentences in description should be followed by two spaces"))) Test end: result-kind: pass actual-value: #t Test begin: test-name: "description: end-of-sentence detection with abbreviations" source-file: "tests/lint.scm" source-line: 186 source-form: (test-assert "description: end-of-sentence detection with abbreviations" (string-null? (with-warnings (let ((pkg (dummy-package "x" (description "E.g. Foo, i.e. Bar resp. Baz (a.k.a. DVD).")))) (check-description-style pkg))))) Test end: result-kind: pass actual-value: #t Test begin: test-name: "synopsis: not empty" source-file: "tests/lint.scm" source-line: 194 source-form: (test-assert "synopsis: not empty" (->bool (string-contains (with-warnings (let ((pkg (dummy-package "x" (synopsis "")))) (check-synopsis-style pkg))) "synopsis should not be empty"))) Test end: result-kind: pass actual-value: #t Test begin: test-name: "synopsis: does not start with an upper-case letter" source-file: "tests/lint.scm" source-line: 202 source-form: (test-assert "synopsis: does not start with an upper-case letter" (->bool (string-contains (with-warnings (let ((pkg (dummy-package "x" (synopsis "bad synopsis.")))) (check-synopsis-style pkg))) "synopsis should start with an upper-case letter"))) Test end: result-kind: pass actual-value: #t Test begin: test-name: "synopsis: may start with a digit" source-file: "tests/lint.scm" source-line: 210 source-form: (test-assert "synopsis: may start with a digit" (string-null? (with-warnings (let ((pkg (dummy-package "x" (synopsis "5-dimensional frobnicator")))) (check-synopsis-style pkg))))) Test end: result-kind: pass actual-value: #t Test begin: test-name: "synopsis: ends with a period" source-file: "tests/lint.scm" source-line: 217 source-form: (test-assert "synopsis: ends with a period" (->bool (string-contains (with-warnings (let ((pkg (dummy-package "x" (synopsis "Bad synopsis.")))) (check-synopsis-style pkg))) "no period allowed at the end of the synopsis"))) Test end: result-kind: pass actual-value: #t Test begin: test-name: "synopsis: ends with 'etc.'" source-file: "tests/lint.scm" source-line: 225 source-form: (test-assert "synopsis: ends with 'etc.'" (string-null? (with-warnings (let ((pkg (dummy-package "x" (synopsis "Foo, bar, etc.")))) (check-synopsis-style pkg))))) Test end: result-kind: pass actual-value: #t Test begin: test-name: "synopsis: starts with 'A'" source-file: "tests/lint.scm" source-line: 231 source-form: (test-assert "synopsis: starts with 'A'" (->bool (string-contains (with-warnings (let ((pkg (dummy-package "x" (synopsis "A bad synop\u015dis")))) (check-synopsis-style pkg))) "no article allowed at the beginning of the synopsis"))) Test end: result-kind: pass actual-value: #t Test begin: test-name: "synopsis: starts with 'An'" source-file: "tests/lint.scm" source-line: 239 source-form: (test-assert "synopsis: starts with 'An'" (->bool (string-contains (with-warnings (let ((pkg (dummy-package "x" (synopsis "An awful synopsis")))) (check-synopsis-style pkg))) "no article allowed at the beginning of the synopsis"))) Test end: result-kind: pass actual-value: #t Test begin: test-name: "synopsis: starts with 'a'" source-file: "tests/lint.scm" source-line: 247 source-form: (test-assert "synopsis: starts with 'a'" (->bool (string-contains (with-warnings (let ((pkg (dummy-package "x" (synopsis "a bad synopsis")))) (check-synopsis-style pkg))) "no article allowed at the beginning of the synopsis"))) Test end: result-kind: pass actual-value: #t Test begin: test-name: "synopsis: starts with 'an'" source-file: "tests/lint.scm" source-line: 255 source-form: (test-assert "synopsis: starts with 'an'" (->bool (string-contains (with-warnings (let ((pkg (dummy-package "x" (synopsis "an awful synopsis")))) (check-synopsis-style pkg))) "no article allowed at the beginning of the synopsis"))) Test end: result-kind: pass actual-value: #t Test begin: test-name: "synopsis: too long" source-file: "tests/lint.scm" source-line: 263 source-form: (test-assert "synopsis: too long" (->bool (string-contains (with-warnings (let ((pkg (dummy-package "x" (synopsis (make-string 80 #\x))))) (check-synopsis-style pkg))) "synopsis should be less than 80 characters long"))) Test end: result-kind: pass actual-value: #t Test begin: test-name: "synopsis: start with package name" source-file: "tests/lint.scm" source-line: 271 source-form: (test-assert "synopsis: start with package name" (->bool (string-contains (with-warnings (let ((pkg (dummy-package "x" (name "foo") (synopsis "foo, a nice package")))) (check-synopsis-style pkg))) "synopsis should not start with the package name"))) Test end: result-kind: pass actual-value: #t Test begin: test-name: "synopsis: start with package name prefix" source-file: "tests/lint.scm" source-line: 280 source-form: (test-assert "synopsis: start with package name prefix" (string-null? (with-warnings (let ((pkg (dummy-package "arb" (synopsis "Arbitrary precision")))) (check-synopsis-style pkg))))) Test end: result-kind: pass actual-value: #t Test begin: test-name: "synopsis: start with abbreviation" source-file: "tests/lint.scm" source-line: 287 source-form: (test-assert "synopsis: start with abbreviation" (string-null? (with-warnings (let ((pkg (dummy-package "uucp" (synopsis "UUCP implementation") (description "Imagine this is Taylor UUCP.")))) (check-synopsis-style pkg))))) Test end: result-kind: pass actual-value: #t Test begin: test-name: "inputs: pkg-config is probably a native input" source-file: "tests/lint.scm" source-line: 296 source-form: (test-assert "inputs: pkg-config is probably a native input" (->bool (string-contains (with-warnings (let ((pkg (dummy-package "x" (inputs (quasiquote (("pkg-config" (unquote pkg-config)))))))) (check-inputs-should-be-native pkg))) "pkg-config should probably be a native input"))) Test end: result-kind: pass actual-value: #t Test begin: test-name: "patches: file names" source-file: "tests/lint.scm" source-line: 305 source-form: (test-assert "patches: file names" (->bool (string-contains (with-warnings (let ((pkg (dummy-package "x" (source (origin (method url-fetch) (uri "someurl") (sha256 "somesha") (patches (list "/path/to/y.patch"))))))) (check-patch-file-names pkg))) "file names of patches should start with the package name"))) Test end: result-kind: pass actual-value: #t Test begin: test-name: "patches: not found" source-file: "tests/lint.scm" source-line: 319 source-form: (test-assert "patches: not found" (->bool (string-contains (with-warnings (let ((pkg (dummy-package "x" (source (origin (method url-fetch) (uri "someurl") (sha256 "somesha") (patches (list (search-patch "this-patch-does-not-exist!")))))))) (check-patch-file-names pkg))) "patch not found"))) Test end: result-kind: pass actual-value: #t Test begin: test-name: "derivation: invalid arguments" source-file: "tests/lint.scm" source-line: 334 source-form: (test-assert "derivation: invalid arguments" (->bool (string-contains (with-warnings (let ((pkg (dummy-package "x" (arguments (quote (#:imported-modules (invalid-module))))))) (check-derivation pkg))) "failed to create derivation"))) Test end: result-kind: pass actual-value: #t Test begin: test-name: "license: invalid license" source-file: "tests/lint.scm" source-line: 344 source-form: (test-assert "license: invalid license" (string-contains (with-warnings (check-license (dummy-package "x" (license #f)))) "invalid license")) Test end: result-kind: pass actual-value: 28 Test begin: test-name: "home-page: wrong home-page" source-file: "tests/lint.scm" source-line: 350 source-form: (test-assert "home-page: wrong home-page" (->bool (string-contains (with-warnings (let ((pkg (package (inherit (dummy-package "x")) (home-page #f)))) (check-home-page pkg))) "invalid"))) Test end: result-kind: pass actual-value: #t Test begin: test-name: "home-page: invalid URI" source-file: "tests/lint.scm" source-line: 360 source-form: (test-assert "home-page: invalid URI" (->bool (string-contains (with-warnings (let ((pkg (package (inherit (dummy-package "x")) (home-page "foobar")))) (check-home-page pkg))) "invalid home page URL"))) Test end: result-kind: pass actual-value: #t Test begin: test-name: "home-page: host not found" source-file: "tests/lint.scm" source-line: 370 source-form: (test-assert "home-page: host not found" (->bool (string-contains (with-warnings (let ((pkg (package (inherit (dummy-package "x")) (home-page "http://does-not-exist")))) (check-home-page pkg))) "domain not found"))) Test end: result-kind: fail actual-value: #f Test begin: test-name: "home-page: Connection refused" source-file: "tests/lint.scm" source-line: 381 source-form: (test-assert "home-page: Connection refused" (->bool (string-contains (with-warnings (let ((pkg (package (inherit (dummy-package "x")) (home-page %local-url)))) (check-home-page pkg))) "Connection refused"))) Test end: result-kind: pass actual-value: #t Test begin: test-name: "home-page: 200" source-file: "tests/lint.scm" source-line: 392 source-form: (test-equal "home-page: 200" "" (with-warnings (with-http-server 200 (let ((pkg (package (inherit (dummy-package "x")) (home-page %local-url)))) (check-home-page pkg))))) Test end: result-kind: pass actual-value: "" expected-value: "" Test begin: test-name: "home-page: 404" source-file: "tests/lint.scm" source-line: 402 source-form: (test-assert "home-page: 404" (->bool (string-contains (with-warnings (with-http-server 404 (let ((pkg (package (inherit (dummy-package "x")) (home-page %local-url)))) (check-home-page pkg)))) "not reachable: 404"))) Test end: result-kind: pass actual-value: #t Test begin: test-name: "source-file-name" source-file: "tests/lint.scm" source-line: 413 source-form: (test-assert "source-file-name" (->bool (string-contains (with-warnings (let ((pkg (dummy-package "x" (version "3.2.1") (source (origin (method url-fetch) (uri "http://www.example.com/3.2.1.tar.gz") (sha256 %null-sha256)))))) (check-source-file-name pkg))) "file name should contain the package name"))) Test end: result-kind: pass actual-value: #t Test begin: test-name: "source-file-name: v prefix" source-file: "tests/lint.scm" source-line: 427 source-form: (test-assert "source-file-name: v prefix" (->bool (string-contains (with-warnings (let ((pkg (dummy-package "x" (version "3.2.1") (source (origin (method url-fetch) (uri "http://www.example.com/v3.2.1.tar.gz") (sha256 %null-sha256)))))) (check-source-file-name pkg))) "file name should contain the package name"))) Test end: result-kind: pass actual-value: #t Test begin: test-name: "source-file-name: bad checkout" source-file: "tests/lint.scm" source-line: 441 source-form: (test-assert "source-file-name: bad checkout" (->bool (string-contains (with-warnings (let ((pkg (dummy-package "x" (version "3.2.1") (source (origin (method git-fetch) (uri (git-reference (url "http://www.example.com/x.git") (commit "0"))) (sha256 %null-sha256)))))) (check-source-file-name pkg))) "file name should contain the package name"))) Test end: result-kind: pass actual-value: #t Test begin: test-name: "source-file-name: good checkout" source-file: "tests/lint.scm" source-line: 457 source-form: (test-assert "source-file-name: good checkout" (not (->bool (string-contains (with-warnings (let ((pkg (dummy-package "x" (version "3.2.1") (source (origin (method git-fetch) (uri (git-reference (url "http://git.example.com/x.git") (commit "0"))) (file-name (string-append "x-" version)) (sha256 %null-sha256)))))) (check-source-file-name pkg))) "file name should contain the package name")))) Test end: result-kind: pass actual-value: #t Test begin: test-name: "source-file-name: valid" source-file: "tests/lint.scm" source-line: 475 source-form: (test-assert "source-file-name: valid" (not (->bool (string-contains (with-warnings (let ((pkg (dummy-package "x" (version "3.2.1") (source (origin (method url-fetch) (uri "http://www.example.com/x-3.2.1.tar.gz") (sha256 %null-sha256)))))) (check-source-file-name pkg))) "file name should contain the package name")))) Test end: result-kind: pass actual-value: #t Test begin: test-name: "source: 200" source-file: "tests/lint.scm" source-line: 491 source-form: (test-equal "source: 200" "" (with-warnings (with-http-server 200 (let ((pkg (package (inherit (dummy-package "x")) (source (origin (method url-fetch) (uri %local-url) (sha256 %null-sha256)))))) (check-source pkg))))) Test end: result-kind: pass actual-value: "" expected-value: "" Test begin: test-name: "source: 404" source-file: "tests/lint.scm" source-line: 504 source-form: (test-assert "source: 404" (->bool (string-contains (with-warnings (with-http-server 404 (let ((pkg (package (inherit (dummy-package "x")) (source (origin (method url-fetch) (uri %local-url) (sha256 %null-sha256)))))) (check-source pkg)))) "not reachable: 404"))) Test end: result-kind: pass actual-value: #t Test begin: test-name: "cve" source-file: "tests/lint.scm" source-line: 518 source-form: (test-assert "cve" (mock ((guix scripts lint) package-vulnerabilities (const (quote ()))) (string-null? (with-warnings (check-vulnerabilities (dummy-package "x")))))) Test end: result-kind: pass actual-value: #t Test begin: test-name: "cve: one vulnerability" source-file: "tests/lint.scm" source-line: 523 source-form: (test-assert "cve: one vulnerability" (mock ((guix scripts lint) package-vulnerabilities (lambda (package) (list (make-struct (@@ (guix cve) ) 0 "CVE-2015-1234" (list (cons (package-name package) (package-version package))))))) (string-contains (with-warnings (check-vulnerabilities (dummy-package "pi" (version "3.14")))) "vulnerable to CVE-2015-1234"))) Test end: result-kind: pass actual-value: 41 Test begin: test-name: "cve: one patched vulnerability" source-file: "tests/lint.scm" source-line: 535 source-form: (test-assert "cve: one patched vulnerability" (mock ((guix scripts lint) package-vulnerabilities (lambda (package) (list (make-struct (@@ (guix cve) ) 0 "CVE-2015-1234" (list (cons (package-name package) (package-version package))))))) (string-null? (with-warnings (check-vulnerabilities (dummy-package "pi" (version "3.14") (source (dummy-origin (patches (list "/a/b/pi-CVE-2015-1234.patch")))))))))) Test end: result-kind: pass actual-value: #t Test begin: test-name: "formatting: lonely parentheses" source-file: "tests/lint.scm" source-line: 552 source-form: (test-assert "formatting: lonely parentheses" (string-contains (with-warnings (check-formatting (dummy-package "ugly as hell!"))) "lonely")) Test end: result-kind: pass actual-value: 66 Test begin: test-name: "formatting: tabulation" source-file: "tests/lint.scm" source-line: 562 source-form: (test-assert "formatting: tabulation" (string-contains (with-warnings (check-formatting (dummy-package "leave the tab here:\t"))) "tabulation")) Test end: result-kind: pass actual-value: 47 Test begin: test-name: "formatting: trailing white space" source-file: "tests/lint.scm" source-line: 568 source-form: (test-assert "formatting: trailing white space" (string-contains (with-warnings (check-formatting (dummy-package "x"))) "trailing white space")) Test end: result-kind: pass actual-value: 28 Test begin: test-name: "formatting: long line" source-file: "tests/lint.scm" source-line: 575 source-form: (test-assert "formatting: long line" (string-contains (with-warnings (check-formatting (dummy-package "x"))) "too long")) Test end: result-kind: pass actual-value: 43 Test begin: test-name: "formatting: alright" source-file: "tests/lint.scm" source-line: 583 source-form: (test-assert "formatting: alright" (string-null? (with-warnings (check-formatting (dummy-package "x"))))) Test end: result-kind: pass actual-value: #t Group end: lint # of expected passes 45 # of unexpected failures 1