|
33 | 33 | (message (concat file ": testing auto..."))
|
34 | 34 | (verilog-auto)))
|
35 | 35 | (message (concat file ": auto OK..."))
|
36 |
| - |
| 36 | + |
37 | 37 | (unless (getenv "VERILOG_MODE_TEST_NO_INDENTS")
|
38 |
| - (message (concat file ": testing indent...")) |
39 |
| - (save-excursion |
40 |
| - (goto-char (point-min)) |
41 |
| - (let* ((ln 0)) |
42 |
| - (while (not (eobp)) |
43 |
| - (message (format "%d" ln)) |
44 |
| - ;;(message (format "%s : %d - indent" file ln)) |
45 |
| - (electric-verilog-tab) |
46 |
| - ;;(message (format "%s : %d - pretty-expr" file ln)) |
47 |
| - (verilog-pretty-expr t ) |
48 |
| - ;;(message (format "%s : %d - pretty-declaration" file ln)) |
49 |
| - (verilog-pretty-declarations t) |
50 |
| - (forward-line 1) |
51 |
| - (setq ln (1+ ln)) |
52 |
| - ))) |
53 |
| - (message (concat file ": indents OK...")) |
| 38 | + (verilog-test-indent-buffer file) |
54 | 39 |
|
55 |
| -; (message (concat file ": testing auto endcomments...")) |
56 |
| -; (verilog-label-be) |
| 40 | +;; (message (concat file ": testing auto endcomments...")) |
| 41 | +;; (verilog-label-be) |
57 | 42 |
|
58 | 43 | (untabify (point-min) (point-max))
|
59 | 44 | )
|
60 |
| - |
61 | 45 | (write-file (concat "../" temp-file))
|
62 | 46 | (kill-buffer nil))
|
63 | 47 | ;;
|
64 |
| - (vl-diff-file file temp-file)) |
| 48 | + (vl-diff-file (concat "tests_ok/" file) temp-file)) |
65 | 49 |
|
66 |
| -(defun vl-diff-file (file temp-file) |
67 |
| - (message (concat file ": running diff of " file " and tests_ok/" file )) |
| 50 | +(defun verilog-test-indent-buffer (file ) |
| 51 | + (interactive) |
| 52 | + (message (concat file ": testing indent...")) |
| 53 | + (save-excursion |
| 54 | + (goto-char (point-min)) |
| 55 | + (let* ((ln 0)) |
| 56 | + (while (not (eobp)) |
| 57 | + ;;(message (format "%d" ln)) |
| 58 | + ;;(message (format "%s : %d - indent" file ln)) |
| 59 | + (electric-verilog-tab) |
| 60 | + ;;(message (format "%s : %d - pretty-expr" file ln)) |
| 61 | + (verilog-pretty-expr t ) |
| 62 | + ;;(message (format "%s : %d - pretty-declaration" file ln)) |
| 63 | + (verilog-pretty-declarations t) |
| 64 | + (forward-line 1) |
| 65 | + (setq ln (1+ ln)) |
| 66 | + ) |
| 67 | + (message (format "Indented %d lines" ln)) |
| 68 | + )) |
| 69 | + (message (concat file ": indents OK..."))) |
| 70 | + |
| 71 | +(defun vl-diff-file (golden-file temp-file) |
| 72 | + (message (concat golden-file ": running diff of " golden-file " and " temp-file )) |
68 | 73 | (with-temp-buffer
|
69 | 74 | (let* ((status
|
70 |
| - (call-process "diff" nil t t diff-flags "--label" "GOLDEN_REFERENCE" (concat "tests_ok/" file) "--label" "CURRENT_BEHAVIOR" temp-file ))) |
| 75 | + (call-process "diff" nil t t diff-flags "--label" "GOLDEN_REFERENCE" golden-file "--label" "CURRENT_BEHAVIOR" temp-file ))) |
71 | 76 | (cond ((not (equal status 0))
|
72 |
| - (message (concat "diff -c tests_ok/" file " " temp-file)) |
| 77 | + (message (concat "diff -c " golden-file " " temp-file)) |
73 | 78 | (message "***Golden Reference File\n---Generated Test File")
|
74 | 79 | (message "%s" (buffer-string))
|
75 | 80 | (message "To promote current to golden, in shell buffer hit newline anywhere in next line (^P RETURN):")
|
76 |
| - (message (concat "cp " temp-file " tests_ok/" file "; VERILOG_MODE_START_FILE=" file " " again )) |
| 81 | + (message (concat "cp " temp-file " " golden-file "; VERILOG_MODE_START_FILE=" golden-file " " again )) |
77 | 82 | (error ""))
|
78 | 83 |
|
79 | 84 | (t
|
80 |
| - (message "Verified %s" file)))))) |
| 85 | + (message "Verified %s" golden-file)))))) |
81 | 86 |
|
82 | 87 | (defun vl-do-on-thread (file-num)
|
83 | 88 | "Return true to process due to multithreading"
|
|
102 | 107 | (when (getenv "VERILOG_MODE_START_FILE")
|
103 | 108 | (let* ((startfiles (list (getenv "VERILOG_MODE_START_FILE")))
|
104 | 109 | (startfile (car startfiles)))
|
105 |
| - (message (concat "Staring from file " startfile)) |
| 110 | + (message (concat "Starting from file " startfile)) |
106 | 111 | (catch 'done
|
107 | 112 | (while files
|
108 | 113 | (setq file (car files))
|
109 |
| - (if (string-equal file startfile) |
| 114 | + (if (string-equal (concat "tests_ok/" file) startfile) |
110 | 115 | (progn
|
111 | 116 | (message (concat "matched " file))
|
112 | 117 | (throw 'done 0))
|
|
0 commit comments