Testrunner geändert. Bei fehlgeschlagendem Test fehlt eine .json im test/Output Ordner
This commit is contained in:
@@ -126,6 +126,23 @@
|
||||
(princ)
|
||||
)
|
||||
|
||||
;; ============================================================
|
||||
;; SSG_DIM_SWITCH - Umschalten zwischen 2D und 3D Bloecken
|
||||
;; Setzt DXFM_DIM, DXFM_BLOCKS und DXFM_OMNIFLO neu
|
||||
;; ============================================================
|
||||
|
||||
(defun c:SSG_DIM_SWITCH ( / dim-neu basis)
|
||||
(setq dim-neu (if (equal (strcase (getenv "DXFM_DIM")) "3D") "2D" "3D"))
|
||||
(setq basis (getenv "DXFMAKRO"))
|
||||
(setenv "DXFM_DIM" dim-neu)
|
||||
(setenv "DXFM_BLOCKS" (strcat basis "\\data\\ils\\" dim-neu))
|
||||
(setenv "DXFM_OMNIFLO" (strcat basis "\\data\\omniflo\\" dim-neu))
|
||||
(princ (strcat "\nModus umgeschaltet auf: " dim-neu))
|
||||
(princ (strcat "\n DXFM_BLOCKS = " (getenv "DXFM_BLOCKS")))
|
||||
(princ (strcat "\n DXFM_OMNIFLO = " (getenv "DXFM_OMNIFLO")))
|
||||
(princ)
|
||||
)
|
||||
|
||||
;; ============================================================
|
||||
;; SSG_BLOCKEDIT - Kontextmenue-Dispatcher
|
||||
;; Erkennt den selektierten Blocktyp und ruft den passenden
|
||||
|
||||
@@ -116,12 +116,16 @@
|
||||
[Call Python]^C^C(ssg-ensure "export") CALLPYTHON
|
||||
[Export Sivas]^C^C(ssg-ensure "export") EXPORTSIVAS
|
||||
[<-Export CSV]^C^C(ssg-ensure "export") EXPORTCSV
|
||||
[->Konfiguration]
|
||||
[Umschalten 2D und 3D]^C^C(ssg-ensure "SSG_LIB_Commands") SSG_DIM_SWITCH
|
||||
[<-Konfiguration Schliessen]^C^C
|
||||
[->Tests]
|
||||
[Alle Tests ausfuehren]^C^C(load (strcat (getenv "DXFMAKRO") "/tests/test_run_all.lsp")) SSG_RUN_ALL_TESTS
|
||||
[--]
|
||||
[Kreisel]^C^C(load (strcat (getenv "DXFMAKRO") "/tests/test_kreisel.lsp")) TEST_KREISEL
|
||||
[Foerderer]^C^C(load (strcat (getenv "DXFMAKRO") "/tests/test_foerderer.lsp")) TEST_FOERDERER
|
||||
[KS EIN/AUS]^C^C(load (strcat (getenv "DXFMAKRO") "/tests/test_ks.lsp")) TEST_KSEINAUS
|
||||
[Omniflo]^C^C(load (strcat (getenv "DXFMAKRO") "/tests/test_omniflo.lsp")) TEST_OMNIFLO
|
||||
[<-Omniflo Export]^C^C(load (strcat (getenv "DXFMAKRO") "/tests/test_omniflo.lsp")) TEST_OMNIFLO_EXPORT
|
||||
|
||||
***DOUBLECLICK
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
[
|
||||
{ "name": "kreisel", "save": "dxf" },
|
||||
{ "name": "foerderer", "save": "dwg" },
|
||||
{ "name": "kseinaus", "save": null },
|
||||
{ "name": "omniflo", "save": "dxf" }
|
||||
{ "name": "kreisel", "save": "dxf", "module": "KreiselInsert" },
|
||||
{ "name": "foerderer", "save": "dwg", "module": "VarioFoerderer" },
|
||||
{ "name": "kseinaus", "save": null, "module": "VarioFoerderer" },
|
||||
{ "name": "omniflo", "save": "dxf", "module": "OmniModulInsert" }
|
||||
]
|
||||
|
||||
+20
-7
@@ -48,7 +48,7 @@
|
||||
;; Erwartet ein JSON-Array, je Zeile ein Objekt: { "name": "...", "save": "..." }
|
||||
;; "save" kann "dxf", "dwg", null oder fehlen (= kein Speichern).
|
||||
;; Rueckgabe: Liste von Assoc-Listen (("name" . "kreisel") ("save" . "dxf"))
|
||||
(defun alltests:load (tests-pfad / json-datei f zeile ergebnis name save-fmt)
|
||||
(defun alltests:load (tests-pfad / json-datei f zeile ergebnis name save-fmt module)
|
||||
(setq json-datei (strcat tests-pfad "/alltests.json"))
|
||||
(if (not (findfile json-datei))
|
||||
(progn
|
||||
@@ -70,9 +70,10 @@
|
||||
(progn
|
||||
(setq name (alltests:get-str zeile "name"))
|
||||
(setq save-fmt (alltests:get-str zeile "save"))
|
||||
(setq module (alltests:get-str zeile "module"))
|
||||
(if name
|
||||
(setq ergebnis (cons
|
||||
(list (cons "name" name) (cons "save" save-fmt))
|
||||
(list (cons "name" name) (cons "save" save-fmt) (cons "module" module))
|
||||
ergebnis))
|
||||
)
|
||||
)
|
||||
@@ -99,9 +100,9 @@
|
||||
|
||||
|
||||
(defun c:SSG_RUN_ALL_TESTS ( / tests-pfad tests-out-dir
|
||||
idx anz entry name save-fmt
|
||||
idx anz entry name save-fmt module
|
||||
namen befehl datei export-fn
|
||||
out-path test-result)
|
||||
out-path old-json test-result)
|
||||
|
||||
(setq tests-pfad (strcat (getenv "DXFMAKRO") "/tests"))
|
||||
(setq tests-out-dir (strcat tests-pfad "/output"))
|
||||
@@ -130,8 +131,9 @@
|
||||
;; Testlauf eine eigene saubere Zeichnung erzeugt.
|
||||
(foreach entry *test-module*
|
||||
(setq idx (1+ idx))
|
||||
(setq name (cdr (assoc "name" entry)))
|
||||
(setq save-fmt (cdr (assoc "save" entry)))
|
||||
(setq name (cdr (assoc "name" entry)))
|
||||
(setq save-fmt (cdr (assoc "save" entry)))
|
||||
(setq module (cdr (assoc "module" entry)))
|
||||
|
||||
;; Namen aus Konvention ableiten
|
||||
(setq namen (test-module-names name tests-pfad))
|
||||
@@ -139,6 +141,17 @@
|
||||
(setq befehl (cdr (assoc "befehl" namen)))
|
||||
(setq export-fn (cdr (assoc "export-fn" namen)))
|
||||
|
||||
;; Benoetigtes LISP-Modul laden (falls noch nicht geschehen)
|
||||
(if module
|
||||
(ssg-ensure module)
|
||||
)
|
||||
|
||||
;; Alte Ergebnis-JSON loeschen: fehlgeschlagene Tests sind am Fehlen der Datei erkennbar
|
||||
(setq old-json (strcat tests-out-dir "/" name "_results.json"))
|
||||
(if (findfile old-json)
|
||||
(vl-file-delete old-json)
|
||||
)
|
||||
|
||||
(princ (strcat "\n\n>>> " (itoa idx) "/" (itoa anz) ": " befehl " <<<"))
|
||||
(if save-fmt
|
||||
(princ (strcat " [save: " save-fmt "]"))
|
||||
@@ -188,7 +201,7 @@
|
||||
(princ (strcat "\n DXF gespeichert: " out-path ".dxf"))
|
||||
)
|
||||
((and save-fmt (= (strcase save-fmt) "DWG"))
|
||||
(command "_.-SAVEAS" "2013" (strcat out-path ".dwg"))
|
||||
(command "_.-SAVEAS" "R2013" (strcat out-path ".dwg"))
|
||||
(princ (strcat "\n DWG gespeichert: " out-path ".dwg"))
|
||||
)
|
||||
(T
|
||||
|
||||
Reference in New Issue
Block a user