From 6b1228a8f2c83bf1f7c74fe6405a0bf84f885896 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Mon, 14 Dec 2020 20:58:47 +0300 Subject: [PATCH] redo-sh tests under github.com/chriscool/sharness --- README | 37 ++++++++++++++++++++++++++++--------- t/.gitignore | 1 + t/clean.do | 5 +++++ t/prepare.do | 17 +++++++++++++++++ t/runner.rc | 10 ++++++++++ usage.go | 2 +- 6 files changed, 62 insertions(+), 10 deletions(-) create mode 100644 t/.gitignore create mode 100644 t/clean.do create mode 100644 t/prepare.do create mode 100755 t/runner.rc diff --git a/README b/README index 222c94a..d49c3cc 100644 --- a/README +++ b/README @@ -25,7 +25,7 @@ problems with the authenticity on your side, then build it manually: > $ git clone git://git.cypherpunks.ru/goredo.git $ cd goredo - $ git tag -v v0.4.1 + $ git tag -v v0.5.0 $ git clone git://git.cypherpunks.ru/gorecfile.git $ ( cd gorecfile ; git tag -v v0.3.0 ) $ echo "replace go.cypherpunks.ru/recfile => `pwd`/gorecfile" >> go.mod @@ -138,14 +138,33 @@ goredo includes redo-stamp, that really records the stamp in the .dep file, but it does not play any role later. It is stayed just for compatibility. - Removed .do can lead to permanent errors of its non existence~ - -That is true, because dependency on it was recorded previously. Is it -safe to assume that .do-less target now is an ordinary source-file? I -have no confidence in such behaviour. So it is user's decision how to -deal with it, probably it was just his inaccuracy mistake. If you really -want to get rid of that dependency knowledge for foo/bar target, then -just remove foo/.redo/bar.dep. + Can removed .do lead to permanent errors of its non existence?~ + +Yes, because dependency on it was recorded previously. Is it safe to +assume that .do-less target now is an ordinary source-file? I have no +confidence in such behaviour. So it is user's decision how to deal with +it, probably it was just his inaccuracy mistake. If you really want to +get rid of that dependency knowledge for foo/bar target, then just +remove foo/.redo/bar.dep. + + Does redo-always always rebuilds target?~ + +goredo, together with apenwarr/redo, rebuilds target once per run. +Always rebuilds during every redo invocation, but only once during it +building. http://news.dieweltistgarnichtso.net/bin/redo-sh.html#why-built-twice +has other opinion, that is why its redo-sh.tests/always_rebuild_1 will +fail. Rebuilding of always-ed targets even during the same build process +ruins any redo's usability in practice. + +For example if my .h file contains source code's version number, that is +git-describe's output and all my other files depends on that header, +then any redo-ifchange of .o will lead to git-describe execution, that +is rather heavy. Of course, because of either hashing or possible +redo-stamp-ing its dependants won't be rebuilt further, but build time +will be already ruined. If you need to rebuild TeX documents (case +mentioned in redo-sh's FAQ) until all references and numbers are ready, +then you must simply explicitly use while cycle in your .do, as +apenwarr/redo already suggests. STATE *goredo-state* diff --git a/t/.gitignore b/t/.gitignore new file mode 100644 index 0000000..141f812 --- /dev/null +++ b/t/.gitignore @@ -0,0 +1 @@ +/*.t diff --git a/t/clean.do b/t/clean.do new file mode 100644 index 0000000..530bbbe --- /dev/null +++ b/t/clean.do @@ -0,0 +1,5 @@ +rm -f *.t +[ -e redo-sh.tests ] || exit 0 +cd redo-sh.tests/ +redo-cleanup full >&2 +find . -type f ! -name test -delete diff --git a/t/prepare.do b/t/prepare.do new file mode 100644 index 0000000..1b94b48 --- /dev/null +++ b/t/prepare.do @@ -0,0 +1,17 @@ +tests=redo-sh.tests +[ -e $tests ] || { + cat >&2 <&2 +rm parallel_2.t diff --git a/t/runner.rc b/t/runner.rc new file mode 100755 index 0000000..b51d15d --- /dev/null +++ b/t/runner.rc @@ -0,0 +1,10 @@ +#!/bin/sh + +testdir=`dirname $0`/redo-sh.tests/`basename "${0%.t}"` +cd $testdir +testdir=`pwd` +test_description="`sed -n '2,/^$/p' test | sed 's/# //'`" +. $SHARNESS_TEST_SRCDIR/sharness.sh +cd $testdir +test_expect_success itself ./test +test_done diff --git a/usage.go b/usage.go index 2113491..48fee28 100644 --- a/usage.go +++ b/usage.go @@ -26,7 +26,7 @@ import ( ) const ( - Version = "0.4.1" + Version = "0.5.0" Warranty = `This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3 of the License. -- 2.44.0