]> Cypherpunks.ru repositories - goredo.git/commitdiff
redo-sh tests under github.com/chriscool/sharness v0.5.0
authorSergey Matveev <stargrave@stargrave.org>
Mon, 14 Dec 2020 17:58:47 +0000 (20:58 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Mon, 14 Dec 2020 19:04:27 +0000 (22:04 +0300)
README
t/.gitignore [new file with mode: 0644]
t/clean.do [new file with mode: 0644]
t/prepare.do [new file with mode: 0644]
t/runner.rc [new file with mode: 0755]
usage.go

diff --git a/README b/README
index 222c94ae2ba99c09a29fd60e05393b6a1757338c..d49c3cc020e7ef506840eb72492e68cd031f617e 100644 (file)
--- 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 (file)
index 0000000..141f812
--- /dev/null
@@ -0,0 +1 @@
+/*.t
diff --git a/t/clean.do b/t/clean.do
new file mode 100644 (file)
index 0000000..530bbbe
--- /dev/null
@@ -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 (file)
index 0000000..1b94b48
--- /dev/null
@@ -0,0 +1,17 @@
+tests=redo-sh.tests
+[ -e $tests ] || {
+    cat >&2 <<EOF
+No $tests found. Provide them manually, for example with:
+    $ git clone http://news.dieweltistgarnichtso.net/bin.git
+    $ cd bin
+    $ git checkout 6e45ad16ad0513d1a6a4a0539a9d01d39d3e7490
+    $ ln -s `pwd`/redo-sh.tests /path/to/goredo/t/redo.sh.tests
+EOF
+    exit 1
+}
+( cd $tests ; ls ) | while read testname ; do
+    ln -s runner.rc ${testname}.t
+done
+
+echo Skipping parallel_2.t, that assumes --jobs option availability >&2
+rm parallel_2.t
diff --git a/t/runner.rc b/t/runner.rc
new file mode 100755 (executable)
index 0000000..b51d15d
--- /dev/null
@@ -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
index 2113491f7e6d8d8bba01d305ca00b6ec1ed65a80..48fee289996057c06fe62fcf06cdf3b3e1c32017 100644 (file)
--- 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.