Testroutinen auf kseinaus umbenannt und aktualisiert
test_ks.lsp in test_kseinaus.lsp umbenannt und alle Testroutinen (foerderer, kreisel, omniflo) sowie run_tests.bat und README entsprechend angepasst.
This commit is contained in:
+70
-11
@@ -12,7 +12,7 @@
|
||||
;;
|
||||
;; Aufruf in BricsCAD:
|
||||
;; (load "tests/test_omniflo.lsp")
|
||||
;; TEST_OMNIFLO_EXPORT
|
||||
;; TEST_OMNIFLO
|
||||
;; ============================================================
|
||||
|
||||
|
||||
@@ -58,23 +58,65 @@
|
||||
)
|
||||
|
||||
|
||||
;; --- Ergebnis eines Omniflo-Testfalls als JSON-String erzeugen ---
|
||||
(defun omniflo:test-result-json (test-id sivasnr description hoehe status /
|
||||
json)
|
||||
(setq json (strcat " {\n"
|
||||
" \"test_id\": \"" test-id "\",\n"
|
||||
" \"sivasnr\": \"" (if sivasnr sivasnr "") "\",\n"
|
||||
" \"description\": \"" (if description description "") "\",\n"
|
||||
" \"hoehe\": \"" (if hoehe hoehe "") "\",\n"
|
||||
" \"status\": \"" status "\"\n"
|
||||
" }"))
|
||||
json
|
||||
)
|
||||
|
||||
|
||||
;; --- JSON-Export der Omniflo-Testergebnisse ---
|
||||
(defun omniflo:export-results (tests-out-dir / out-json f first)
|
||||
(if (null *omniflo-test-results*)
|
||||
(princ "\n Keine Omniflo-Ergebnisse vorhanden.")
|
||||
(progn
|
||||
(vl-mkdir tests-out-dir)
|
||||
(setq out-json (strcat tests-out-dir "/omniflo_results.json"))
|
||||
(setq f (open out-json "w"))
|
||||
(if f
|
||||
(progn
|
||||
(write-line "[" f)
|
||||
(setq first T)
|
||||
(foreach r *omniflo-test-results*
|
||||
(if (not first) (write-line "," f))
|
||||
(write-line r f)
|
||||
(setq first nil)
|
||||
)
|
||||
(write-line "]" f)
|
||||
(close f)
|
||||
(princ (strcat "\n Ergebnisse: " out-json))
|
||||
)
|
||||
(princ (strcat "\n FEHLER: Kann " out-json " nicht schreiben!"))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
;; ============================================================
|
||||
;; C:TEST_OMNIFLO_EXPORT
|
||||
;; C:TEST_OMNIFLO
|
||||
;;
|
||||
;; Liest omniflo_tests.json, fuegt alle Testbloecke ein,
|
||||
;; exportiert CSV nach tests/output/.
|
||||
;; ============================================================
|
||||
(defun c:TEST_OMNIFLO_EXPORT (/ tests-json-pfad testfaelle
|
||||
(defun c:TEST_OMNIFLO (/ tests-json-pfad testfaelle
|
||||
x-pos x-schritt
|
||||
idx eintrag sivasnr hoehe-str drehung-str
|
||||
insert-pt anzahl-ok anzahl-fehler
|
||||
tests-out-dir old-results)
|
||||
description insert-pt anzahl-ok anzahl-fehler
|
||||
results-list tests-out-dir old-results)
|
||||
|
||||
(if (not *lib-initialized*)
|
||||
(init-bibliothek)
|
||||
)
|
||||
|
||||
(ssg-start "TEST_OMNIFLO_EXPORT"
|
||||
(ssg-start "TEST_OMNIFLO"
|
||||
'(("OSMODE") ("ATTREQ") ("ATTDIA")))
|
||||
(setvar "OSMODE" 0)
|
||||
(setvar "ATTREQ" 0)
|
||||
@@ -101,7 +143,7 @@
|
||||
)
|
||||
(progn
|
||||
(princ "\n================================================================")
|
||||
(princ "\n TEST_OMNIFLO_EXPORT")
|
||||
(princ "\n TEST_OMNIFLO")
|
||||
(princ (strcat "\n " (itoa (length testfaelle)) " Testfaelle geladen"))
|
||||
(princ "\n================================================================")
|
||||
|
||||
@@ -110,6 +152,7 @@
|
||||
(setq x-schritt 200.0)
|
||||
(setq anzahl-ok 0)
|
||||
(setq anzahl-fehler 0)
|
||||
(setq results-list nil)
|
||||
(setq idx 0)
|
||||
|
||||
(foreach eintrag testfaelle
|
||||
@@ -125,16 +168,29 @@
|
||||
(if (numberp drehung-str)
|
||||
(setq drehung-str (rtos drehung-str 2 1))
|
||||
)
|
||||
(setq description (omni:val eintrag "description"))
|
||||
|
||||
(setq insert-pt (list x-pos 0.0 (atof hoehe-str)))
|
||||
|
||||
(princ (strcat "\n " (itoa idx) ". "
|
||||
(or (omni:val eintrag "description") sivasnr)
|
||||
(if description description (if sivasnr sivasnr "?"))
|
||||
" -> (" (rtos x-pos 2 0) ", 0, " hoehe-str ")"))
|
||||
|
||||
(if (omni:test-insert sivasnr insert-pt hoehe-str drehung-str)
|
||||
(setq anzahl-ok (1+ anzahl-ok))
|
||||
(setq anzahl-fehler (1+ anzahl-fehler))
|
||||
(progn
|
||||
(setq anzahl-ok (1+ anzahl-ok))
|
||||
(setq results-list (cons
|
||||
(omniflo:test-result-json (strcat "OMNI_" (itoa idx))
|
||||
sivasnr description hoehe-str "OK")
|
||||
results-list))
|
||||
)
|
||||
(progn
|
||||
(setq anzahl-fehler (1+ anzahl-fehler))
|
||||
(setq results-list (cons
|
||||
(omniflo:test-result-json (strcat "OMNI_" (itoa idx))
|
||||
sivasnr description hoehe-str "FEHLER")
|
||||
results-list))
|
||||
)
|
||||
)
|
||||
|
||||
(setq x-pos (+ x-pos x-schritt))
|
||||
@@ -146,6 +202,9 @@
|
||||
" OK, " (itoa anzahl-fehler) " Fehler"))
|
||||
(princ "\n================================================================")
|
||||
|
||||
;; Ergebnisse in globaler Variable speichern
|
||||
(setq *omniflo-test-results* (reverse results-list))
|
||||
|
||||
;; CSV-Export nach tests/output/
|
||||
(setq tests-out-dir
|
||||
(strcat (getenv "DXFMAKRO") "/tests/output"))
|
||||
@@ -162,7 +221,7 @@
|
||||
(ssg-end)
|
||||
|
||||
(princ "\n================================================================")
|
||||
(princ "\n TEST_OMNIFLO_EXPORT abgeschlossen.")
|
||||
(princ "\n TEST_OMNIFLO abgeschlossen.")
|
||||
(princ (strcat "\n CSV: " tests-out-dir "/omniflo_export.csv"))
|
||||
(princ "\n================================================================")
|
||||
(princ)
|
||||
|
||||
Reference in New Issue
Block a user