~ salmonella-environment-setup (master) 0077ca873daf7570b2328e37b3cc13c2b10f2ffd
commit 0077ca873daf7570b2328e37b3cc13c2b10f2ffd
Author: Mario Domenech Goulart <mario.goulart@gmail.com>
AuthorDate: Sun Oct 24 13:59:50 2010 -0200
Commit: Mario Domenech Goulart <mario.goulart@gmail.com>
CommitDate: Sun Oct 24 14:00:58 2010 -0200
run-salmonella.scm: support for docs checking and egg tests
diff --git a/run-salmonella.scm b/run-salmonella.scm
index 499bc7a..2d7fd54 100755
--- a/run-salmonella.scm
+++ b/run-salmonella.scm
@@ -13,6 +13,10 @@
(define chicken-eggs-svn-uri
(conc "https://anonymous@code.call-cc.org/svn/chicken-eggs/release/" chicken-major-release))
(define eggs-dir (make-pathname tmp-dir "chicken-eggs"))
+(define wiki-svn-uri
+ (conc "https://anonymous@code.call-cc.org/svn/chicken-eggs/wiki/eggref/" chicken-major-release))
+(define wiki-dir
+ (make-pathname tmp-dir "wiki"))
(define svn-credentials "--username anonymous --password ''")
(define www-dir "/root/www/salmonella-report")
(define debug-file (make-pathname tmp-dir "run-salmonella.log"))
@@ -21,60 +25,65 @@
(when debug-file
(with-output-to-file debug-file
(lambda ()
- (print (string-intersperse (map ->string things) "")))
+ (print (string-intersperse (map ->string things) "")))
append:)))
(define (pad-number n zeroes)
(define (pad num len)
(let ((str (if (string? num) num (number->string num))))
(if (string-null? str)
- ""
- (if (>= (string-length str) len)
- str
- (string-pad str len #\0)))))
+ ""
+ (if (>= (string-length str) len)
+ str
+ (string-pad str len #\0)))))
(let ((len (string-length (->string n))))
(if (= len zeroes)
- (number->string n)
- (pad n zeroes))))
+ (number->string n)
+ (pad n zeroes))))
(define (! cmd #!optional dir)
(let ((cmd (string-intersperse (map ->string cmd)))
- (cwd (and dir (current-directory))))
+ (cwd (and dir (current-directory))))
(when dir
(change-directory dir)
(debug "@" dir))
(debug cmd)
(let* ((p (open-input-pipe (sprintf "~A 2>&1" cmd)))
- (output (read-all p))
- (exit-status (arithmetic-shift (close-input-pipe p) -8)))
+ (output (read-all p))
+ (exit-status (arithmetic-shift (close-input-pipe p) -8)))
(when dir (change-directory cwd))
(unless (zero? exit-status)
- (debug "Comand '" cmd "' exited abnormally with status " exit-status)
- (debug output)
- (exit exit-status))
+ (debug "Command '" cmd "' exited abnormally with status " exit-status)
+ (debug output)
+ (exit exit-status))
(cons exit-status output))))
(define (run-salmonella)
;; Remove previous run data
(for-each (lambda (file)
- (! `(rm -rf ,file) tmp-dir))
- `(chicken-prefix
- salmonella.log
- salmonella.log.bz2
- salmonella.progress
- salmonella-repo
- run-salmonella.log
- salmonella-report
- ,chicken-core-dir
- ))
+ (! `(rm -rf ,file) tmp-dir))
+ `(chicken-prefix
+ salmonella.log
+ salmonella.log.bz2
+ salmonella.progress
+ salmonella-repo
+ run-salmonella.log
+ salmonella-report
+ ,chicken-core-dir
+ ))
;; Get the most recent version of the chicken-core
(if (file-exists? chicken-core-dir)
(! `(git pull) chicken-core-dir)
(! `(git clone ,chicken-core-git-uri) tmp-dir))
+ ;; Get the most recent versions of wiki documentation
+ (if (file-exists? wiki-dir)
+ (! `(svn up ,svn-credentials) wiki-dir)
+ (! `(svn co ,svn-credentials ,wiki-svn-uri ,(pathname-strip-directory wiki-dir)) tmp-dir))
+
;; Get the most recent versions of all eggs
(if (file-exists? eggs-dir)
(! `(svn up ,svn-credentials) eggs-dir)
@@ -90,42 +99,46 @@
(! `(,(make-pathname (pathname-directory chicken-bootstrap) "salmonella")
"'(dont-ask #t)'"
"'(verbose #f)'"
+ "'(run-tests #t)'"
"'(skip-eggs (list \"macosx\" \"objc\" \"hfs+\" \"osxattr\"))'"
- ,(string-append "'(env-vars (string-append (env-vars) \" QTDIR=/usr PATH=$PATH:" (make-pathname chicken-prefix "bin") "\"))'")
+ ,(string-append "'(env-vars (string-append (env-vars) \" LC_ALL=C LANG=C QTDIR=/usr PATH=$PATH:" (make-pathname chicken-prefix "bin") "\"))'")
,(string-append "'(base-uri \""
(make-pathname "http://tests.call-cc.org" (time->string (seconds->local-time (current-seconds)) "%Y/%m/%d"))
"\")'")
"'(css-file \"http://wiki.call-cc.org/chicken.css\")'"
,(string-append "'(chicken-install \"" (make-pathname chicken-prefix "bin/chicken-install") "\")'")
- ,(string-append "'(chicken-eggs-dir \"" eggs-dir "\")'"))))
+ ,(string-append "'(csi \"" (make-pathname chicken-prefix "bin/csi") "\")'")
+ ,(string-append "'(chicken-eggs-dir \"" eggs-dir "\")'")
+ ,(string-append "'(wiki-dir \"" wiki-dir "\")'")
+ )))
(define (publish-results)
(let* ((now (seconds->local-time))
- (day (pad-number (vector-ref now 3) 2))
- (month (pad-number (add1 (vector-ref now 4)) 2))
- (year (number->string (+ 1900 (vector-ref now 5))))
- (publish-dir (make-pathname (list www-dir year month) day))
- (feeds-dir (make-pathname www-dir "feeds"))
- (today-path (make-pathname (list year month) day)))
+ (day (pad-number (vector-ref now 3) 2))
+ (month (pad-number (add1 (vector-ref now 4)) 2))
+ (year (number->string (+ 1900 (vector-ref now 5))))
+ (publish-dir (make-pathname (list www-dir year month) day))
+ (feeds-dir (make-pathname www-dir "feeds"))
+ (today-path (make-pathname (list year month) day)))
(unless (file-exists? publish-dir)
- (create-directory publish-dir 'parents-too))
+ (create-directory publish-dir 'parents-too))
(unless (file-exists? feeds-dir)
- (create-directory feeds-dir 'parents-too))
+ (create-directory feeds-dir 'parents-too))
;; Generate the atom feeds
(! `(csi -s ,(make-pathname (pathname-directory chicken-bootstrap) "salmonella-log2atom")
- salmonella.log ,feeds-dir ,today-path 1))
+ salmonella.log ,feeds-dir ,today-path 1))
(! `(bzip2 -9 salmonella.log) tmp-dir)
(for-each (lambda (file)
- (! `(cp -R ,file ,publish-dir) tmp-dir))
- '("salmonella.log.bz2"
- "salmonella-report"
- "run-salmonella.log"))
+ (! `(cp -R ,file ,publish-dir) tmp-dir))
+ '("salmonella.log.bz2"
+ "salmonella-report"
+ "run-salmonella.log"))
;; Making a link for the current results
(! `(rm -f current) www-dir)
@@ -134,7 +147,7 @@
;; Create the tmp dir if it not exists
(unless (file-exists? tmp-dir)
- (create-directory tmp-dir 'parents-too))
+ (create-directory tmp-dir 'parents-too))
;; Change to the tmp dir
(change-directory tmp-dir)
Trap