Re: Test script style (Re: [PATCH 08/18] git notes merge: Initial implementation handling trivial merges only)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jonathan Nieder <jrnieder@xxxxxxxxx> writes:

> Thoughts?  Would it make sense to eventually put something like this
> in t/CodingStyle or nearby?

> Tests:
> 	test_expect_success|failure '... some claim...' '
> 		Commands to test that claim.
> 		Could do all sorts of things, as long as they do not
> 		disturb the invariants established by the
> 		constant_data and setup sections.
> 	'

In practice, I am afraid it would take a lot more discipline than any of
the current test script does to actually preserve the invariants.  But if
we can arrange that, it would be ideal.  For one thing, it would finally
make the subtest skip feature of GIT_SKIP_TESTS usable.

An obvious way to do so would be

 Tests:
 	test_expect_success|failure '... some claim...' '
+ 		Commands to establish a known precondition without
+		depending on the state left by previous steps.
 		Commands to test that claim.
-		Could do all sorts of things, as long as they do not
-		disturb the invariants established by the
-		constant_data and setup sections.
 	'

but if done naively, the time it takes to re-establish a known
precondition for each and every test would add up to substantial
overhead.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]