<feed xmlns='http://www.w3.org/2005/Atom'>
<title>coreutils/tests/mkdir/perm, branch master</title>
<subtitle>Mirror of https://https.git.savannah.gnu.org/git/coreutils.git/
</subtitle>
<id>https://git.shady.money/coreutils/atom?h=master</id>
<link rel='self' href='https://git.shady.money/coreutils/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/'/>
<updated>2012-08-30T16:55:59Z</updated>
<entry>
<title>tests: add .sh and .pl suffixes to shell and perl tests, respectively</title>
<updated>2012-08-30T16:55:59Z</updated>
<author>
<name>Stefano Lattarini</name>
<email>stefano.lattarini@gmail.com</email>
</author>
<published>2012-08-30T12:13:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=9eb4c31eb78c28dd9f72d1cbb940270311be343c'/>
<id>urn:sha1:9eb4c31eb78c28dd9f72d1cbb940270311be343c</id>
<content type='text'>
Not only this shrinks the size of the generated Makefile (from &gt; 6300
lines to ~3000), but will allow further simplifications in future
changes.

* tests/Makefile.am (TEST_EXTENSIONS): Add '.sh' and '.pl'.
(PL_LOG_COMPILER, SH_LOG_COMPILER): New, still defined simply to
$(LOG_COMPILER) for the time being.
(TESTS, root_tests): Adjust as described.
* All tests: Rename as described.
</content>
</entry>
<entry>
<title>tests: convert nearly all `...` expressions to $(...)</title>
<updated>2012-04-04T10:20:56Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2012-04-03T18:32:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=e43d30eab3215bc9ff49ec7db3d3e2baa95ba070'/>
<id>urn:sha1:e43d30eab3215bc9ff49ec7db3d3e2baa95ba070</id>
<content type='text'>
Exempt init.sh because it runs before we're assured to have a
shell that groks $(...).  Exempt *.mk because "$" would have to
be doubled, and besides, any `...` expression in a .mk file is
almost certainly evaluated before init.sh is run.  Finally, also
exempt the perl-based tests, because perl's `...` cannot be
converted to $(...).  Do that by running this command:

git grep -l '`.*`' tests \
  | grep -Ev 'init\.sh|\.mk$' | xargs grep -Lw perl \
  | xargs perl -pi -e 's/`(.*?)`/\$($1)/g'

One minor fix-up change was required after that, due to how
quoting differs:
diff --git a/tests/chmod/equals b/tests/chmod/equals
-    expected_perms=$(eval 'echo \$expected_'$dest)
+    expected_perms=$(eval 'echo $expected_'$dest)

Another was to make these required quoting adjustments:
diff --git a/tests/misc/stty b/tests/misc/stty
...
-  rev=$(eval echo "\\\$REV_$opt")
+  rev=$(eval echo "\$REV_$opt")
...
-      rev1=$(eval echo "\\\$REV_$opt1")
-      rev2=$(eval echo "\\\$REV_$opt2")
+      rev1=$(eval echo "\$REV_$opt1")
+      rev2=$(eval echo "\$REV_$opt2")

Also, transform two files that were needlessly excluded above:
(both use perl, but are mostly bourne shell)

  perl -pi -e 's/`(.*?)`/\$($1)/g' \
    tests/du/long-from-unreadable tests/init.cfg
