Megatest

Diff
Login

Differences From Artifact [d136c6edce]:

To Artifact [eadc61709a]:


21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
			  (iup:label val ; #:expand "HORIZONTAL"
				     ))
			(list "Testname: "
			      "Item path: "
			      "Current state: "
			      "Current status: "
			      "Test comment: "
			      "Test id: "
			      "Value: "
			      "Expected value: "
			      "Tolerance: "
			      "Units: "))
		   (list (iup:label "" #:expand "VERTICAL"))))
    (apply iup:vbox  ; #:expand "YES"
	   (list 
	    (store-label "testname"
			 (iup:label (db:test-get-testname  testdat) #:expand "HORIZONTAL")
			 (lambda (testdat)(db:test-get-testname testdat)))
	    (store-label "item-path"







|
<
<
<
<







21
22
23
24
25
26
27
28




29
30
31
32
33
34
35
			  (iup:label val ; #:expand "HORIZONTAL"
				     ))
			(list "Testname: "
			      "Item path: "
			      "Current state: "
			      "Current status: "
			      "Test comment: "
			      "Test id: "))




		   (list (iup:label "" #:expand "VERTICAL"))))
    (apply iup:vbox  ; #:expand "YES"
	   (list 
	    (store-label "testname"
			 (iup:label (db:test-get-testname  testdat) #:expand "HORIZONTAL")
			 (lambda (testdat)(db:test-get-testname testdat)))
	    (store-label "item-path"
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
92
93
			 (lambda (testdat)
			   (db:test-get-comment testdat)))
	    (store-label "testid"
			 (iup:label "TestId                             "
				    #:expand "HORIZONTAL")
			 (lambda (testdat)
			   (db:test-get-id testdat)))
;;	    (store-label "testvalue"
;;			 (iup:label "TestValue                          "
;;				    #:expand "HORIZONTAL")
;;			 (lambda (testdat)
;;			   (db:test-get-value testdat)))
;;	    (store-label "testexpectedvalue"
;;			 (iup:label "TestExpectedValue                  "
;;				    #:expand "HORIZONTAL")
;;			 (lambda (testdat)
;;			   (db:test-get-expected_value testdat)))
;;	    (store-label "testtol"
;;			 (iup:label "TestTol                             "
;;				    #:expand "HORIZONTAL")
;;			 (lambda (testdat)
;;			   (db:test-get-tol testdat)))
;;	    (store-label "testunits"
;;			 (iup:label "TestUnits                          "
;;				    #:expand "HORIZONTAL")
;;			 (lambda (testdat)
;;			   (db:test-get-units testdat)))
	    )))))

;;======================================================================
;; Test meta panel
;;======================================================================
(define (test-meta-panel testmeta store-meta)
  (iup:frame 







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







56
57
58
59
60
61
62




















63
64
65
66
67
68
69
			 (lambda (testdat)
			   (db:test-get-comment testdat)))
	    (store-label "testid"
			 (iup:label "TestId                             "
				    #:expand "HORIZONTAL")
			 (lambda (testdat)
			   (db:test-get-id testdat)))




















	    )))))

;;======================================================================
;; Test meta panel
;;======================================================================
(define (test-meta-panel testmeta store-meta)
  (iup:frame 
344
345
346
347
348
349
350

351
352
353
354
355
356
357
358
359
360
361

362

363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389



































390
391
392
393
394
395
396
	       ;; The controls
	       (iup:frame #:title "Actions" 
			  (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")))
	       (set-fields-panel test-id testdat)

	       (iup:frame 
		#:title "Test Steps"
		(let ((stepsdat ;;(iup:label "Test steps ........................................." 
				;;	   #:expand "YES" 
				;;	   #:size "200x150"
				;;	   #:alignment "ALEFT:ATOP")))
		       (iup:textbox #:action (lambda (obj char val)
					       #f)
				    #:expand "YES"
				    #:multiline "YES"
				    #:font "Courier New, -10")))

		  (hash-table-set! widgets "Test Steps" (lambda (testdat)

							  (let* ((currval (iup:attribute stepsdat "VALUE")) ;; "TITLE"))
								 (fmtstr  "~25a~10a~10a~15a~15a")
								 (comprsteps (db:get-steps-table db test-id))
								 (newval  (string-intersperse 
									   (append
									    (list 
									     (format #f fmtstr "Stepname" "Start" "End"    "Status" "Time")
									     (format #f fmtstr "========" "=====" "======" "======" "=========="))
									    (map (lambda (x)
										   ;; take advantage of the \n on time->string
										   (format #f fmtstr
											   (vector-ref x 0)
											   (let ((s (vector-ref x 1)))
											     (if (number? s)(seconds->time-string s) s))
											   (let ((s (vector-ref x 2)))
											     (if (number? s)(seconds->time-string s) s))
											   (vector-ref x 3)    ;; status
											   (vector-ref x 4)))  ;; time delta
										 (sort (hash-table-values comprsteps)
										       (lambda (a b)
											 (if (and (number? a)(number? b))
											     (< (vector-ref a 1)(vector-ref b 1))
											     #t)))))
									   "\n")))
							    (if (not (equal? currval newval))
								(iup:attribute-set! stepsdat "VALUE" newval ))))) ;; "TITLE" newval)))))
		  stepsdat)))))



































      (iup:show self)
      (iup:callback-set! *tim* "ACTION_CB"
			 (lambda (x)
			   ;; Now start keeping the gui updated from the db
			   (refreshdat) ;; update from the db here
					;(thread-suspend! other-thread)
			   ;; update the gui elements here







>
|
|
|
|
|
|
|
|
|
|
|
>
|
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







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
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
	       ;; The controls
	       (iup:frame #:title "Actions" 
			  (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")))
	       (set-fields-panel test-id testdat)
	       (iup:hbox
		(iup:frame 
		 #:title "Test Steps"
		 (let ((stepsdat ;;(iup:label "Test steps ........................................." 
			;;	   #:expand "YES" 
			;;	   #:size "200x150"
			;;	   #:alignment "ALEFT:ATOP")))
			(iup:textbox #:action (lambda (obj char val)
						#f)
				     #:expand "YES"
				     #:multiline "YES"
				     #:font "Courier New, -10"
				     #:size "100x150")))
		   (hash-table-set! widgets "Test Steps" 
				    (lambda (testdat)
				      (let* ((currval (iup:attribute stepsdat "VALUE")) ;; "TITLE"))
					     (fmtstr  "~20a~10a~10a~12a~15a")
					     (comprsteps (db:get-steps-table db test-id))
					     (newval  (string-intersperse 
						       (append
							(list 
							 (format #f fmtstr "Stepname" "Start" "End" "Status" "Time")
							 (format #f fmtstr "========" "=====" "===" "======" "===="))
							(map (lambda (x)
							       ;; take advantage of the \n on time->string
							       (format #f fmtstr
								       (vector-ref x 0)
								       (let ((s (vector-ref x 1)))
									 (if (number? s)(seconds->time-string s) s))
								       (let ((s (vector-ref x 2)))
									 (if (number? s)(seconds->time-string s) s))
								       (vector-ref x 3)    ;; status
								       (vector-ref x 4)))  ;; time delta
							     (sort (hash-table-values comprsteps)
								   (lambda (a b)
								     (if (and (number? a)(number? b))
									 (< (vector-ref a 1)(vector-ref b 1))
									 #t)))))
						       "\n")))
					(if (not (equal? currval newval))
					    (iup:attribute-set! stepsdat "VALUE" newval ))))) ;; "TITLE" newval)))))
		   stepsdat))
		;; populate the Test Data panel
		(iup:frame
		 #:title "Test Data"
		 (let ((test-data
			(iup:textbox  #:action (lambda (obj char val)
						#f)
				      #:expand "YES"
				      #:multiline "YES"
				      #:font "Courier New, -10"
				      #:size "100x150")))
		   (hash-table-set! widgets "Test Data"
				    (lambda (testdat) ;; 
				      (let* ((currval (iup:attribute test-data "VALUE")) ;; "TITLE"))
					     (fmtstr  "~10a~10a~10a~10a~7a~7a~6a~a") ;; category,variable,value,expected,tol,units,comment
					     (newval  (string-intersperse 
						       (append
							(list 
							 (format #f fmtstr "Category" "Variable" "Value" "Expected" "Tol" "Status" "Units" "Comment")
							 (format #f fmtstr "========" "========" "=====" "========" "===" "======" "=====" "======="))
							(map (lambda (x)
							       (format #f fmtstr
								       (db:test-data-get-category x)
								       (db:test-data-get-variable x)
								       (db:test-data-get-value    x)
								       (db:test-data-get-expected x)
								       (db:test-data-get-tol      x)
								       (db:test-data-get-status   x)
								       (db:test-data-get-units    x)
								       (db:test-data-get-comment  x)))
							     (db:read-test-data db test-id "%")))
						       "\n")))
					(if (not (equal? currval newval))
					    (iup:attribute-set! test-data "VALUE" newval ))))) ;; "TITLE" newval)))))
		   test-data)))
		)))
      (iup:show self)
      (iup:callback-set! *tim* "ACTION_CB"
			 (lambda (x)
			   ;; Now start keeping the gui updated from the db
			   (refreshdat) ;; update from the db here
					;(thread-suspend! other-thread)
			   ;; update the gui elements here