Skip to content

Add submodule test harness

Jens Lehmann git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 12 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4test-lib: add test_dir_is_empty()t/test-lib-functions.sh+11 -05 replies
2/4Submodules: Add the lib-submodule-update.sh test libraryt/lib-submodule-update.sh+627 -07 replies
3/4checkout: call the new submodule update test frameworkt/t2013-checkout-submodule.sh+5 -00 replies
4/4apply: add t4137 for submodule updatest/t4137-apply-submodule.sh+20 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC/PATCH 0/4] Add submodule test harness

So here is my proposal for a single test harness for submodule updates. It is intended to be easily applicable to all work tree manipulating commands. The current version tests the status quo (and it documents two bugs in current Git). This framework will be extended to cover recursive submodule update too in a later series.

The first patch adds a simple helper function to the test lib which makes it easier to test for an empty submodule directory.

The second patch contains the heavy lifting, it adds the test framework for switching submodules. Currently only transitions without merge conflicts are tested for, I intend to add others producing merge conflicts in a follow-up series.

The third and forth patch show how to apply this framework to a simple command (checkout) and a more complicated case where a helper function is used to execute a preparing command (diff) which produces the input for the then to-be-tested command (apply).

I'm currently working on adding this harness to more commands. read-tree and reset are finished, merge and pull still show some oddities when used with the --no-ff option, also cherry-pick and checkout-index are not working as expected yet. And then there are am, apply, bisect, rebase, revert & stash apply which still need to be covered.

Jens Lehmann (4):
test-lib: add test_dir_is_empty()
Submodules: Add the lib-submodule-update.sh test library
checkout: call the new submodule update test framework
apply: add t4137 for submodule updates

 t/lib-submodule-update.sh     | 627 ++++++++++++++++++++++++++++++++++++++++++
 t/t2013-checkout-submodule.sh |   5 +
 t/t4137-apply-submodule.sh    |  20 ++
 t/test-lib-functions.sh       |  11 +
 4 files changed, 663 insertions(+)
 create mode 100755 t/lib-submodule-update.sh
 create mode 100755 t/t4137-apply-submodule.sh
Signature · 1 line
1.9.1.327.g3d8d896