</content>
</entry>
<entry>
<title>maint: use single copyright year range</title>
<updated>2012-01-27T10:35:24Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2012-01-27T10:35:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=d7878454cd02518959b0d6036db3a5b6ff00ca57'/>
<id>urn:sha1:d7878454cd02518959b0d6036db3a5b6ff00ca57</id>
<content type='text'>
Run "make update-copyright".
</content>
</entry>
<entry>
<title>tests: change `...' to '...' on lines not matching /[=\$]/</title>
<updated>2012-01-09T20:50:08Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2012-01-07T16:47:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=dd0e4c5621ca2fa9255aef4eee0e7cf41cd335d2'/>
<id>urn:sha1:dd0e4c5621ca2fa9255aef4eee0e7cf41cd335d2</id>
<content type='text'>
Exempt lines with '$' or '=', since those are prone to improper
conversion.  Run this:
  git grep -l "\`[^']*'" tests \
   |xargs perl -pi -e '/[=\$]/ and next;s/\`([^'\''"]*?'\'')/'\''$1/g'
</content>
</entry>
<entry>
<title>maint: update all copyright year number ranges</title>
<updated>2012-01-01T09:04:06Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2012-01-01T08:47:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=5111aa42968262bd4d44eeca277b194020bb5007'/>
<id>urn:sha1:5111aa42968262bd4d44eeca277b194020bb5007</id>
<content type='text'>
Run "make update-copyright".
</content>
</entry>
<entry>
<title>maint: update all copyright year number ranges</title>
<updated>2011-01-01T21:16:47Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2011-01-01T10:37:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=9d6231ef2a74671fa08bc263519edfe46e8d1805'/>
<id>urn:sha1:9d6231ef2a74671fa08bc263519edfe46e8d1805</id>
<content type='text'>
Run "make update-copyright".
</content>
</entry>
<entry>
<title>tests: substitute the single-program $VERBOSE/--version uses</title>
<updated>2010-11-17T20:45:51Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2010-11-17T20:35:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=293c37b9061c1afd0acd143bbded637a8f00b3a0'/>
<id>urn:sha1:293c37b9061c1afd0acd143bbded637a8f00b3a0</id>
<content type='text'>
Automatically make all of the changes like this:

  -test "$VERBOSE" = yes &amp;&amp; chgrp --version
  +print_ver_ chgrp

git grep -l 'VERBOSE.*--version'|xargs perl -pi -e \
  's/test "\$VERBOSE" = yes &amp;&amp; (\w+) --version/print_ver_ $1/'
</content>
</entry>
<entry>
<title>tests: convert first batch of tests from test-lib.sh to init.sh</title>
<updated>2010-11-17T19:48:57Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2010-11-14T10:05:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=f38becab02472e6872048a1951b249b2a3c054df'/>
<id>urn:sha1:f38becab02472e6872048a1951b249b2a3c054df</id>
<content type='text'>
Initially, I did this,
git grep -l srcdir/test-lib.sh|xargs perl -p0i -e '~180-byte script'
but that line would have been much longer than the maximum permitted
by coreutils' commit hook, and wasn't readable besides, so here's a
more readable version:

lhs=$(printf '%s\\n' \
'if test "$VERBOSE" = yes; then' \
'  set -x' \
'  touch --version' \
'fi' \
'' \
'. $srcdir/test-lib.sh' \
  | sed 's/\$/\\\$/g;s/touch/(\\w+)/')

rhs=$(printf '%s\\n' \
'. "${srcdir=.}/init.sh"; path_prepend_ ../src' \
'test "$VERBOSE" = yes &amp;&amp; FIXME --version' \
  | sed 's/\$/\\\$/g;s/FIXME/\$1/')

git grep -l srcdir/test-lib.sh|xargs perl -p0i -e "s,$lhs,$rhs,"
</content>
</entry>
<entry>
<title>maint: update all FSF copyright year lists to include 2010</title>
<updated>2010-01-01T13:06:47Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2010-01-01T09:56:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=1aa17dc89b3f313697661541adca0aa0defbdc09'/>
<id>urn:sha1:1aa17dc89b3f313697661541adca0aa0defbdc09</id>
<content type='text'>
Use this command:
git ls-files | grep -v COPYING \
  | xargs env UPDATE_COPYRIGHT_USE_INTERVALS=1 \
      build-aux/update-copyright
</content>
</entry>
<entry>
<title>tests: factor 350 fail=0 initializations into test-lib.sh</title>
<updated>2009-10-30T11:50:12Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2009-10-30T09:50:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=3c88587b2eadee11413f4207abbbf13af07c438d'/>
<id>urn:sha1:3c88587b2eadee11413f4207abbbf13af07c438d</id>
<content type='text'>
Run this command to remove the factored-out "fail=0" lines.
perl -ni -e '/^fail=0$/ or print' $(g grep -l '^fail=0$')
* tests/test-lib.sh: Initialize fail=0 here, not in 300+ scripts.
* tests/...: nearly all bourne shell scripts
Suggested by Eric Blake.
</content>
</entry>
</feed>
