# # add_file "tests/t_automate_ancestors.at" # # patch "ChangeLog" # from [2f5f957c42f95a35bd776407af355130d1f32ba9] # to [0224581c6a31cc101294b0a2473a084ee03fee8b] # # patch "tests/t_automate_ancestors.at" # from [] # to [c36a2bcf865fd4a911a178f824210a68fc2e6751] # # patch "testsuite.at" # from [4e74e752f40c74925d7279cf87626cfbc66cb726] # to [16b7aa45e0423c10727463ab863b8ba3402c715a] # --- ChangeLog +++ ChangeLog @@ -1,4 +1,10 @@ 2005-04-20 Sebastian Spaeth + * testuite.at: + * t_automate_ancestors.at: new test; automate ancestors. This is still + _failing_ as a) it outputs empty newlines when no ancestor exists and + b) does not output all ancestors if multiple ids are supplied as input + +2005-04-20 Sebastian Spaeth * commands.cc: * automate.cc: new command: automate ancestors --- tests/t_automate_ancestors.at +++ tests/t_automate_ancestors.at @@ -0,0 +1,92 @@ +AT_SETUP([automate ancestors]) +MONOTONE_SETUP + +# This will still fail due to two slight errors: +# - if no ancestors exist, it prints out an empty newline instead of nothing. +# - if multiple revids are given as input it outputs not all ancestors +# This test is a bug report. +AT_XFAIL_IF(true) + + +AT_CHECK(MONOTONE automate ancestors c7539264e83c5d6af4c792f079b5d46e9c128665, [1], [ignore], [ignore]) + +# A +# / \ +# B C +# |\ +# D E +# \/ +# F + +ADD_FILE(testfile, [A +]) +COMMIT(testbranch) +REV_A=`BASE_REVISION` + +SET_FILE(testfile, [B +]) +COMMIT(testbranch) +REV_B=`BASE_REVISION` + +REVERT_TO($REV_A) + +SET_FILE(testfile, [C +]) +COMMIT(testbranch) +REV_C=`BASE_REVISION` + +SET_FILE(testfile, [D +]) +COMMIT(testbranch) +REV_D=`BASE_REVISION` + +REVERT_TO($REV_C) + +ADD_FILE(otherfile, [E +]) +COMMIT(testbranch) +REV_E=`BASE_REVISION` + +AT_CHECK(MONOTONE explicit_merge $REV_D $REV_E testbranch, [], [ignore], [ignore]) +AT_CHECK(MONOTONE update, [], [ignore], [ignore]) +REV_F=`BASE_REVISION` + +AT_CHECK(test $REV_F != $REV_D) +AT_CHECK(test $REV_F != $REV_E) + +# Now do some checks + +#next test would still fail as it outputs an empty line. Why? descendents does not output an empty line and this is just copy'n paste??? +AT_CHECK(MONOTONE automate ancestors $REV_A, [], [], [ignore]) + +AT_CHECK(MONOTONE automate ancestors $REV_B, [], [stdout], [ignore]) +AT_CHECK(CANONICALISE(stdout)) +AT_CHECK(echo $REV_A > tmp) +AT_CHECK(cmp tmp stdout) + +AT_CHECK(MONOTONE automate ancestors $REV_E, [], [stdout], [ignore]) +AT_CHECK(CANONICALISE(stdout)) +AT_CHECK(echo $REV_C > tmp) +AT_CHECK(cmp tmp stdout) + +AT_CHECK(echo $REV_D > tmp) +AT_CHECK(echo $REV_E >> tmp) +AT_CHECK(sort tmp > tmp2) +AT_CHECK(MONOTONE automate ancestors $REV_F, [], [stdout], [ignore]) +AT_CHECK(CANONICALISE(stdout)) +AT_CHECK(cmp tmp2 stdout) + +AT_CHECK(echo $REV_D > tmp) +AT_CHECK(echo $REV_C >> tmp) +AT_CHECK(echo $REV_F >> tmp) +AT_CHECK(sort tmp > tmp2) +AT_CHECK(MONOTONE automate ancestors $REV_D $REV_F, [], [stdout], [ignore]) +AT_CHECK(CANONICALISE(stdout)) +AT_CHECK(cmp tmp2 stdout) + +AT_CHECK(MONOTONE automate ancestors $REV_A $REV_B $REV_C, [], [stdout], [ignore]) +AT_CHECK(CANONICALISE(stdout)) +AT_CHECK(echo $REV_A > tmp) +AT_CHECK(cmp tmp stdout) + +AT_CLEANUP --- testsuite.at +++ testsuite.at @@ -536,6 +536,7 @@ m4_include(tests/t_dropkey_1.at) m4_include(tests/t_dropkey_2.at) m4_include(tests/t_rename_attr.at) +m4_include(tests/t_automate_ancestors.at) m4_include(tests/t_automate_descendents.at) m4_include(tests/t_automate_erase_ancestors.at) m4_include(tests/t_automate_toposort.at)