Megatest

Diff
Login

Differences From Artifact [5d35d6b7ef]:

To Artifact [fdee90c537]:


100
101
102
103
104
105
106

107
108










109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124

(define test-id #f)

;; force keepgoing
; (hash-table-set! args:arg-hash "-keepgoing" #t)
(hash-table-set! args:arg-hash "-itempatt" "%")
(hash-table-set! args:arg-hash "-testpatt" "%")

(test "Setup for a run"       #t (begin (setup-for-run) #t))












;; (test "Remove the rollup run" #t (begin (remove-runs) #t))

(test "Run a test" #t (general-run-call 
		       "-runtests" 
		       "run a test" 
		       (lambda (db keys keynames keyvallst)
			 (let ((test-names '("runfirst")))
			   (run-tests db test-names)))))

(change-directory test-work-dir)
(test "Add a step"  #t
      (begin
	(teststep-set-status! db 1 "runfirst" "firststep" "start" 0 '() "This is a comment")
	(sleep 2)
	(teststep-set-status! db 1 "runfirst" "firststep" "end" "pass" '() "This is a different comment")







>


>
>
>
>
>
>
>
>
>
>





|
|
|
|







100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135

(define test-id #f)

;; force keepgoing
; (hash-table-set! args:arg-hash "-keepgoing" #t)
(hash-table-set! args:arg-hash "-itempatt" "%")
(hash-table-set! args:arg-hash "-testpatt" "%")
(hash-table-set! args:arg-hash "-target" "ubuntu/r1.2")
(test "Setup for a run"       #t (begin (setup-for-run) #t))

(define *tdb* #f)

(define testdbpath (conc "/tmp/" (getenv "USER") "/megatest_testing"))
(system (conc "rm -f " testdbpath "/testdat.db;mkdir -p " testdbpath))

(print "Using " testdbpath " for test db")
(test #f #t (let ((db (open-test-db testdbpath)))
	      (set! *tdb* db)
	      (sqlite3#database? db)))
(sqlite3#finalize! *tdb*)

;; (test "Remove the rollup run" #t (begin (remove-runs) #t))

(test "Run a test" #t (general-run-call 
		       "-runtests" 
		       "run a test"
		       (lambda (db target runname keys keynames keyvallst)
			 (let ((test-patts "runfirst"))
			   (runs:run-tests  db target runname test-patts user (make-hash-table))))))

(change-directory test-work-dir)
(test "Add a step"  #t
      (begin
	(teststep-set-status! db 1 "runfirst" "firststep" "start" 0 '() "This is a comment")
	(sleep 2)
	(teststep-set-status! db 1 "runfirst" "firststep" "end" "pass" '() "This is a different comment")