Newer
Older
Francois-Rene Rideau
committed
;;; -*- Lisp -*-
(load "script-support.lisp")
Francois-Rene Rideau
committed
(load-asdf)
#+scl
(require :http-library)
Francois-Rene Rideau
committed
(setf asdf:*central-registry* '(*default-pathname-defaults*))
;; Compare the source files with local versions before loading them.
#+(and (or abcl scl) trust-the-net)
(flet ((compare (url local)
(with-open-file (stream1 url :element-type 'character
:external-format :utf-8)
(with-open-file (stream2 local :element-type 'character
:external-format :utf-8)
(loop
(let ((ch1 (read-char stream1 nil nil))
(ch2 (read-char stream2 nil nil)))
(unless (eql ch1 ch2)
(error "Unexpected source content."))
(unless (and ch1 ch2)
(return))))))))
(let* ((system (asdf:find-system "test-urls-1"))
(url (asdf:component-pathname
(asdf:find-component system "test"))))
(compare url "test.lisp"))
(asdf:operate 'asdf:load-op 'test-urls-1)
;; test that it compiled
(let* ((path (asdf:component-pathname
(asdf:find-component "test-urls-1" "test")))
(test (asdf:compile-file-pathname* path))
(test-date (file-write-date test)))
(format t "~&test-urls-1 1: ~S ~S~%" test test-date)
(assert test-date))))