[parted-devel] [PATCH] No longer require "srcdir=." when running a test manually.

Jim Meyering jim at meyering.net
Fri May 11 12:31:59 UTC 2007


Thanks for the quick feedback.

Otavio Salvador <otavio at debian.org> wrote:
>> +init.sh: Makefile.in
>> +	echo 'srcdir=$(srcdir)'          > $@-t
>> +	echo '. $$srcdir/test-lib.sh' >> $@-t
>> +	mv $@-t $@
>                                   ^^^^^^^^^^ bad indentation

True.  Good reason not to use such alignment: it rots too easily.
Here's a patch with no chance for indentation:

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 2948ae2..1d2a043 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -8,3 +8,9 @@ TESTS_ENVIRONMENT = \

 EXTRA_DIST = \
   $(TESTS) test-lib.sh
+
+CLEANFILES = init.sh
+all: init.sh
+init.sh: Makefile.in
+	( echo 'srcdir=$(srcdir)'; echo '. $$srcdir/test-lib.sh' ) > $@-t
+	mv $@-t $@

>> diff --git a/tests/t0000-basic.sh b/tests/t0000-basic.sh
>> index 6049e15..2d5daac 100755
>> --- a/tests/t0000-basic.sh
>> +++ b/tests/t0000-basic.sh
>> @@ -26,7 +26,7 @@ fi
>>
>>  test_description='Test the very basics part #1.'
>>
>> -. $srcdir/test-lib.sh
>> +. ./init.sh
>>
>>  # FIXME: is id -u portable enough?
>>  uid=`id -u` || uid=1
>> @@ -88,9 +88,7 @@ Warning: The existing disk label on DEVICE will be destroyed and all\
>>  Yes/No? y
>>  New disk label type?  [msdos]?
>>  EOF
>> -test_expect_success \
>> -    'create expected output file' \
>> -    'test $fail = 0'
>> +test_expect_success 'create expected output file' 'test $fail = 0'
>
> This shouldn't be done on same patch.

Considering that is such a small, zero-semantic-content change,
I deliberately chose not to put it in a patch all by itself.
IMHO, it's not even worth a log entry.



More information about the parted-devel mailing list