Megatest

Diff
Login

Differences From Artifact [a7e217ed51]:

To Artifact [939dbd59fd]:


243
244
245
246
247
248
249







250
251
252
253
254
255
256
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263







+
+
+
+
+
+
+







	 (rundir        logfile)
	 (testfullname  (if testdat (db:test-get-fullname testdat) "Gathering data ..."))
	 (testname      (if testdat (db:test-get-testname testdat) "n/a"))
	 (testmeta      (if testdat 
			    (let ((tm (db:testmeta-get-record db testname)))
			      (if tm tm (make-db:testmeta)))
			    (make-db:testmeta)))

	 (keystring  (string-intersperse 
		      (map (lambda (keyval)
			     (conc ":" (car keyval) " " (cadr keyval)))
			   keydat)
		      " "))
	 (item-path  (db:test-get-item-path testdat))
	 (viewlog    (lambda (x)
		       (if (file-exists? logfile)
			   ;(system (conc "firefox " logfile "&"))
			   (iup:send-url logfile)
			   (message-window (conc "File " logfile " not found")))))
	 (xterm      (lambda (x)
		       (if (directory-exists? rundir)
297
298
299
300
301
302
303
304





















305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321

322
323
324
325









326
327
328
329
330
331
332
304
305
306
307
308
309
310

311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349




350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365







-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

















+
-
-
-
-
+
+
+
+
+
+
+
+
+







					      (if (not (equal? newval oldval))
						  (begin
						    ;(mutex-lock! mx1)
						    (iup:attribute-set! lbl "TITLE" newval)
						    ;(mutex-unlock! mx1)
						    )))))
			 lbl))
	 (store-button store-label))
	 (store-button store-label)
	 (command-text-box (iup:textbox #:expand "YES" #:font "Courier New, -10"))
	 (command-launch-button (iup:button "Execute!" #:action (lambda (x)
								  (let ((cmd (iup:attribute command-text-box "VALUE")))
								    (system (conc cmd "  &"))))))
	 (run-test  (lambda (x)
		      (iup:attribute-set! 
		       command-text-box "VALUE"
		       (conc "megatest -runtests " testname " " keystring " :runname " runname 
			     " -itempatt " (if (equal? item-path "")
					       "%" 
					       item-path)
			     " > run.log" ))))
	 (remove-test (lambda (x)
			(iup:attribute-set!
			 command-text-box "VALUE"
			 (conc "megatest -remove-runs " keystring " :runname " runname " -testpatt " testname " -itempatt "
			       (if (equal? item-path "")
				   "%"
				   item-path)
			       " > clean.log")))))
    (cond
     ((not testdat)(begin (print "ERROR: bad test info for " test-id)(exit 1)))
     ((not rundat)(begin (print "ERROR: found test info but there is a problem with the run info for " run-id)(exit 1)))
     (else
      ;;  (test-set-status! db run-id test-name state status itemdat)
      (set! self ; 
	    (iup:dialog #:close_cb (lambda (a)(exit)) ; #:expand "YES"
	     #:title testfullname
	     (iup:vbox ; #:expand "YES"
               ;; The run and test info
	       (iup:hbox  ; #:expand "YES"
		(run-info-panel keydat testdat runname)
		(test-info-panel testdat store-label widgets)
		(test-meta-panel testmeta store-meta))
	       (host-info-panel testdat store-label)
	       ;; The controls
	       (iup:frame #:title "Actions" 
			  (iup:vbox
			  (iup:hbox 
			   (iup:button "View Log"    #:action viewlog #:size "120x")
			   (iup:button "Start Xterm" #:action xterm   #:size "120x")
			   (iup:button "Close"       #:action (lambda (x)(exit)) #:size "120x")))
			   (iup:hbox 
			    (iup:button "View Log"    #:action viewlog     #:size "120x")
			    (iup:button "Start Xterm" #:action xterm       #:size "120x")
			    (iup:button "Run Test"    #:action run-test    #:size "120x")
			    (iup:button "Clean Test"  #:action remove-test #:size "120x")
			    (iup:button "Close"       #:action (lambda (x)(exit)) #:size "120x"))
			   (apply 
			    iup:hbox
			    (list command-text-box command-launch-button))))
	       (set-fields-panel test-id testdat)
	       (iup:hbox
		(iup:frame 
		 #:title "Test Steps"
		 (let ((stepsdat ;;(iup:label "Test steps ........................................." 
			;;	   #:expand "YES" 
			;;	   #:size "200x150"