Skip to content

Commit 0dff7be

Browse files
committed
dev: libs tests now shows effect of all patches
Was formerly only showing effect of specific source code hacks, but now showing effect of all patches we make. This makes it easier to review/update necessary patches.
1 parent 2fcc007 commit 0dff7be

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

script/libs_tests.clj

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,10 @@
154154
(let [new-content (string/replace content match replacement)]
155155
(if (= new-content content)
156156
(throw (ex-info (format "hacking file failed: %s" fname) {}))
157-
(spit fname new-content)))
158-
(status/line :detail (format "-> here's the diff for %s" fname))
159-
(shcmd-no-exit ["git" "--no-pager" "diff" "--no-index" orig-filename fname])))
157+
(spit fname new-content)))))
158+
159+
(defn- show-patch-diff [{:keys [home-dir]}]
160+
(shcmd-no-exit ["git" "--no-pager" "diff"] {:dir home-dir}))
160161

161162
;;
162163
;; carve
@@ -299,9 +300,7 @@
299300
(str (subs content 0 ndx)
300301
replace-str
301302
(subs content (+ ndx (count find-str)))))
302-
(throw (ex-info "hacking zprint failed" {})))
303-
(status/line :detail (format "-> here's the diff for %s" src-filename))
304-
(shcmd-no-exit ["git" "--no-pager" "diff" "--no-index" orig-filename src-filename])))
303+
(throw (ex-info "hacking zprint failed" {})))))
305304

306305
(defn- zprint-prep [{:keys [target-root-dir home-dir]}]
307306
(status/line :detail "=> Installing not-yet-released expectations/cljc-test")
@@ -466,6 +465,8 @@
466465
lib (assoc lib :home-dir home-dir)]
467466
(status/line :detail "git init-ing target, some libs expect that they were cloned")
468467
(shcmd ["git" "init"] {:dir home-dir})
468+
(status/line :detail "git adding, so that we can easily show effect of our patches later")
469+
(shcmd ["git" "add" "."] {:dir home-dir})
469470

470471
(when patch-fn
471472
(status/line :info (format "%s: Patching" name))
@@ -475,6 +476,8 @@
475476
(prep-fn lib))
476477
(when (not show-deps-fn)
477478
(throw (ex-info (format "missing show-deps-fn for %s" name) {})))
479+
(status/line :info (format "%s: Effect of our patches" name))
480+
(show-patch-diff lib)
478481
(status/line :info (format "%s: Deps report" name))
479482
(show-deps-fn lib)
480483
(when-not test-cmds

0 commit comments

Comments
 (0)