From 3d1124cb538b30eb33c535205cc979ba454f0cc8 Mon Sep 17 00:00:00 2001 From: Josef 'Jeff' Sipek Date: Fri, 29 Feb 2008 18:02:42 -0500 Subject: [PATCH] regression: add tests for guilt-header Signed-off-by: Josef 'Jeff' Sipek --- regression/t-028.out | 42 ++++++++++++++++++++++++++++++++++++++++++ regression/t-028.sh | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 regression/t-028.out create mode 100755 regression/t-028.sh diff --git a/regression/t-028.out b/regression/t-028.out new file mode 100644 index 0000000..a5c8d8f --- /dev/null +++ b/regression/t-028.out @@ -0,0 +1,42 @@ +% setup_repo +% guilt-header (no patches) +No patches applied. +% guilt-push -a +Applying patch..modify +Patch applied. +Applying patch..add +Patch applied. +Applying patch..remove +Patch applied. +Applying patch..mode +Patch applied. +% guilt-new -s -m "blah blah blah" patch-with-some-desc +Now at mode. +Applying patch..patch-with-some-desc +Patch applied. +% list_files +d .git/patches +d .git/patches/master +f 22930c6d1f1938f298a4fca51c57e4b47171db21 .git/patches/master/mode +f 5d8322e2edfca0589cc24df9c09985a544591a2c .git/patches/master/add +f 8bdf2abdb045e63bb877890db12afcd5a2f023eb .git/patches/master/remove +f afd9714724b096e4e81870e0372c1b65bfcf3279 .git/patches/master/status +f bc9ab2e0f5db99d483961e956e814d963f0309f8 .git/patches/master/modify +f c87bb44fd4f1c10033b13562be50006f57c98eab .git/patches/master/series +f e4a20695c36bc826bad047d69ff3315df7062bf4 .git/patches/master/patch-with-some-desc +% guilt-header +blah blah blah + +Signed-off-by: Commiter Name + +% guilt-header modify +% guilt-header add +% guilt-header remove +% guilt-header mode +% guilt-header patch-with-some-desc +blah blah blah + +Signed-off-by: Commiter Name + +% guilt-header non-existant +Patch non-existant is not in the series diff --git a/regression/t-028.sh b/regression/t-028.sh new file mode 100755 index 0000000..adfcde0 --- /dev/null +++ b/regression/t-028.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# +# Test the header code +# + +source $REG_DIR/scaffold + +begin "setup_repo" +setup_repo + +function fixup_time_info +{ + touch -d "$GIT_COMMITTER_DATE" ".git/patches/master/$1" +} + +begin "guilt-header (no patches)" +shouldfail guilt-header 2>&1 + +begin "guilt-push -a" +guilt-push -a + +begin "guilt-new -s -m \"blah blah blah\" patch-with-some-desc" +guilt-new -s -m "blah blah blah" patch-with-some-desc +guilt-pop +fixup_time_info patch-with-some-desc +guilt-push + +begin "list_files" +list_files + +begin "guilt-header" +guilt-header + +guilt-series | while read n; do + begin "guilt-header $n" + guilt-header $n +done + +begin "guilt-header non-existant" +shouldfail guilt-header non-existant 2>&1 + +# FIXME: how do we check that -e works? -- 2.11.4.GIT