Megatest

Check-in [bee02f96c8]
Login
Overview
Comment:Bring back support for keeping test control panel around when the db is removed
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | better-html-update-control
Files: files | file ages | folders
SHA1: bee02f96c89f9664644c4922f46634f690dc7ccd
User & Date: matt on 2015-03-08 23:19:09
Other Links: branch diff | manifest | tags
Context
2015-03-08
23:43
Fix id returned in test of tests Closed-Leaf check-in: ef0bfe97bb user: matt tags: better-html-update-control
23:19
Bring back support for keeping test control panel around when the db is removed check-in: bee02f96c8 user: matt tags: better-html-update-control
22:28
Use db:dbfile instead of constructing path to db check-in: 1fb33719ba user: matt tags: better-html-update-control
Changes

Modified tdb.scm from [3278a98477] to [6d49ce2a57].

86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
	   (debug:print 0 "ERROR: problem accessing test db " work-area ", you probably should clean and re-run this test or remove the file " 
			dbpath ".\n  "
			((condition-property-accessor 'exn 'message) exn))
	   #f)
	 ;; Is there a cheaper single line operation that will check for existance of a table
	 ;; and raise an exception ?
	 (sqlite3:execute db "SELECT id FROM test_data LIMIT 1;"))
	db)))

;;       (let ((baddb (sqlite3:open-database ":memory:")))
;; 	(debug:print-info 11 "open-test-db END (unsucessful)" work-area)
;; 	;; provide an in-mem db (this is dangerous!)
;; 	(tdb:testdb-initialize baddb)
;; 	baddb)))

;; find and open the testdat.db file for an existing test
(define (tdb:open-test-db-by-test-id test-id #!key (work-area #f))
  (let* ((test-path (if work-area
			work-area
			(rmt:test-get-rundir-from-test-id test-id))))
    (debug:print 3 "TEST PATH: " test-path)







|
|
|
|
|
|
|







86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
	   (debug:print 0 "ERROR: problem accessing test db " work-area ", you probably should clean and re-run this test or remove the file " 
			dbpath ".\n  "
			((condition-property-accessor 'exn 'message) exn))
	   #f)
	 ;; Is there a cheaper single line operation that will check for existance of a table
	 ;; and raise an exception ?
	 (sqlite3:execute db "SELECT id FROM test_data LIMIT 1;"))
	db)
      ;; no work-area or not readable - create a placeholder to fake rest of world out
      (let ((baddb (sqlite3:open-database ":memory:")))
 	(debug:print-info 11 "open-test-db END (unsucessful)" work-area)
 	;; provide an in-mem db (this is dangerous!)
 	(tdb:testdb-initialize baddb)
 	baddb)))

;; find and open the testdat.db file for an existing test
(define (tdb:open-test-db-by-test-id test-id #!key (work-area #f))
  (let* ((test-path (if work-area
			work-area
			(rmt:test-get-rundir-from-test-id test-id))))
    (debug:print 3 "TEST PATH: " test-path)