Skip to content

Commit

Permalink
Add unit test for derivation parsing and output.
Browse files Browse the repository at this point in the history
* guix/derivations.scm: Export `read-derivation' and `write-derivation'.

* srfi/srfi-64.scm, srfi/srfi-64.upstream.scm: New files, from libchop.
* tests/derivations.scm, tests/test.drv: New files.
  • Loading branch information
civodul committed Apr 19, 2012
1 parent 1054857 commit 341c6fd
Show file tree
Hide file tree
Showing 6 changed files with 1,066 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
*.tmp
*.go
tmp
*.log
5 changes: 4 additions & 1 deletion guix/derivations.scm
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@
derivation-input-sub-derivations

fixed-output-derivation?
derivation-hash))
derivation-hash

read-derivation
write-derivation))

;;;
;;; Nix derivations, as implemented in Nix's `derivations.cc'.
Expand Down
39 changes: 39 additions & 0 deletions srfi/srfi-64.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
(define-module (srfi srfi-64)
#:export (test-begin ;; must be listed first, since in Kawa (at least) it is "magic".
test-end test-assert test-eqv test-eq test-equal
test-approximate test-assert test-error test-apply test-with-runner
test-match-nth test-match-all test-match-any test-match-name
test-skip test-expect-fail test-read-eval-string
test-runner-group-path test-group-with-cleanup
test-result-ref test-result-set! test-result-clear test-result-remove
test-result-kind test-passed?
test-log-to-file
; Misc test-runner functions
test-runner? test-runner-reset test-runner-null
test-runner-simple test-runner-current test-runner-factory test-runner-get
test-runner-create test-runner-test-name
;; test-runner field setter and getter functions - see %test-record-define:
test-runner-pass-count test-runner-pass-count!
test-runner-fail-count test-runner-fail-count!
test-runner-xpass-count test-runner-xpass-count!
test-runner-xfail-count test-runner-xfail-count!
test-runner-skip-count test-runner-skip-count!
test-runner-group-stack test-runner-group-stack!
test-runner-on-test-begin test-runner-on-test-begin!
test-runner-on-test-end test-runner-on-test-end!
test-runner-on-group-begin test-runner-on-group-begin!
test-runner-on-group-end test-runner-on-group-end!
test-runner-on-final test-runner-on-final!
test-runner-on-bad-count test-runner-on-bad-count!
test-runner-on-bad-end-name test-runner-on-bad-end-name!
test-result-alist test-result-alist!
test-runner-aux-value test-runner-aux-value!
;; default/simple call-back functions, used in default test-runner,
;; but can be called to construct more complex ones.
test-on-group-begin-simple test-on-group-end-simple
test-on-bad-count-simple test-on-bad-end-name-simple
test-on-final-simple test-on-test-end-simple
test-on-final-simple))

;; Load Per Bothner's original SRFI-64 implementation.
(load-from-path "srfi/srfi-64.upstream.scm")
Loading

0 comments on commit 341c6fd

Please sign in to comment.