# # add_file "tests/README" # # patch "ChangeLog" # from [7361aeda791395672a627ccd8ba617956c70e059] # to [1b2c6d18573b0f351bf3a8c9ac9aaa8da488e9c4] # # patch "monotone.cc" # from [2419f27fdb3cba77c658c0f4eac4d0b5026e1884] # to [2f5a30cfa0c3df50b96df475e834a5c38da81c2c] # # patch "tests/README" # from [] # to [fdbb3d9f63642092343e0ea58b7ee937f910103a] # # patch "testsuite.at" # from [9b5ee1d188f44dc8a2deb7b9a69a022f8dd2155e] # to [fde2283ff36e562055f019ac389b61299d2af057] # # patch "ui.cc" # from [bf5397526968d5189f12fef56ecd4990f622beef] # to [6e8f75fd303cb80cbb13e08abb0ad4a68b8ceedf] # --- ChangeLog +++ ChangeLog @@ -1,3 +1,7 @@ +2005-04-16 Sebastian Spaeth + + * add tests/README on how to create/run tests + 2005-04-16 Nathaniel Smith * tests/t_rename_dir_add_dir_with_old_name.at: XFAIL. @@ -110,6 +114,8 @@ * commands.cc (checkout): Tweak branch checking logic. (update): Make user explicitly switch branches. +####### Ancestor +======= end 2005-04-13 Nathaniel Smith * rcs_import.cc (import_cvs_repo): Check that user isn't trying to --- monotone.cc +++ monotone.cc @@ -133,16 +133,12 @@ } } - ~utf8_argv() - { - if (argv != NULL) - { - for (int i = 0; i < argc; ++i) - if (argv[i] != NULL) - free(argv[i]); - free(argv); - } - } +~utf8_argv() +{ + for (int i = 0; i < argc; ++i) + if (argv[i] != NULL) + free(argv[i]); + free(argv); }; // Stupid type system tricks: to use a cleanup_ptr, we need to know the return --- tests/README +++ tests/README @@ -0,0 +1,48 @@ +HOWTO make tests +================ + +Quick and dirty howto, to get you up to create and run tests. +Very early draft. Feel free to improve. + +Running tests: +-------------- +- Starting in the monotone main dir. After having './configure'd monotone you + can do 'make testsuite' to create 'testsuite'. Running './testsuite' will + run all tests. +- 'testsuite -l' lists the names and numbers of all available tests +- 'testsuite ' runs only test number n +- option -v will show the command outputs +- option -d will keep the testsuite.dir files for post-test debugging +- option -h is your friend :) + +Creating tests: +--------------- +- Copy and paste is your friend :) +- TODO: need more here... + + +Template for a test (name t_.at +------------------- + +AT_SETUP([brief test description goes here]) +MONOTONE_SETUP + +#the next lines (including AT_XFAIL_IF) state that the test is +#expected to fail as this is still a bug. Remove if it should pass! +# This test is a bug report. It is expected to fail +AT_XFAIL_IF(true) + +#AT_CHECK executes a shell command, second argument is the error +#return code we expect, third argument is the output we expect from +#stdout. use ignore if you don't care about the output. If oyu use +#stdout all following commands can use file 'stdout' for further +#processing. Same goes with 'stderr' as the last argument +#see autoconf tutorials +#e.g. http://www.gnu.org/software/autoconf/manual/autoconf-2.57/ +# html_node/autoconf_167.html for further information. +AT_CHECK(MONOTONE import foo, [], ignore, ignore) +... +... +... +AT_CLEANUP +(END) --- testsuite.at +++ testsuite.at @@ -548,7 +548,10 @@ m4_include(tests/t_cvsimport_samelog.at) m4_include(tests/t_sticky_branch.at) m4_include(tests/t_checkout_id_sets_branch.at) +<<<<<<< variant A m4_include(tests/t_netsync_largish_file.at) m4_include(tests/t_update_off_branch.at) m4_include(tests/t_setup_checkout_modify_new_dir.at) m4_include(tests/t_rename_dir_add_dir_with_old_name.at) +####### Ancestor +======= end --- ui.cc +++ ui.cc @@ -78,7 +78,8 @@ { } -void tick_write_count::write_ticks() +/// write_ticks flushes progress line with all tickers to 'clog' + * void tick_write_count::write_ticks() { string tickline = "\rmonotone:"; for (map::const_iterator i = ui.tickers.begin(); @@ -118,7 +119,7 @@ last_tick_len = curr_sz; unsigned int tw = terminal_width(); - if (tw && tickline.size() > tw) + if (tickline.size() > tw) { // first character in tickline is "\r", which does not take up any // width, so we add 1 to compensate.