39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
(vector? dat))))
(define *keys* (keys:config-get-fields *configdat*))
(define *keyvals* (keys:target->keyval *keys* "a/b/c"))
(test #f #t (string? (car *runremote*)))
(test #f '(#t "successful login") (rmt:login)) ;; *runremote* *toppath* *my-client-signature*)))
(test #f #f (rmt:get-test-info-by-id 99)) ;; get non-existant test
;; RUNS
(test #f 1 (rmt:register-run *keyvals* "firstrun" "new" "n/a" (current-user-name)))
(test "get run info" "firstrun" (let ((rinfo (rmt:get-run-info 1)))
(vector-ref (vector-ref rinfo 1) 3)))
(test "get runname from id" "firstrun" (rmt:get-run-name-from-id 1))
;; TESTS
(test "get tests (no data)" '() (rmt:get-tests-for-run 1 "%" '() '() #f #f #f #f #f #f))
(test "register test" #t (rmt:general-call 'register-test 1 "test1" ""))
(test "get tests (some data)" 1 (length (rmt:get-tests-for-run 1 "%" '() '() #f #f #f #f #f #f)))
(test "get test id" 1 (rmt:get-test-id 1 "test1" ""))
(test "get test id from main" 1 (db:get-test-id *db* 1 "test1" ""))
(test "get keys" #t (list? (rmt:get-keys)))
(test "set comment" #t (begin (rmt:general-call 'set-test-comment "this is a comment" 1) #t))
(test "get comment" "this is a comment" (let ((trec (rmt:get-test-info-by-id 1)))
(db:test-get-comment trec)))
;; MORE RUNS
(test "get runs" #t (let* ((runs (rmt:get-runs "%" #f #f '()))
(header (vector-ref runs 0))
(data (vector-ref runs 1)))
(and (list? header)
(list? data)
(vector? (car data)))))
;; (test "sync back" #t (begin (rmt:sync-back) #t))
;;======================================================================
;; D B
;;======================================================================
(test #f '(#t "exit process started") (rmt:kill-server)) ;; *toppath* *my-client-signature* #f)))
|
>
>
>
>
>
>
>
>
>
>
|
|
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
(vector? dat))))
(define *keys* (keys:config-get-fields *configdat*))
(define *keyvals* (keys:target->keyval *keys* "a/b/c"))
(test #f #t (string? (car *runremote*)))
(test #f '(#t "successful login") (rmt:login)) ;; *runremote* *toppath* *my-client-signature*)))
(define inmem (open-in-mem-db))
(define (inmem-test t b)
(test "inmem sync to" t (db:sync-to *db* inmem))
(test "inmem sync back" b (db:sync-to inmem *db*)))
(inmem-test 0 0)
(test #f #f (rmt:get-test-info-by-id 99)) ;; get non-existant test
;; RUNS
(test #f 1 (rmt:register-run *keyvals* "firstrun" "new" "n/a" (current-user-name)))
(test "get run info" "firstrun" (let ((rinfo (rmt:get-run-info 1)))
(vector-ref (vector-ref rinfo 1) 3)))
(test "get runname from id" "firstrun" (rmt:get-run-name-from-id 1))
;; TESTS
(test "get tests (no data)" '() (rmt:get-tests-for-run 1 "%" '() '() #f #f #f #f #f #f))
(test "register test" #t (rmt:general-call 'register-test 1 "test1" ""))
(test "get tests (some data)" 1 (length (rmt:get-tests-for-run 1 "%" '() '() #f #f #f #f #f #f)))
(test "get test id" 1 (rmt:get-test-id 1 "test1" ""))
(inmem-test 1 1)
(test "get test id from main" 1 (db:get-test-id *db* 1 "test1" ""))
(test "get keys" #t (list? (rmt:get-keys)))
(test "set comment" #t (begin (rmt:general-call 'set-test-comment "this is a comment" 1) #t))
(test "get comment" "this is a comment" (let ((trec (rmt:get-test-info-by-id 1)))
(db:test-get-comment trec)))
;; MORE RUNS
(test "get runs" #t (let* ((runs (rmt:get-runs "%" #f #f '()))
(header (vector-ref runs 0))
(data (vector-ref runs 1)))
(and (list? header)
(list? data)
(vector? (car data)))))
(inmem-test 1 1)
;;======================================================================
;; D B
;;======================================================================
(test #f '(#t "exit process started") (rmt:kill-server)) ;; *toppath* *my-client-signature* #f)))
|