# # # delete "tests/t_annotate_branch_collision.at" # # delete "tests/t_annotate_copy_all.at" # # delete "tests/t_annotate_lineage_dependent.at" # # delete "tests/t_annotate_split_line.at" # # delete "tests/t_automate_attributes.at" # # delete "tests/t_automate_certs.at" # # delete "tests/t_automate_stdio.at" # # delete "tests/t_commit_message_file.at" # # delete "tests/t_cvsimport3.at" # # delete "tests/t_cvsimport_deleted_invar.at" # # delete "tests/t_cvsimport_drepper.at" # # delete "tests/t_cvsimport_drepper2.at" # # delete "tests/t_db_kill_branch_certs_locally.at" # # delete "tests/t_drop_vs_dropadd.at" # # delete "tests/t_drop_vs_patch_rename.at" # # delete "tests/t_existsonpath.at" # # delete "tests/t_lua_includedir.at" # # delete "tests/t_merge_manual.at" # # delete "tests/t_monotone_up.at" # # delete "tests/t_netsync_error.at" # # delete "tests/t_netsync_exclude.at" # # delete "tests/t_netsync_exclude_default.at" # # delete "tests/t_netsync_globs.at" # # delete "tests/t_netsync_permissions.at" # # delete "tests/t_netsync_read_permissions.at" # # delete "tests/t_options.at" # # delete "tests/t_rcfile_dir.at" # # delete "tests/t_rcfile_stdin.at" # # delete "tests/t_restricted_commit_with_inodeprints.at" # # delete "tests/t_revert_restrict.at" # # delete "tests/t_selector_later_earlier.at" # # delete "tests/t_set_default.at" # # delete "tests/t_status.at" # # delete "tests/t_unidiff3.at" # # delete "tests/t_unreadable__MTN.at" # # delete "tests/t_update_with_blocked_rename.at" # # delete "tests/t_update_with_pending_add.at" # # delete "tests/t_update_with_pending_drop.at" # # delete "tests/t_update_with_pending_rename.at" # # rename "tests/importing_CVS_files" # to "tests/importing_cvs_files" # # rename "tests/importing_CVS_files_with_identical_logs" # to "tests/importing_cvs_files_with_identical_logs" # # rename "tests/importing_a_CVS_file_with_one_version" # to "tests/importing_a_cvs_file_with_one_version" # # rename "tests/netsync.lua" # to "tests/common/netsync-hooks.lua" # # rename "tests/netsync_with_notes.lua" # to "tests/common/netsync-hooks_with_notes.lua" # # add_dir "tester-tests/cleanup-1" # # add_dir "tester-tests/cleanup-2" # # add_dir "tests/--rcfile=-" # # add_dir "tests/--rcfile=directory" # # add_dir "tests/a_tricky_cvs_repository_with_tags" # # add_dir "tests/a_tricky_cvs_repository_with_tags/e" # # add_dir "tests/a_tricky_cvs_repository_with_tags/e/t" # # add_dir "tests/a_tricky_cvs_repository_with_tags/e/t/libasm" # # add_dir "tests/a_tricky_cvs_repository_with_tags/e/t/libelf-po" # # add_dir "tests/annotate_where_line_splits" # # add_dir "tests/annotate_where_lineage_depends_on_traversal" # # add_dir "tests/annotate_where_one_parent_is_full_copy" # # add_dir "tests/automate_attributes" # # add_dir "tests/automate_certs" # # add_dir "tests/automate_stdio" # # add_dir "tests/check_later_and_earlier_selectors" # # add_dir "tests/checking_a_few_command_specific_options" # # add_dir "tests/commit_with_--message-file" # # add_dir "tests/cvs_import,_deleted_file_invariant" # # add_dir "tests/cvs_import,_deleted_file_invariant/attest" # # add_dir "tests/db_kill_branch_certs_locally_command" # # add_dir "tests/diff_against_empty_file" # # add_dir "tests/fail_cleanly_on_unreadable__MTN_options" # # add_dir "tests/get_netsync_read_permitted" # # add_dir "tests/importing_a_small,_real_cvs_repository" # # add_dir "tests/importing_a_small,_real_cvs_repository/e" # # add_dir "tests/importing_a_small,_real_cvs_repository/e/src" # # add_dir "tests/importing_a_small,_real_cvs_repository/e/src/Attic" # # add_dir "tests/importing_a_small,_real_cvs_repository/e/tests" # # add_dir "tests/importing_cvs_with_vendor_imports_and_branches" # # add_dir "tests/include()_and_includedir()_lua_functions" # # add_dir "tests/lua_function_existsonpath" # # add_dir "tests/merge((drop_a),_(drop_a,_add_a))" # # add_dir "tests/merge((drop_a),_(rename_a_b,_patch_b))" # # add_dir "tests/merge_manual_file" # # add_dir "tests/mtn_up" # # add_dir "tests/netsync,--exclude,defaults" # # add_dir "tests/netsync,--set-default" # # add_dir "tests/netsync_badhost_gives_nice_error" # # add_dir "tests/netsync_permissions" # # add_dir "tests/netsync_permissions/closed" # # add_dir "tests/netsync_permissions/open" # # add_dir "tests/netsync_with_globs" # # add_dir "tests/restricted_commit_with_inodeprints" # # add_dir "tests/revert_works_with_restrictions" # # add_dir "tests/serve_pull_with_--exclude" # # add_dir "tests/status" # # add_dir "tests/update_with_blocked_rename" # # add_dir "tests/update_with_pending_add" # # add_dir "tests/update_with_pending_drop" # # add_dir "tests/update_with_pending_rename" # # add_file "tester-tests/cleanup-1/__driver__.lua" # content [d16b6e520060842d1cf59e441e4b0c6f0f1f3302] # # add_file "tester-tests/cleanup-2/__driver__.lua" # content [6438a8657a56d840d49cd65d44ceca2cb42d7597] # # add_file "tests/--rcfile=-/__driver__.lua" # content [3d862d0597137e0beeb17b1eb0a36b6e9f355bf8] # # add_file "tests/--rcfile=-/foo.rc" # content [f6d4506102b8067fb6bbd3202467a51456d3bd19] # # add_file "tests/--rcfile=directory/__driver__.lua" # content [bd0b57aa45e0fdefde34917ed6ce3908009c4543] # # add_file "tests/--rcfile=directory/aaa.rc" # content [2f9056f39d5bcc01e635cf32ef9ff7eb83af4103] # # add_file "tests/--rcfile=directory/aba.rc" # content [5618e7aa67b39d372a68a74c37ff127743ebe520] # # add_file "tests/--rcfile=directory/bbb.rc" # content [b4a560359d1176679511dda9a06eaf7d4d311309] # # add_file "tests/a_tricky_cvs_repository_with_tags/__driver__.lua" # content [86561dd2f315e65a2a13a489c3a6bf2c28ed195d] # # add_file "tests/a_tricky_cvs_repository_with_tags/e/t/libasm/ChangeLog,v" # content [2d21143350b0eb78840cb50fdb5fac09d80d6107] # # add_file "tests/a_tricky_cvs_repository_with_tags/e/t/libelf-po/POTFILES.in,v" # content [db924e31608b16cb24e37888c23e66ba6ef17724] # # add_file "tests/a_tricky_cvs_repository_with_tags/test.manifest" # content [0874e900d0d1bd826b1eec6e75f5908991567b72] # # add_file "tests/a_tricky_cvs_repository_with_tags/test.tags" # content [3dc70bde8e7a37132a0b98638a32be4494477832] # # add_file "tests/annotate_where_line_splits/__driver__.lua" # content [c046225903e7f31d84fb5e554343d36cfaf5d2f1] # # add_file "tests/annotate_where_line_splits/merge.lua" # content [6507eba7dcee28eee85e156535b949b8901c0e6e] # # add_file "tests/annotate_where_lineage_depends_on_traversal/__driver__.lua" # content [53cd0f6f35b9494b6722d1351c283d982b4c1107] # # add_file "tests/annotate_where_lineage_depends_on_traversal/merge.lua" # content [dc4a4f9d5916b1498bc79981a845b3d23d19475e] # # add_file "tests/annotate_where_one_parent_is_full_copy/__driver__.lua" # content [e9ba290d9c0024f58932e9235960e4a4fb3dc33a] # # add_file "tests/automate_attributes/__driver__.lua" # content [def3ba933ed0d52e9aedaa8e1fd0373bcf903c55] # # add_file "tests/automate_certs/__driver__.lua" # content [53f81a0517365da4a4ce52b6b581a23603c0175e] # # add_file "tests/automate_certs/expected" # content [f389ef9089174e2ebd4e143374186453abf8271a] # # add_file "tests/automate_stdio/__driver__.lua" # content [56f4bbe463ab7f5f88ee45e3b7add9531fc6d732] # # add_file "tests/check_later_and_earlier_selectors/__driver__.lua" # content [f3d70f749d65fd0e10b3bd30f7e0740260bab6de] # # add_file "tests/checking_a_few_command_specific_options/__driver__.lua" # content [b47bc864decd4066304266671df4bbe8c0190274] # # add_file "tests/commit_with_--message-file/__driver__.lua" # content [d91fb65c3bb372749170c9c321d3bafb4c34de87] # # add_file "tests/common/cvs.lua" # content [df8dd4548b02e5ce850067226861b4dbe6891932] # # add_file "tests/common/netsync.lua" # content [b4979ef69470997f5edd77961c1657d78cb0b6fd] # # add_file "tests/cvs_import,_deleted_file_invariant/__driver__.lua" # content [cd41da4b2edee3b1458d06624580624aff8ce54d] # # add_file "tests/cvs_import,_deleted_file_invariant/attest/afile,v" # content [577b48eae4a753ecb856aac0daa93d768afd308a] # # add_file "tests/cvs_import,_deleted_file_invariant/attest/bfile,v" # content [593f9627ffe697c38141344bd4fb36f99f936234] # # add_file "tests/cvs_import,_deleted_file_invariant/attest/cfile,v" # content [871b0d2f4393db39e063b4cfb8d5450589eaedd2] # # add_file "tests/db_kill_branch_certs_locally_command/__driver__.lua" # content [f7fbe9521eb4e0043364af4c15c44984078d0a9e] # # add_file "tests/diff_against_empty_file/__driver__.lua" # content [e3e289096323d3c58e05e4b8cc00568cc9635d7c] # # add_file "tests/fail_cleanly_on_unreadable__MTN_options/__driver__.lua" # content [5fb46803b3c7ede9ea819043d101e008eb52bf5e] # # add_file "tests/get_netsync_read_permitted/__driver__.lua" # content [bea5d1cd297d4cdeb576b7f6fcd8bef73c10c111] # # add_file "tests/get_netsync_read_permitted/read-permissions" # content [a1f44891f56511b9bf03409e737746b4ce5f94c2] # # add_file "tests/importing_a_small,_real_cvs_repository/__driver__.lua" # content [831c69c344c54019c8e3f68b2b849878c62bcadf] # # add_file "tests/importing_a_small,_real_cvs_repository/e/src/Attic/objdump.c,v" # content [7216d24537572122cc9492dbfcbb498c17eec273] # # add_file "tests/importing_a_small,_real_cvs_repository/e/tests/asm-tst3.c,v" # content [9ff963f952db0882b64ea24c41ef95af81fe1bf2] # # add_file "tests/importing_a_small,_real_cvs_repository/e/tests/asm-tst4.c,v" # content [46bb1be8917640b49b9c412914555c06bdd0e7de] # # add_file "tests/importing_a_small,_real_cvs_repository/test.manifest" # content [239a81e972fbdea494bf9d1ecbae1863c7cf2f9d] # # add_file "tests/importing_cvs_with_vendor_imports_and_branches/__driver__.lua" # content [9738d252a0f89a8870d9420ca1ba06f5048a25ff] # # add_file "tests/include()_and_includedir()_lua_functions/__driver__.lua" # content [8a99da73447e7e10466652c3e38c3d93da7bfa1c] # # add_file "tests/include()_and_includedir()_lua_functions/aaa.rc" # content [2f9056f39d5bcc01e635cf32ef9ff7eb83af4103] # # add_file "tests/include()_and_includedir()_lua_functions/aba.rc" # content [5618e7aa67b39d372a68a74c37ff127743ebe520] # # add_file "tests/include()_and_includedir()_lua_functions/bbb.zz" # content [b4a560359d1176679511dda9a06eaf7d4d311309] # # add_file "tests/lua_function_existsonpath/__driver__.lua" # content [9021eacf7602e1515221c3b439c9ae4381cf4929] # # add_file "tests/lua_function_existsonpath/test.lua" # content [af3caa7d2d9dfd1d63b965edb61b77e96d83743c] # # add_file "tests/merge((drop_a),_(drop_a,_add_a))/__driver__.lua" # content [69c464e4552692a45d837b745fcb0687ed2060e6] # # add_file "tests/merge((drop_a),_(rename_a_b,_patch_b))/__driver__.lua" # content [6fd049ff377e80271b69e41a84ccc19fe6d2d0e7] # # add_file "tests/merge_manual_file/__driver__.lua" # content [0f88464cc74c9dc9631a81b607d86c3f830dd2cb] # # add_file "tests/merge_manual_file/binary.lua" # content [8165660330a920f60163cebd9c45ca67d934c463] # # add_file "tests/merge_manual_file/left.bmp" # content [3542130e2e1612698fd0b27571683c152c581dc1] # # add_file "tests/merge_manual_file/parent.bmp" # content [58d67f975cb88e05fefe4b7d1ed6d7457afdce87] # # add_file "tests/merge_manual_file/right.bmp" # content [f76ff16aa2dc108cf26312fb3ef02eba8c318318] # # add_file "tests/merge_manual_file/text.lua" # content [7a47dcb82afd7a6251eeed4db360c2f19279ee1c] # # add_file "tests/mtn_up/__driver__.lua" # content [28537ed44bab1e3edc470217a84573ba36d3090c] # # add_file "tests/netsync,--exclude,defaults/__driver__.lua" # content [af272762b9ba75768308bd021b2992bee7599531] # # add_file "tests/netsync,--set-default/__driver__.lua" # content [4c5eb0ab9568e85c306b57953b89f4c2b8830ab8] # # add_file "tests/netsync_badhost_gives_nice_error/__driver__.lua" # content [5f30e23ba6cf8fcbdf56655180684b0fe762eb52] # # add_file "tests/netsync_permissions/__driver__.lua" # content [2a9a12c8b7b2ad5ee4152db77bc6a3d5d18771d9] # # add_file "tests/netsync_permissions/closed/read-permissions" # content [b9bae8e35f085049ddfa0cfe92308a79998ad6d0] # # add_file "tests/netsync_permissions/closed/write-permissions" # content [7c7c39a59bd0707ca1d72192adc9b3871f554918] # # add_file "tests/netsync_permissions/open/read-permissions" # content [54cdd7a94f8a850db29ca0df95b52cd417fd9620] # # add_file "tests/netsync_permissions/open/write-permissions" # content [b462aee1c6c401b3c709a746e9400677c2ffbeb2] # # add_file "tests/netsync_with_globs/__driver__.lua" # content [8ec16aa6ff7e2be6959e78af1ae2c04251150dd9] # # add_file "tests/restricted_commit_with_inodeprints/__driver__.lua" # content [b11b4fbd4ed1b88ccb61d2b9ea5347c61a360c47] # # add_file "tests/revert_works_with_restrictions/__driver__.lua" # content [029948a123b9fc57318b084f9951a6a33e18614e] # # add_file "tests/revert_works_with_restrictions/ignore_hook.lua" # content [5cc426588fd14d14e88b53a9aba25ea1667ae043] # # add_file "tests/serve_pull_with_--exclude/__driver__.lua" # content [7b542291fc5d2565cc1f5d7ba2c828e205fa43d2] # # add_file "tests/status/__driver__.lua" # content [d82db56f60793a252c6f7b7b1a7d49f622b79640] # # add_file "tests/update_with_blocked_rename/__driver__.lua" # content [45d2da529267f5a4c45aca31307e7b0ea8d64107] # # add_file "tests/update_with_pending_add/__driver__.lua" # content [706c22d2e8901decc719736c78bc29f59f81460a] # # add_file "tests/update_with_pending_drop/__driver__.lua" # content [5c2efb1ebaa72fd90a390531e593aa76e2f910d4] # # add_file "tests/update_with_pending_rename/__driver__.lua" # content [3e2ddcda0c33999afe2e9d4da25f304f03b9a9ae] # # patch "tester-testsuite.lua" # from [f8a219a25dfb1fec89bec2ff3b85ebde3a2c26a1] # to [efc8052e5758fde01b30095b8f38c8f7e2c4d371] # # patch "tester.cc" # from [ebcd0595b678ca833fae72cd88ef06ce04900c3e] # to [d7d6d95ea8887147d34a4e2c30101c96d13beccb] # # patch "tester.lua" # from [5f1a016857d523931cf04c1e8fe806438a22f1bb] # to [ff331bfe3880d27ad016976a761ea1c2a12baf75] # # patch "tests/(imp)_persistent_netsync_server_-_keys_2/__driver__.lua" # from [2fe10078108e4d096b9dbcf5f06646aafa48caa4] # to [c1d97d0eb0076014df8ff5035970c98d6974df40] # # patch "tests/(normal)_netsync_on_partially_unrelated_revisions/__driver__.lua" # from [e4a38f668b917cbecbfd6f57c58e4e74e9b49bb9] # to [356482e7999f737c6c59ed8da992b0c32e971b8c] # # patch "tests/(normal)_netsync_revision_with_no_certs/__driver__.lua" # from [2bbd52668852e70d2de34efa8691dfed064f3eb6] # to [ff7747ae3821464879ae780c23e43c5fcff9b88c] # # patch "tests/automate_ancestors/__driver__.lua" # from [1047d5c87aa3ac11b1dce31e313bd37ad8a1bf80] # to [3555788d1dfcdf475b57828e35a6dff1091ed3db] # # patch "tests/automate_ancestry_difference/__driver__.lua" # from [2b18e891d28c87e681cae262a3a31ea336eb4ade] # to [687f03320d55546d2cfb300fae7d51259c9805e7] # # patch "tests/automate_descendents/__driver__.lua" # from [b169f5198dad22ec3e8dfe7127e4d5f26bf39e5d] # to [6e65ffe74774c3f662024b3b959e2c062b05612c] # # patch "tests/automate_erase_ancestors/__driver__.lua" # from [6af0ededd123a596151376d854a61caa9612e337] # to [bc2885d75224dd0d39ef378b1fce02a771a019ea] # # patch "tests/automate_graph/__driver__.lua" # from [de3087c9f744a1e67622ecf74f2c054eaad14067] # to [9311433fa65de02d9e996af9cfc5e3b0ad2a6ca9] # # patch "tests/automate_parents,_automate_children/__driver__.lua" # from [09b9184690bb407e31001cd30e3f2e38be5dc246] # to [b1f01aafd20f603f5aa8803ce7c2060f5b34baa4] # # patch "tests/automate_toposort/__driver__.lua" # from [5c2eebd7c32fe5dcc369bfa3cf38ef8e8cbf2113] # to [2b8c1bd3613ce3c2e6fbaf1f053b39fa1d21aee4] # # patch "tests/cvs_import,_file_dead_on_head_and_branch/__driver__.lua" # from [7512f38263010410cc684fb08ebcf0405e82d219] # to [dce710af9d7414029aeef8690593f64fbfc5344e] # # patch "tests/cvs_import_with_file_added_on_a_branch/__driver__.lua" # from [82696ecdfff800d9d21d8e02338707669be85afe] # to [f3b915b179ae6001411ef031129e1b3116bf25ee] # # patch "tests/exchanging_work_via_netsync/__driver__.lua" # from [16e19052a2f83d67cef7b23182fbfc42d630e8a5] # to [c7d4ecc85f8658688f7951d96f48d28406aae07e] # # patch "tests/importing_a_cvs_file_with_one_version/__driver__.lua" # from [57b8aba74589feb66dc8e04b7cde5dab829685e0] # to [15c3a5824d24a218b8a2037bad178f78d716149a] # # patch "tests/importing_cvs_files/__driver__.lua" # from [c6e11c43ae0592336f00ab6cf3137eb07af08d35] # to [c0f9e587b78a71661c20cca06e5ad198547e9e90] # # patch "tests/importing_cvs_files_with_identical_logs/__driver__.lua" # from [71e157f3608dfd02f409c731488a38315f21ab2b] # to [7f20e7723843c2ceaec23a4cc7d609fdddd86868] # # patch "tests/netsync_client_absorbs_and_checks_epochs/__driver__.lua" # from [0f422f4face2e53b5371d7f4b3a9ef17259b7503] # to [051a9845b19373c494e6b992a81b3e6ba9588217] # # patch "tests/netsync_client_absorbs_server_key/__driver__.lua" # from [0cbcb51504ad96f5bc0bc319afd59324c7864aa7] # to [dc8fff5b6909710b2f0dea1c2d0ee4be5d4ce1c4] # # patch "tests/netsync_default_server_pattern/__driver__.lua" # from [9d6bfba198be151bc2dea9365694d0c8af9481eb] # to [ce953484cd6f63ad5b44f054d10c4b3a6ad23c4a] # # patch "tests/netsync_default_server_pattern_setting/__driver__.lua" # from [5e7636e39a861076f1e2ef44ab71b31bf09d3320] # to [476829800bd76624f072ca5d00c113ffd290a94a] # # patch "tests/netsync_epochs_are_not_sent_upstream_by_pull/__driver__.lua" # from [132cf3ec3c4a54225a1da51ec500c262bedf4dd4] # to [b71a7986e2d0ae71548e335e91049fc703983a50] # # patch "tests/netsync_is_not_interrupted_by_SIGPIPE/__driver__.lua" # from [39bccb461318f1b4c5a989cc8216416dcffe4d85] # to [0a03a6aa0020c42cfb947a1eec7d1b9f41cfc148] # # patch "tests/netsync_largish_file/__driver__.lua" # from [84f89f33bd31f8c1ecf75d199c8c881877a90e3b] # to [e72e457f2d00207b90cfc8bf11d4c1e476a3bf5b] # # patch "tests/netsync_server_absorbs_and_checks_epochs/__driver__.lua" # from [cd53ea129784c1c830ac8e46e8118f6432ce713a] # to [aa78fe9e8da0888ade6012e92b85de9b8cb493c4] # # patch "tests/netsync_transfers_public_keys/__driver__.lua" # from [04c76345f824f1a784fc848e2bf6c3ce00b6bc46] # to [ad35ff87dffb8b24468db3dab113f4b79f425be5] # # patch "tests/netsync_verifies_server_keys/__driver__.lua" # from [3784142a3b85cfc0a791a2ea42045b4e35c40024] # to [dddf09d532cd2f277364b4ff71fa763a976ce34e] # # patch "tests/persistent_netsync_server_-_keys/__driver__.lua" # from [a73946ef1a105f8f5751b4c5b7afa130b5709b87] # to [d69890ecb57963ff920dd98e05de85771d28db3f] # # patch "tests/persistent_netsync_server_-_revs_&_certs/__driver__.lua" # from [426e9f7e63c3f96c69580449eda4419383427e7e] # to [d2462ce31147655c4d7b492a9f4c210277a4dde6] # # patch "tests/pull_a_netsync_branch_which_has_a_parent_from_another_branch/__driver__.lua" # from [39e7147a85425a27ab720a1dee7f120f55dcc831] # to [0c4a245ff7c35951005047da6ec751c4e97f6e3c] # # patch "tests/repeatedly_exchanging_work_via_netsync/__driver__.lua" # from [c4be0ca44b72f23097f18b6e0a99127237759bc1] # to [a9af63314fe08c9b5e9d8c77de03640f05eb8c0d] # # patch "tests/single_manifest_netsync/__driver__.lua" # from [337cc66d8318ef7f7aec4b37ea1344e3d135d06d] # to [ba4868d426f68fadbb35775b82ed2f1ed04c7e8e] # # patch "testsuite.at" # from [e1d480848ba13a47d78d8fc4ec11d04a947d243f] # to [e4e7b224447c223e5e441071baba7d8360b8da1e] # # patch "testsuite.lua" # from [223f17f5d715b17032c40abffd99eebaa9b3b8b8] # to [7cf86a0135ed5ac1219668f597b01192bce857a4] # ============================================================ --- tester-tests/cleanup-1/__driver__.lua d16b6e520060842d1cf59e441e4b0c6f0f1f3302 +++ tester-tests/cleanup-1/__driver__.lua d16b6e520060842d1cf59e441e4b0c6f0f1f3302 @@ -0,0 +1,6 @@ + +function cleanup() + -- stuff under test isn't cleaned between tests; + -- only predefined vars get reset + test.cleanup_ran = true +end ============================================================ --- tester-tests/cleanup-2/__driver__.lua 6438a8657a56d840d49cd65d44ceca2cb42d7597 +++ tester-tests/cleanup-2/__driver__.lua 6438a8657a56d840d49cd65d44ceca2cb42d7597 @@ -0,0 +1,1 @@ +check(test.cleanup_ran == true) ============================================================ --- tests/--rcfile=-/__driver__.lua 3d862d0597137e0beeb17b1eb0a36b6e9f355bf8 +++ tests/--rcfile=-/__driver__.lua 3d862d0597137e0beeb17b1eb0a36b6e9f355bf8 @@ -0,0 +1,9 @@ + +mtn_setup() + +getfile("foo.rc") + +addfile("testfile", "blah blah") +check(mtn("--rcfile=-", "commit", "--message=foo", "--branch=testbranch"), 0, true, false, {"foo.rc"}) + +check(qgrep("BOOGA", "stdout")) ============================================================ --- tests/--rcfile=-/foo.rc f6d4506102b8067fb6bbd3202467a51456d3bd19 +++ tests/--rcfile=-/foo.rc f6d4506102b8067fb6bbd3202467a51456d3bd19 @@ -0,0 +1,3 @@ +function note_commit(new_id, certs) + io.write("BOOGA BOOGA\n") +end ============================================================ --- tests/--rcfile=directory/__driver__.lua bd0b57aa45e0fdefde34917ed6ce3908009c4543 +++ tests/--rcfile=directory/__driver__.lua bd0b57aa45e0fdefde34917ed6ce3908009c4543 @@ -0,0 +1,18 @@ + +mtn_setup() + +mkdir("gongolo") + +-- write two files and check that they will be invoked in alphabetic order +getfile("aaa.rc", "gongolo/aaa.rc") +getfile("bbb.rc", "gongolo/bbb.rc") + +-- note: rcfile is placed outside workdir +check(mtn("setup", "--branch=testbranch", "alt_wrk"), 0, false, false) +check(indir("alt_wrk", mtn("--root=.", "--rcfile=../gongolo", "status")), 0, true, false) +check(qgrep("BOOGA BOOGACICCA CICCA", "stdout")) + +-- write a third file: should be read beetween the two previous ones +getfile("aba.rc", "gongolo/aba.rc") +check(indir("alt_wrk", mtn("--root=.", "--rcfile=../gongolo", "status")), 0, true, false) +check(qgrep("BOOGA BOOGAhu huCICCA CICCA", "stdout")) ============================================================ --- tests/--rcfile=directory/aaa.rc 2f9056f39d5bcc01e635cf32ef9ff7eb83af4103 +++ tests/--rcfile=directory/aaa.rc 2f9056f39d5bcc01e635cf32ef9ff7eb83af4103 @@ -0,0 +1,4 @@ +function paraponzi() + io.write("BOOGA BOOGA") +end +paraponzi() ============================================================ --- tests/--rcfile=directory/aba.rc 5618e7aa67b39d372a68a74c37ff127743ebe520 +++ tests/--rcfile=directory/aba.rc 5618e7aa67b39d372a68a74c37ff127743ebe520 @@ -0,0 +1,4 @@ +function notwowithoutthree() + io.write("hu hu") +end +notwowithoutthree() ============================================================ --- tests/--rcfile=directory/bbb.rc b4a560359d1176679511dda9a06eaf7d4d311309 +++ tests/--rcfile=directory/bbb.rc b4a560359d1176679511dda9a06eaf7d4d311309 @@ -0,0 +1,4 @@ +function labellagigogin() + io.write("CICCA CICCA") +end +labellagigogin() ============================================================ --- tests/a_tricky_cvs_repository_with_tags/__driver__.lua 86561dd2f315e65a2a13a489c3a6bf2c28ed195d +++ tests/a_tricky_cvs_repository_with_tags/__driver__.lua 86561dd2f315e65a2a13a489c3a6bf2c28ed195d @@ -0,0 +1,17 @@ + +mtn_setup() + +getfile("test.manifest") + +getfile("test.tags") + +gettree("e") + +check(mtn("--branch=foo.bar", "cvs_import", "e"), 0, false, false) +check(mtn("--branch=foo.bar", "co")) +check(indir("foo.bar", mtn("automate", "get_manifest_of")), 0, true) +canonicalize("stdout") +check(samefile("test.manifest", "stdout")) +check(indir("foo.bar", mtn("list", "tags")), 0, true) +canonicalize("stdout") +check(samefile("test.tags", "stdout")) ============================================================ --- tests/a_tricky_cvs_repository_with_tags/e/t/libasm/ChangeLog,v 2d21143350b0eb78840cb50fdb5fac09d80d6107 +++ tests/a_tricky_cvs_repository_with_tags/e/t/libasm/ChangeLog,v 2d21143350b0eb78840cb50fdb5fac09d80d6107 @@ -0,0 +1,274 @@ +head 1.13; +access; +symbols + libdwfl-branch:1.13.4.1.0.2 + portable-branch-fork-20050601T0139:1.13 + portable-branch:1.13.0.4 + portable-branch-base:1.13 + disasm-branch:1.13.0.2; +locks; strict; +comment @# @; + + +1.13 +date 2005.02.15.09.48.12; author drepper; state Exp; +branches + 1.13.4.1; +next 1.12; + +1.12 +date 2005.02.06.09.08.25; author drepper; state Exp; +branches; +next 1.11; + +1.11 +date 2005.02.06.01.48.45; author drepper; state Exp; +branches; +next 1.10; + +1.10 +date 2005.02.05.20.20.27; author drepper; state Exp; +branches; +next 1.9; + +1.9 +date 2005.02.05.19.41.15; author drepper; state Exp; +branches; +next 1.8; + +1.8 +date 2005.02.05.01.41.27; author drepper; state Exp; +branches; +next 1.7; + +1.7 +date 2004.09.25.19.24.54; author drepper; state Exp; +branches; +next 1.6; + +1.6 +date 2004.01.21.07.18.46; author drepper; state Exp; +branches; +next 1.5; + +1.5 +date 2004.01.18.23.40.44; author drepper; state Exp; +branches; +next 1.4; + +1.4 +date 2004.01.17.09.42.37; author drepper; state Exp; +branches; +next 1.3; + +1.3 +date 2003.08.13.19.25.12; author drepper; state Exp; +branches; +next 1.2; + +1.2 +date 2003.08.13.19.17.36; author drepper; state Exp; +branches; +next 1.1; + +1.1 +date 2003.08.12.23.35.16; author drepper; state Exp; +branches; +next ; + +1.13.4.1 +date 2005.06.01.01.10.49; author roland; state Exp; +branches; +next ; + + +desc +@@ + + +1.13 +log address@hidden +@ +text address@hidden Ulrich Drepper + + * Makefile (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2. + + * asm_end.c (text_end): Mark parameter as possibly unused. + +2005-02-06 Ulrich Drepper + + * Makefile.am: Remove lint handling. + +2005-02-05 Ulrich Drepper + + * asm_end.c (binary_end): Don't terminate with error() in case + something goes wrong. + + * Makefile.am: Check for text relocations in constructed DSO. + + * Makefile.am (AM_CFLAGS): More warnings. Add -fmudflap for MUDFLAP. + + * asm_end.c (binary_end): Remove shadowing variables. + Little cleanups. + + * asm_newsym.c: Allocate memory for the string parameter. + +2005-02-04 Ulrich Drepper + + * asm_newscn_ingrp.c (asm_newscn_ingrp): Use INTUSE to reference + asm_newscn. + +2004-09-25 Ulrich Drepper + + * asm_error.c: Make compile with gcc 4.0. + +2004-01-20 Ulrich Drepper + + * Makefile.am: Support building with mudflap. + +2004-01-18 Ulrich Drepper + + * libasmP.h (_): Use elfutils domain. + +2004-01-17 Ulrich Drepper + + * Makefile.am: Support building with mudflap. + +2003-08-13 Ulrich Drepper + + * Makefile.in: Depend on libebl.a, not libebl.so. + +2003-08-11 Ulrich Drepper + + * Moved to CVS archive. +@ + + +1.13.4.1 +log address@hidden Makefile.am tweaks, apply bswap.patch +@ +text address@hidden 5 +2005-05-31 Roland McGrath + + * Makefile.am (WEXTRA): New variable, substituted by configure. + (AM_CFLAGS): Use it in place of -Wextra. + +@ + + +1.12 +log address@hidden +@ +text address@hidden 6 +@ + + +1.11 +log address@hidden +@ +text address@hidden 4 +@ + + +1.10 +log address@hidden +@ +text address@hidden 3 +@ + + +1.9 +log address@hidden +@ +text address@hidden 2 +@ + + +1.8 +log address@hidden +@ +text address@hidden 9 +d37 1 +a37 1 + * Moved to CVS archive. +@ + + +1.7 +log address@hidden +@ +text address@hidden 5 +@ + + +1.6 +log address@hidden +@ +text address@hidden 4 +@ + + +1.5 +log address@hidden +@ +text address@hidden 4 +@ + + +1.4 +log address@hidden +@ +text address@hidden 4 +@ + + +1.3 +log address@hidden typo. +@ +text address@hidden 4 +@ + + +1.2 +log address@hidden +@ +text address@hidden 1 +a5 1 +2000-08-11 Ulrich Drepper +@ + + +1.1 +log address@hidden +@ +text address@hidden 4 +@ + ============================================================ --- tests/a_tricky_cvs_repository_with_tags/e/t/libelf-po/POTFILES.in,v db924e31608b16cb24e37888c23e66ba6ef17724 +++ tests/a_tricky_cvs_repository_with_tags/e/t/libelf-po/POTFILES.in,v db924e31608b16cb24e37888c23e66ba6ef17724 @@ -0,0 +1,181 @@ +head 1.4; +access; +symbols + libdwfl-branch:1.4.0.6 + portable-branch-fork-20050601T0139:1.4 + portable-branch:1.4.0.4 + portable-branch-base:1.4 + disasm-branch:1.4.0.2 + initial:1.1.1.1 + redhat:1.1.1; +locks; strict; +comment @# @; + + +1.4 +date 2005.02.06.01.52.03; author drepper; state Exp; +branches; +next 1.3; + +1.3 +date 2005.02.06.01.49.19; author drepper; state Exp; +branches; +next 1.2; + +1.2 +date 2004.01.08.08.14.40; author drepper; state Exp; +branches; +next 1.1; + +1.1 +date 2003.08.12.06.44.48; author drepper; state Exp; +branches + 1.1.1.1; +next ; + +1.1.1.1 +date 2003.08.12.06.44.48; author drepper; state Exp; +branches; +next ; + + +desc +@@ + + +1.4 +log address@hidden +@ +text address@hidden List of files which containing translatable strings. +# Copyright (C) 2000, 2005 Red Hat, Inc. + +# Library sources +libelf/elf_error.c +@ + + +1.3 +log address@hidden libasm and libdw subdir sources. +@ +text address@hidden 2 +libasm/asm_error.c +libdw/dwarf_error.c +@ + + +1.2 +log address@hidden need elf_error.c. +@ +text address@hidden 1 +a2 1 +# Copyright (C) 2000 Red Hat, Inc. +d6 2 +@ + + +1.1 +log address@hidden revision +@ +text address@hidden 23 +libelf/elf32_fsize.c +libelf/elf32_getehdr.c +libelf/elf32_getphdr.c +libelf/elf32_getshdr.c +libelf/elf32_newehdr.c +libelf/elf32_newphdr.c +libelf/elf32_updatefile.c +libelf/elf32_updatenull.c +libelf/elf32_xlatetof.c +libelf/elf32_xlatetom.c +libelf/elf64_fsize.c +libelf/elf64_getehdr.c +libelf/elf64_getphdr.c +libelf/elf64_getshdr.c +libelf/elf64_newehdr.c +libelf/elf64_newphdr.c +libelf/elf64_updatefile.c +libelf/elf64_updatenull.c +libelf/elf64_xlatetof.c +libelf/elf64_xlatetom.c +libelf/elf_begin.c +libelf/elf_cntl.c +libelf/elf_end.c +a5 61 +libelf/elf_fill.c +libelf/elf_flagdata.c +libelf/elf_flagehdr.c +libelf/elf_flagelf.c +libelf/elf_flagphdr.c +libelf/elf_flagscn.c +libelf/elf_flagshdr.c +libelf/elf_getarhdr.c +libelf/elf_getarsym.c +libelf/elf_getbase.c +libelf/elf_getdata.c +libelf/elf_getident.c +libelf/elf_getscn.c +libelf/elf_getshnum.c +libelf/elf_getshstrndx.c +libelf/elf_hash.c +libelf/elf_kind.c +libelf/elf_memory.c +libelf/elf_ndxscn.c +libelf/elf_newdata.c +libelf/elf_newscn.c +libelf/elf_next.c +libelf/elf_nextscn.c +libelf/elf_rand.c +libelf/elf_rawdata.c +libelf/elf_rawfile.c +libelf/elf_readall.c +libelf/elf_strptr.c +libelf/elf_update.c +libelf/elf_version.c +libelf/gelf_fsize.c +libelf/gelf_getclass.c +libelf/gelf_getdyn.c +libelf/gelf_getehdr.c +libelf/gelf_getmove.c +libelf/gelf_getphdr.c +libelf/gelf_getrela.c +libelf/gelf_getrel.c +libelf/gelf_getshdr.c +libelf/gelf_getsym.c +libelf/gelf_getsyminfo.c +libelf/gelf_getsymshndx.c +libelf/gelf_getverdaux.c +libelf/gelf_getverdef.c +libelf/gelf_getvernaux.c +libelf/gelf_getverneed.c +libelf/gelf_getversym.c +libelf/gelf_newehdr.c +libelf/gelf_newphdr.c +libelf/gelf_update_dyn.c +libelf/gelf_update_ehdr.c +libelf/gelf_update_move.c +libelf/gelf_update_phdr.c +libelf/gelf_update_rela.c +libelf/gelf_update_rel.c +libelf/gelf_update_shdr.c +libelf/gelf_update_sym.c +libelf/gelf_update_syminfo.c +libelf/gelf_update_symshndx.c +libelf/gelf_xlate.c +libelf/nlist.c +@ + + +1.1.1.1 +log address@hidden import. +@ +text +@@ ============================================================ --- tests/a_tricky_cvs_repository_with_tags/test.manifest 0874e900d0d1bd826b1eec6e75f5908991567b72 +++ tests/a_tricky_cvs_repository_with_tags/test.manifest 0874e900d0d1bd826b1eec6e75f5908991567b72 @@ -0,0 +1,15 @@ +format_version "1" + +dir "" + +dir "t" + +dir "t/libasm" + + file "t/libasm/ChangeLog" +content [73c0eabf76cc611c33d821d203a52670b8f6265a] + +dir "t/libelf-po" + + file "t/libelf-po/POTFILES.in" +content [411cfd008f4a72e433b48d6421733b6a792ca3b7] ============================================================ --- tests/a_tricky_cvs_repository_with_tags/test.tags 3dc70bde8e7a37132a0b98638a32be4494477832 +++ tests/a_tricky_cvs_repository_with_tags/test.tags 3dc70bde8e7a37132a0b98638a32be4494477832 @@ -0,0 +1,3 @@ +initial 7be6a094cb29307bed5bbacf40b3f3642222f413 address@hidden +portable-branch-base 32ba3f451dcf277762ca1c328043df2e2ceebc17 address@hidden +portable-branch-fork-20050601T0139 32ba3f451dcf277762ca1c328043df2e2ceebc17 address@hidden ============================================================ --- tests/annotate_where_line_splits/__driver__.lua c046225903e7f31d84fb5e554343d36cfaf5d2f1 +++ tests/annotate_where_line_splits/__driver__.lua c046225903e7f31d84fb5e554343d36cfaf5d2f1 @@ -0,0 +1,54 @@ + +mtn_setup() +revs = {} + +writefile("foo.A", "a\nident\nd\n") +writefile("foo.B", "a\nident\nb\n") +writefile("foo.C", "c\nident\nx\n") + +-- foo.D, the ultimate version, as created by our merge3 hook: +-- a +-- ident +-- b +-- c +-- ident +-- d + +getfile("merge.lua") + + +copyfile("foo.A", "foo") +check(mtn("add", "foo"), 0, false, false) +commit() +revs.a = base_revision() +L("revs.a = ", revs.a, "\n") + +copyfile("foo.B", "foo") +commit() +revs.b = base_revision() +L("revs.b = ", revs.b, "\n") + +revert_to(revs.a) + +copyfile("foo.C", "foo") +commit() +revs.c = base_revision() +L("revs.c = ", revs.c, "\n") + +check(mtn("--rcfile=./merge.lua", "merge"), 0, false, false) +check(mtn("update"), 0, false, false) +revs.d = base_revision() +L("revs.d = ", revs.d, "\n") + +-- +-- annotate foo should now be +-- REVA: a +-- REVA: ident +-- REVB: b +-- REVC: c +-- REVA: ident +-- REVD: d +-- + +check(mtn("--debug", "annotate", "foo"), 0, true, true) +greplines("stdout", {revs.a, revs.a, revs.b, revs.c, revs.a, revs.d}) ============================================================ --- tests/annotate_where_line_splits/merge.lua 6507eba7dcee28eee85e156535b949b8901c0e6e +++ tests/annotate_where_line_splits/merge.lua 6507eba7dcee28eee85e156535b949b8901c0e6e @@ -0,0 +1,4 @@ +function merge3 (ancestor, left, right) + data = "a\nident\nb\nc\nident\nd\n" + return data +end ============================================================ --- tests/annotate_where_lineage_depends_on_traversal/__driver__.lua 53cd0f6f35b9494b6722d1351c283d982b4c1107 +++ tests/annotate_where_lineage_depends_on_traversal/__driver__.lua 53cd0f6f35b9494b6722d1351c283d982b4c1107 @@ -0,0 +1,53 @@ + +mtn_setup() +revs = {} + +writefile("foo.A", "a\nb\nc\nd\ne\n") +writefile("foo.B", "x\nb\np\nd\ne\n") +writefile("foo.C", "a\nb\nq\nd changed in C\ny\n") +-- foo.D, the ultimate version, as created by our merge3 hook: +-- a +-- b +-- p +-- d changed in C +-- e +-- added line + +getfile("merge.lua") + + +copyfile("foo.A", "foo") +check(mtn("add", "foo"), 0, false, false) +commit() +revs.a = base_revision() +L("revs.a = ", revs.a, "\n") + +copyfile("foo.B", "foo") +commit() +revs.b = base_revision() +L("revs.b = ", revs.b, "\n") + +revert_to(revs.a) + +copyfile("foo.C", "foo") +commit() +revs.c = base_revision() +L("revs.c = ", revs.c, "\n") + +check(mtn("--rcfile=./merge.lua", "merge"), 0, false, false) +check(mtn("update"), 0, false, false) +revs.d = base_revision() +L("revs.d = ", revs.d, "\n") + +-- +-- annotate foo should now be +-- REVA: a +-- REVA: b +-- REVB: p +-- REVC: d changed in C +-- REVA: e +-- REVD: added line +-- + +check(mtn("--debug", "annotate", "foo"), 0, true, true) +greplines("stdout", {revs.a, revs.a, revs.b, revs.c, revs.a, revs.d}) ============================================================ --- tests/annotate_where_lineage_depends_on_traversal/merge.lua dc4a4f9d5916b1498bc79981a845b3d23d19475e +++ tests/annotate_where_lineage_depends_on_traversal/merge.lua dc4a4f9d5916b1498bc79981a845b3d23d19475e @@ -0,0 +1,4 @@ +function merge3 (ancestor, left, right) + data = "a\nb\np\nd changed in C\ne\nadded line\n" + return data +end ============================================================ --- tests/annotate_where_one_parent_is_full_copy/__driver__.lua e9ba290d9c0024f58932e9235960e4a4fb3dc33a +++ tests/annotate_where_one_parent_is_full_copy/__driver__.lua e9ba290d9c0024f58932e9235960e4a4fb3dc33a @@ -0,0 +1,49 @@ + +mtn_setup() + +-- +-- A Where B -> D is no change, but +-- / \ C -> D shows a delta for a line modified in +-- B C B. +-- \ / +-- D +-- +revs = {} + +writefile("A", "a\nb\nc\n") +writefile("B", "a\nb\nx\ny\nc\n") + +-- C == A +-- D == B + +copyfile("A", "foo") +addfile("initialfile", "foo\nfile\n") +check(mtn("add", "foo"), 0, false, false) +commit() +revs.a = base_revision() + +copyfile("B", "foo") +commit() +revs.b = base_revision() + +revert_to(revs.a) +copyfile("A", "initialfile") +commit() +revs.c = base_revision() + + +check(mtn("merge"), 0, false, false) +check(mtn("update"), 0, false, false) +revs.d = base_revision() + +-- +-- annotate foo should now be +-- REVA: a +-- REVA: b +-- REVB: x +-- REVB: y +-- REVA: c +-- + +check(mtn("annotate", "foo"), 0, true, false) +check(greplines("stdout", {revs.a, revs.a, revs.b, revs.b, revs.a})) ============================================================ --- tests/automate_attributes/__driver__.lua def3ba933ed0d52e9aedaa8e1fd0373bcf903c55 +++ tests/automate_attributes/__driver__.lua def3ba933ed0d52e9aedaa8e1fd0373bcf903c55 @@ -0,0 +1,9 @@ + +mtn_setup() + +addfile("testfile", "foo bar") +check(mtn("attr", "set", "testfile", "unique_key", "unique_value"), 0, false, false) +check(mtn("automate", "attributes", "testfile"), 0, true, false) +check(qgrep("unique_key", "stdout")) +check(mtn("automate", "attributes"), 0, true, false) +check(qgrep("testfile", "stdout")) ============================================================ --- tests/automate_certs/__driver__.lua 53f81a0517365da4a4ce52b6b581a23603c0175e +++ tests/automate_certs/__driver__.lua 53f81a0517365da4a4ce52b6b581a23603c0175e @@ -0,0 +1,27 @@ + +mtn_setup() +revs = {} + +getfile("expected") + +writefile("empty", "") + +addfile("foo", "blah") +check(mtn("commit", "--date=2005-05-21T12:30:51", "--branch=testbranch", + "--message=blah-blah"), 0, false, false) +base = base_revision() + +-- check that a correct usage produces correctly formatted output +check(mtn("automate", "certs", base), 0, true, false) +canonicalize("stdout") +check(samefile("expected", "stdout")) + +-- ensure that missing revisions fail +check(mtn("automate", "certs", string.rep("0", 40)), 1, true, false) +canonicalize("stdout") +check(samefile("empty", "stdout")) + +-- ensure that revisions are not being completed +check(mtn("automate", "certs", string.sub(base, 1, 30)), 1, true, false) +canonicalize("stdout") +check(samefile("empty", "stdout")) ============================================================ --- tests/automate_certs/expected f389ef9089174e2ebd4e143374186453abf8271a +++ tests/automate_certs/expected f389ef9089174e2ebd4e143374186453abf8271a @@ -0,0 +1,23 @@ + key "address@hidden" +signature "ok" + name "author" + value "address@hidden" + trust "trusted" + + key "address@hidden" +signature "ok" + name "branch" + value "testbranch" + trust "trusted" + + key "address@hidden" +signature "ok" + name "changelog" + value "blah-blah" + trust "trusted" + + key "address@hidden" +signature "ok" + name "date" + value "2005-05-21T12:30:51" + trust "trusted" ============================================================ --- tests/automate_stdio/__driver__.lua 56f4bbe463ab7f5f88ee45e3b7add9531fc6d732 +++ tests/automate_stdio/__driver__.lua 56f4bbe463ab7f5f88ee45e3b7add9531fc6d732 @@ -0,0 +1,26 @@ + +mtn_setup() + +function parse_stdio(dat, which) + local got = {} + while true do + local b,e,n,s = string.find(dat, "(%d+):%d+:[lm]:(%d+):") + if b == nil then break end + n = n + 0 + if got[n] == nil then got[n] = "" end + got[n] = got[n] .. string.sub(dat, e+1, e+s) + dat = string.sub(dat, e+1+s) + end + if got[which] == nil then got[which] = "" end + L("output of command ", which, ":\n") + L(got[which]) + return got[which] +end + +writefile("output", "file contents") + +check(mtn("automate", "inventory"), 0, true, false) +canonicalize("stdout") +rename("stdout", "output") +check(mtn("automate", "stdio"), 0, true, false, "l9:inventorye") +check(parse_stdio(readfile("stdout"), 0) == readfile("output")) ============================================================ --- tests/check_later_and_earlier_selectors/__driver__.lua f3d70f749d65fd0e10b3bd30f7e0740260bab6de +++ tests/check_later_and_earlier_selectors/__driver__.lua f3d70f749d65fd0e10b3bd30f7e0740260bab6de @@ -0,0 +1,80 @@ + +mtn_setup() +revs = {} + +addfile("testfile", "this is just a file") +copyfile("testfile", "testfile1") +check(mtn("commit", "--date=2005-03-11T20:33:01", "--branch=foo", + "--message=march"), 0, false, false) +revs.first = base_revision() + +writefile("testfile", "Now, this is a different file") +copyfile("testfile", "testfile2") +check(mtn("commit", "--date=2005-04-22T12:15:00", "--branch=foo", + "--message=aprila"), 0, false, false) +revs.second = base_revision() + +writefile("testfile", "And we change it a third time") +copyfile("testfile", "testfile3") +check(mtn("commit", "--date=2005-04-24T07:44:39", "--branch=foo", + "--message=aprilb"), 0, false, false) +revs.third = base_revision() + +-- ------------------- +-- check 'earlier or equal' selector +-- ------------------- +function selmap(sel, revs, sort) + check(raw_mtn("automate", "select", sel), 0, true, false) + samelines("stdout", revs, sort) +end + +-- this time is just 'before' the first commit, thus no output should come +selmap("e:2005-03-11T20:33:00", {}) + +-- these sels should extract only the first commit +-- Note: the second sel is the exact time of the first commit. +selmap("e:2005-04", {revs.first}) +selmap("e:2005-03-11T20:33:01", {revs.first}) +selmap("e:2005-03-11T20:33:02", {revs.first}) + +-- now the first two +selmap("e:2005-04-23", {revs.first, revs.second}) + +-- finally, all the files +selmap("e:2005-04-30", {revs.first, revs.second, revs.third}) +selmap("e:2006-07", {revs.first, revs.second, revs.third}) + +-- ------------------- +-- check 'later' selector +-- ------------------- + +-- unlike 'earlier', the 'later' selector matches only strictly greater +-- commit times. Giving a time equal to that of third commit thus +-- should not match anything +selmap("l:2005-04-24T07:44:39", {}) +selmap("l:2005-05", {}) + +-- these sels should extract only the last commit +-- Note: the second sel is one sec before the last commit +selmap("l:2005-04-23", {revs.third}) +selmap("l:2005-04-24T07:44:38", {revs.third}) + +-- now we match the second and third commit +selmap("l:2005-04-21", {revs.third, revs.second}) + +-- finally, all the files +selmap("l:2005-03", {revs.first, revs.second, revs.third}) +selmap("l:2003-01", {revs.first, revs.second, revs.third}) + +-- ------------------- +-- check combined selectors +-- ------------------- + +-- matching only the second commit +selmap("l:2005-04-01/e:2005-04-23", {revs.second}) +selmap("l:2005-04-01/e:2005-04-22T20:00:00", {revs.second}) +selmap("l:2005-04-21T23:01:00/e:2005-04-22T20:00:00", {revs.second}) + +-- non overlapping intervals should not match, even if the single selector +-- will +selmap("l:2005-04-22/e:2005-04-21", {}) ============================================================ --- tests/checking_a_few_command_specific_options/__driver__.lua b47bc864decd4066304266671df4bbe8c0190274 +++ tests/checking_a_few_command_specific_options/__driver__.lua b47bc864decd4066304266671df4bbe8c0190274 @@ -0,0 +1,12 @@ + +mtn_setup() + +writefile("testfile", "This is complete junk") +check(mtn("--branch=testbranch", "add", "testfile"), 1, false, false) +check(mtn("add", "testfile"), 0, false, false) +commit() + +check(mtn("--branch=testbranch", "--last=1", "log"), 1, false, false) +check(mtn("--last=1", "log"), 0, false, false) + +check(mtn("--depth=0", "status"), 0, false, false) ============================================================ --- tests/commit_with_--message-file/__driver__.lua d91fb65c3bb372749170c9c321d3bafb4c34de87 +++ tests/commit_with_--message-file/__driver__.lua d91fb65c3bb372749170c9c321d3bafb4c34de87 @@ -0,0 +1,60 @@ + +mtn_setup() + +remove("_MTN/log") + +---------------------- +--first, verify that --message-file actually works +---------------------- + +addfile("input.txt", "version 0 of the file") + +writefile("msgfile.txt", "this commit uses the --message-file option") + +check(mtn("--branch=testbranch", "commit", "--message-file=msgfile.txt"), 0, false, false) + +tsha = base_revision() +check(mtn("ls", "certs", tsha), 0, true, false) +check(qgrep('this commit uses the --message-file option', "stdout")) + +---------------------- +--also with a file coming outside the workspace +---------------------- +check(mtn("setup", "--branch=testbranch", "alt_wrk"), 0, false, false) + +writefile("alt_wrk/input1.txt", "files... files...") + +writefile("message-out-of-copy.txt", "out out out ") + +check(indir("alt_wrk", mtn("add", "input1.txt")), 0, false, false) + +check(indir("alt_wrk", mtn("--branch=outbranch", "commit", "--message-file=../message-out-of-copy.txt")), 0, false, false) + +tsha = indir("alt_wrk", {base_revision})[1]() +check(indir("alt_wrk", mtn("ls", "certs", tsha)), 0, true, false) +check(qgrep('out out out', "stdout")) + +---------------------- +--start with the failures: non existing file +---------------------- +addfile("input2.txt", "another file") + +check(mtn("--branch=testbranch", "commit", "--message-file=to-be-or-not-to-be.txt"), 1, false, false) + +---------------------- +--then verify that --message and --message-file together cause an error +---------------------- + +check(mtn("--branch=testbranch", "commit", "--message-file=msgfile.txt", + "--message=also a message"), 1, false, false) + +-- -------------------- +-- finally, --message-file and a filled _MTN/log should also fail +-- -------------------- + +getfile("commit_log.lua") + +writefile("_MTN/log", "Log entry") + +check(mtn("--branch=testbranch", "--rcfile=commit_log.lua", "commit", + "--message-file=msgfile.txt"), 1, false, false) ============================================================ --- tests/common/cvs.lua df8dd4548b02e5ce850067226861b4dbe6891932 +++ tests/common/cvs.lua df8dd4548b02e5ce850067226861b4dbe6891932 @@ -0,0 +1,13 @@ +skip_if(not existsonpath("cvs")) + +function cvs(...) + return {"cvs", "-d", cvsroot, unpack(arg)} +end + +function cvs_setup() + cvsroot = test.root .. "/cvs-repository" + check(cvs("-q", "init"), 0, false, false) + check(exists(cvsroot)) + check(exists(cvsroot .. "/CVSROOT")) + check(exists(cvsroot .. "/CVSROOT/modules")) +end ============================================================ --- tests/common/netsync.lua b4979ef69470997f5edd77961c1657d78cb0b6fd +++ tests/common/netsync.lua b4979ef69470997f5edd77961c1657d78cb0b6fd @@ -0,0 +1,100 @@ + +function mtn2(...) + return mtn("--db=test2.db", "--keydir=keys2", unpack(arg)) +end + +function mtn3(...) + return mtn("--db=test3.db", "--keydir=keys3", unpack(arg)) +end + +netsync = {} +netsync.internal = {} + +function netsync.setup() + copyfile("test.db", "test2.db") + copy_recursive("keys", "keys2") + copyfile("test.db", "test3.db") + copy_recursive("keys", "keys3") + getstdfile("common/netsync-hooks.lua", "netsync.lua") + math.randomseed(os.time()) +end + +function netsync.setup_with_notes() + netsync.setup() + getstdfile("common/netsync-hooks_with_notes.lua", "netsync.lua") +end + +function netsync.internal.client(srv, oper, pat, n, res) + if n == nil then n = 2 end + args = {"--rcfile=netsync.lua", "--keydir=keys"..n, + "--db=test"..n..".db", oper, srv.address} + if type(pat) == "string" then + table.insert(args, pat) + elseif type(pat) == "table" then + local function ins(i,x) + table.insert(args,x) + end + table.foreachi(pat, ins) + elseif pat ~= nil then + err("Bad pattern type "..type(pat)) + end + check(mtn(unpack(args)), res, false, false) +end +function netsync.internal.pull(srv, pat, n, res) srv:client("pull", pat, n, res) end +function netsync.internal.push(srv, pat, n, res) srv:client("push", pat, n, res) end +function netsync.internal.sync(srv, pat, n, res) srv:client("sync", pat, n, res) end + +function netsync.start(pat, n, min) + if pat == "" or pat == nil then pat = "*" end + local args = {} + local fn = mtn + local addr = "localhost:" .. math.random(20000, 50000) + table.insert(args, "--dump=_MTN/server_dump") + table.insert(args, "--bind="..addr) + if min then + fn = minhooks_mtn + else + table.insert(args, "--rcfile=netsync.lua") + end + if n ~= nil then + table.insert(args, "--keydir=keys"..n) + table.insert(args, "--db=test"..n..".db") + end + table.insert(args, "serve") + if type(pat) == "string" then + table.insert(args, pat) + elseif type(pat) == "table" then + local function ins(i,x) + table.insert(args,x) + end + table.foreachi(pat, ins) + else + err("Bad pattern type "..type(pat)) + end + local out = bg(fn(unpack(args)), false, false, false) + out.address = addr + local mt = getmetatable(out) + mt.client = netsync.internal.client + mt.pull = netsync.internal.pull + mt.push = netsync.internal.push + mt.sync = netsync.internal.sync + local mt_wait = mt.wait + mt.check = function(obj) return not mt_wait(obj, 0) end + mt.wait = nil -- using this would hang; don't allow it + -- wait for "beginning service..." + while fsize(out.prefix .. "stderr") == 0 do + sleep(1) + check(out:check()) + end + mt.stop = mt.finish + return out +end + +function netsync.internal.run(oper, pat) + local srv = netsync.start(pat) + srv:client(oper, pat) + srv:finish() +end +function netsync.pull(pat) netsync.internal.run("pull", pat) end +function netsync.push(pat) netsync.internal.run("push", pat) end +function netsync.sync(pat) netsync.internal.run("sync", pat) end ============================================================ --- tests/cvs_import,_deleted_file_invariant/__driver__.lua cd41da4b2edee3b1458d06624580624aff8ce54d +++ tests/cvs_import,_deleted_file_invariant/__driver__.lua cd41da4b2edee3b1458d06624580624aff8ce54d @@ -0,0 +1,20 @@ + +include("/common/cvs.lua") +mtn_setup() + +cvs_setup() + +gettree("attest", cvsroot.."/attest") + +check(cvs("co", "-rABC_BASE", "attest"), 0, false, false) +tsha0 = sha1("attest/afile") +tsha1 = sha1("attest/bfile") +tsha2 = sha1("attest/cfile") + +-- import into monotone and check presence of files + +check(mtn("--branch=testbranch", "cvs_import", cvsroot.."/attest"), 0, false, false) + +check(mtn("automate", "get_file", tsha0), 0, false) +check(mtn("automate", "get_file", tsha1), 0, false) +check(mtn("automate", "get_file", tsha2), 0, false) ============================================================ --- tests/cvs_import,_deleted_file_invariant/attest/afile,v 577b48eae4a753ecb856aac0daa93d768afd308a +++ tests/cvs_import,_deleted_file_invariant/attest/afile,v 577b48eae4a753ecb856aac0daa93d768afd308a @@ -0,0 +1,68 @@ +head 1.2; +access; +symbols + ABC_SYNC_A:1.2 + ABC_SYNC_B:1.2 + ZZZ_SYNC_A:1.2 + ZZZ_SYNC_B:1.2 + XYZZYX_1_9:1.1.0.10 + XYZZYX_1_9_BASE:1.1 + XYZZYX_1_8:1.1.0.8 + XYZZYX_1_8_BASE:1.1 + XYZZYX_1_7:1.1.0.6 + XYZZYX_1_7_BASE:1.1 + ABC:1.1.0.4 + ABC_BASE:1.1 + vndr_19991208:1.1 + XYZZYX_1_6:1.1.0.2 + XYZZYX_1_6_BASE:1.1; +locks; strict; +comment @# @; + + +1.2 +date 2001.05.29.22.09.32; author mouse; state dead; +branches; +next 1.1; + +1.1 +date 99.09.11.21.41.31; author mouse; state Exp; +branches + 1.1.4.1; +next ; + +1.1.4.1 +date 2001.07.04.10.17.35; author santa; state dead; +branches; +next ; + + +desc +@@ + + +1.2 +log address@hidden file. +@ +text address@hidden is a line of text. +@ + + +1.1 +log address@hidden file. +@ +text +@@ + + +1.1.4.1 +log address@hidden head of trunk into ABC branch. +@ +text +@@ + + ============================================================ --- tests/cvs_import,_deleted_file_invariant/attest/bfile,v 593f9627ffe697c38141344bd4fb36f99f936234 +++ tests/cvs_import,_deleted_file_invariant/attest/bfile,v 593f9627ffe697c38141344bd4fb36f99f936234 @@ -0,0 +1,80 @@ +head 1.2; +access; +symbols + ABC_SYNC_A:1.2 + ABC_SYNC_B:1.2 + ZZZ_SYNC_A:1.2 + ZZZ_SYNC_B:1.2 + XYZZYX_1_9:1.1.0.22 + XYZZYX_1_9_BASE:1.1 + XYZZYX_1_8:1.1.0.20 + XYZZYX_1_8_BASE:1.1 + XYZZYX_1_7:1.1.0.18 + XYZZYX_1_7_BASE:1.1 + ABC:1.1.0.16 + ABC_BASE:1.1 + vndr_19991208:1.1 + XYZZYX_1_6:1.1.0.14 + XYZZYX_1_6_BASE:1.1 + XYZZYX_1_5:1.1.0.12 + XYZZYX_1_5_BASE:1.1 + XYZZYX_1_4:1.1.0.10 + XYZZYX_1_4_BASE:1.1 + XYZZYX_1_3:1.1.0.8 + XYZZYX_1_3_BASE:1.1 + XYZZYX_1_2:1.1.0.6 + XYZZYX_1_2_BASE:1.1 + XYZZYX_1_1:1.1.0.4 + XYZZYX_1_1_BASE:1.1 + XYZZYX_1_0:1.1.0.2 + XYZZYX_1_0_BASE:1.1; +locks; strict; +comment @# @; + + +1.2 +date 2001.05.29.22.09.32; author mouse; state dead; +branches; +next 1.1; + +1.1 +date 96.07.20.10.17.19; author mouse; state Exp; +branches + 1.1.16.1; +next ; + +1.1.16.1 +date 2001.07.04.10.17.35; author santa; state dead; +branches; +next ; + + +desc +@@ + + +1.2 +log address@hidden file. +@ +text address@hidden is some text over here. +@ + + +1.1 +log address@hidden file. +@ +text +@@ + + +1.1.16.1 +log address@hidden head of trunk into ABC branch. +@ +text +@@ + + ============================================================ --- tests/cvs_import,_deleted_file_invariant/attest/cfile,v 871b0d2f4393db39e063b4cfb8d5450589eaedd2 +++ tests/cvs_import,_deleted_file_invariant/attest/cfile,v 871b0d2f4393db39e063b4cfb8d5450589eaedd2 @@ -0,0 +1,100 @@ +head 1.2; +access; +symbols + XYZZYX_1_0:1.1.1.1.0.2 + XYZZYX_1_0_BASE:1.1.1.1 + XYZZYX_1_1:1.1.1.1.0.4 + XYZZYX_1_1_BASE:1.1.1.1 + XYZZYX_1_2:1.1.1.1.0.6 + XYZZYX_1_2_BASE:1.1.1.1 + XYZZYX_1_3:1.1.1.1.0.8 + XYZZYX_1_3_BASE:1.1.1.1 + XYZZYX_1_4:1.1.1.1.0.10 + XYZZYX_1_4_BASE:1.1.1.1 + XYZZYX_1_5:1.2.0.2 + XYZZYX_1_5_BASE:1.2 + XYZZYX_1_6:1.2.0.4 + XYZZYX_1_6_BASE:1.2 + XYZZYX_1_7:1.2.0.8 + XYZZYX_1_7_BASE:1.2 + XYZZYX_1_8:1.2.0.10 + XYZZYX_1_8_BASE:1.2 + XYZZYX_1_9:1.2.0.12 + XYZZYX_1_9_BASE:1.2 + XYZZYX_2_0:1.2.0.14 + XYZZYX_2_0_BASE:1.2 + XYZZYX_2_1:1.2.0.18 + XYZZYX_2_1_BASE:1.2 + XYZZYX_2_2:1.2.0.20 + XYZZYX_2_2_BASE:1.2 + XYZZYX_2_3:1.2.0.22 + XYZZYX_2_3_BASE:1.2 + XYZZYX_2_4:1.2.0.24 + XYZZYX_2_4_BASE:1.2 + XYZZYX_2_5:1.2.0.26 + XYZZYX_2_5_BASE:1.2 + XYZZYX_2_6:1.2.0.28 + XYZZYX_2_6_BASE:1.2 + XYZZYX_2_7:1.2.0.30 + XYZZYX_2_7_BASE:1.2 + ABC:1.2.0.6 + ABC_BASE:1.2 + ABC_SYNC_A:1.2 + ABC_SYNC_B:1.2 + ZZZ:1.2.0.16 + ZZZ_BASE:1.2 + ZZZ_SYNC_A:1.2 + ZZZ_SYNC_B:1.2 + vndr_19991208:1.2 + vendor_1_1:1.1.1.1; +locks; strict; +comment @ * @; + + +1.2 +date 99.01.13.07.26.01; author santa; state Exp; +branches; +next 1.1; + +1.1 +date 95.10.18.08.50.37; author bill; state Exp; +branches + 1.1.1.1; +next ; + +1.1.1.1 +date 95.10.18.08.50.37; author bill; state Exp; +branches; +next ; + + + +desc +@@ + + +1.2 +log +@ +@ +text address@hidden's this? it's a line of text, sir. +@ + + +1.1 +log address@hidden file. +@ +text address@hidden 1 +@ + + +1.1.1.1 +log address@hidden vendor import. +@ +text +@@ + ============================================================ --- tests/db_kill_branch_certs_locally_command/__driver__.lua f7fbe9521eb4e0043364af4c15c44984078d0a9e +++ tests/db_kill_branch_certs_locally_command/__driver__.lua f7fbe9521eb4e0043364af4c15c44984078d0a9e @@ -0,0 +1,22 @@ + +mtn_setup() + +-- This tests the db kill_branch_certs_locally command + +-- Prepare a db with a couple of branches +addfile("foo", "file named foo") +commit("good") +rev = base_revision() +check(mtn("cert", rev, "branch", "bad"), 0, false, false) +check(mtn("ls", "branches"), 0, true, false) +check(qgrep("good", "stdout")) +check(qgrep("bad", "stdout")) + +-- Now we delete the branch, and make sure it's gone +check(mtn("db", "kill_branch_certs_locally", "bad"), 0, false, false) +check(mtn("ls", "branches"), 0, true, false) +check(qgrep("good", "stdout")) +check(not qgrep("bad", "stdout")) + +-- And lets make sure our database is still OK +check(mtn("db", "check"), 0, false, false) ============================================================ --- tests/diff_against_empty_file/__driver__.lua e3e289096323d3c58e05e4b8cc00568cc9635d7c +++ tests/diff_against_empty_file/__driver__.lua e3e289096323d3c58e05e4b8cc00568cc9635d7c @@ -0,0 +1,17 @@ + +skip_if(not existsonpath("patch")) +mtn_setup() + +addfile("foo", "1\n2\n") +commit("foo", "foo") + +rename("foo", "foo.away") +writefile("foo") +check(mtn("diff", "foo"), 0, true) +rename("stdout", "monodiff") + +-- see whether the patch is well-formed +check({"patch", "-p0", "-R"}, 0, false, false, {"monodiff"}) + +-- see whether the resulting file is the same as the original one +check(samefile("foo", "foo.away")) ============================================================ --- tests/fail_cleanly_on_unreadable__MTN_options/__driver__.lua 5fb46803b3c7ede9ea819043d101e008eb52bf5e +++ tests/fail_cleanly_on_unreadable__MTN_options/__driver__.lua 5fb46803b3c7ede9ea819043d101e008eb52bf5e @@ -0,0 +1,12 @@ + +skip_if(ostype == "Windows") +skip_if(not existsonpath("chmod")) +mtn_setup() + +check({"chmod", "a-rwx", "_MTN/"}) + +function cleanup() + check({"chmod", "u+rwx", "_MTN/"}) +end + +check(raw_mtn(), 1, false, false) ============================================================ --- tests/get_netsync_read_permitted/__driver__.lua bea5d1cd297d4cdeb576b7f6fcd8bef73c10c111 +++ tests/get_netsync_read_permitted/__driver__.lua bea5d1cd297d4cdeb576b7f6fcd8bef73c10c111 @@ -0,0 +1,46 @@ + +include("common/netsync.lua") +mtn_setup() +netsync.setup() + +addfile("testfile", "1") +commit("branch1") +B1=base_revision() + +writefile("testfile", "2") +commit("branch2") +B2=base_revision() + +addfile("testfile", "3") +commit("branch3") +B3=base_revision() + +writefile("testfile", "4") +commit("branch4") +B4=base_revision() + +-- Allow permission to branch1 and branch3 only +-- pulling more than that should error out +-- pulling exactly that should give revs B1, B2, B3; and only give +-- branch certs on B1, B3. +mkdir("perm") +getfile("read-permissions", "perm/read-permissions") + +srv = netsync.start({"--confdir=perm", "branch*"}, nil, true) + +srv:pull("branch*", nil, 1) +check(mtn2("automate", "get_revision", B1), 1, false, false) +check(mtn2("automate", "get_revision", B2), 1, false, false) +check(mtn2("automate", "get_revision", B3), 1, false, false) +check(mtn2("automate", "get_revision", B4), 1, false, false) + +srv:pull({"branch1", "branch3"}) +check(mtn2("automate", "get_revision", B1), 0, false, false) +check(mtn2("automate", "get_revision", B2), 0, false, false) +check(mtn2("automate", "get_revision", B3), 0, false, false) +check(mtn2("automate", "get_revision", B4), 1, false, false) + +check(mtn2("ls", "certs", B2), 0, true) +check(not qgrep("branch2", "stdout")) + +srv:stop() ============================================================ --- tests/get_netsync_read_permitted/read-permissions a1f44891f56511b9bf03409e737746b4ce5f94c2 +++ tests/get_netsync_read_permitted/read-permissions a1f44891f56511b9bf03409e737746b4ce5f94c2 @@ -0,0 +1,4 @@ +pattern "branch1" +allow "*" +pattern "branch3" +allow "*" ============================================================ --- tests/importing_a_small,_real_cvs_repository/__driver__.lua 831c69c344c54019c8e3f68b2b849878c62bcadf +++ tests/importing_a_small,_real_cvs_repository/__driver__.lua 831c69c344c54019c8e3f68b2b849878c62bcadf @@ -0,0 +1,12 @@ + +mtn_setup() + +getfile("test.manifest") + +gettree("e") + +check(mtn("--branch=foo.bar", "cvs_import", "e"), 0, false, false) +check(mtn("--branch=foo.bar.disasm-branch", "co")) +check(indir("foo.bar.disasm-branch", mtn("automate", "get_manifest_of")), 0, true) +canonicalize("stdout") +check(samefile("test.manifest", "stdout")) ============================================================ --- tests/importing_a_small,_real_cvs_repository/e/src/Attic/objdump.c,v 7216d24537572122cc9492dbfcbb498c17eec273 +++ tests/importing_a_small,_real_cvs_repository/e/src/Attic/objdump.c,v 7216d24537572122cc9492dbfcbb498c17eec273 @@ -0,0 +1,808 @@ +head 1.1; +access; +symbols + disasm-branch:1.1.0.2; +locks; strict; +comment @ * @; + + +1.1 +date 2005.04.21.23.15.43; author drepper; state dead; +branches + 1.1.2.1; +next ; + +1.1.2.1 +date 2005.04.21.23.15.43; author drepper; state Exp; +branches; +next ; + + +desc +@@ + + +1.1 +log address@hidden objdump.c was initially added on branch disasm-branch. +@ +text +@@ + + +1.1.2.1 +log address@hidden changs for disasm support. +@ +text address@hidden 768 +/* Print information from ELF file in human-readable form. + Copyright (C) 2005 Red Hat, Inc. + Written by Ulrich Drepper , 2005. + + This program is Open Source software; you can redistribute it and/or + modify it under the terms of the Open Software License version 1.0 as + published by the Open Source Initiative. + + You should have received a copy of the Open Software License along + with this program; if not, you may obtain a copy of the Open Software + License version 1.0 from http://www.opensource.org/licenses/osl.php or + by writing the Open Source Initiative c/o Lawrence Rosen, Esq., + 3001 King Ranch Road, Ukiah, CA 95482. */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include "../libebl/libeblP.h" + + +/* Name and version of program. */ +static void print_version (FILE *stream, struct argp_state *state); +void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version; + +/* Bug report address. */ +const char *argp_program_bug_address = PACKAGE_BUGREPORT; + + +/* Definitions of arguments for argp functions. */ +static const struct argp_option options[] = +{ + { NULL, 0, NULL, 0, N_("Mode selection:"), 0 }, + { "reloc", 'r', NULL, 0, N_("Display relocation information.") }, + { "full-contents", 's', NULL, 0, + N_("Display the full contents of all sections requested") }, + { "disassemble", 'd', NULL, 0, + N_("Display assembler code of executable sections") }, + + { NULL, 0, NULL, 0, N_("Output option selection:"), 0 }, + { "section", 'j', "NAME", 0, + N_("Only display information for section NAME.") }, + + { NULL, 0, NULL, 0, NULL, 0 } +}; + +/* Short description of program. */ +static const char doc[] = N_("\ +Show information from FILEs (a.out by default)."); + +/* Strings for arguments in help texts. */ +static const char args_doc[] = N_("[FILE...]"); + +/* Prototype for option handler. */ +static error_t parse_opt (int key, char *arg, struct argp_state *state); + +/* Data structure to communicate with argp functions. */ +static struct argp argp = +{ + options, parse_opt, args_doc, doc +}; + + +/* Print symbols in file named FNAME. */ +static int process_file (const char *fname, bool more_than_one); + +/* Handle content of archive. */ +static int handle_ar (int fd, Elf *elf, const char *prefix, const char *fname, + const char *suffix); + +/* Handle ELF file. */ +static int handle_elf (Elf *elf, const char *prefix, const char *fname, + const char *suffix); + + +#define INTERNAL_ERROR(fname) \ + error (EXIT_FAILURE, 0, gettext ("%s: INTERNAL ERROR %d (%s-%s): %s"), \ + fname, __LINE__, VERSION, __DATE__, elf_errmsg (-1)) + + +/* List of sections which should be used. */ +static struct section_list +{ + bool is_name; + union + { + const char *name; + uint32_t scnndx; + }; + struct section_list *next; +} *section_list; + + +/* If true print archive index. */ +static bool print_relocs; + +/* If true print full contents of requested sections. */ +static bool print_full_content; + +/* If true print disassembled output.. */ +static bool print_disasm; + + +int +main (int argc, char *argv[]) +{ + /* Make memory leak detection possible. */ + mtrace (); + + /* We use no threads here which can interfere with handling a stream. */ + (void) __fsetlocking (stdin, FSETLOCKING_BYCALLER); + (void) __fsetlocking (stdout, FSETLOCKING_BYCALLER); + (void) __fsetlocking (stderr, FSETLOCKING_BYCALLER); + + /* Set locale. */ + (void) setlocale (LC_ALL, ""); + + /* Make sure the message catalog can be found. */ + (void) bindtextdomain (PACKAGE, LOCALEDIR); + + /* Initialize the message catalog. */ + (void) textdomain (PACKAGE); + + /* Parse and process arguments. */ + int remaining; + (void) argp_parse (&argp, argc, argv, 0, &remaining, NULL); + + /* Tell the library which version we are expecting. */ + (void) elf_version (EV_CURRENT); + + int result = 0; + if (remaining == argc) + /* The user didn't specify a name so we use a.out. */ + result = process_file ("a.out", false); + else + { + /* Process all the remaining files. */ + const bool more_than_one = remaining + 1 < argc; + + do + result |= process_file (argv[remaining], more_than_one); + while (++remaining < argc); + } + + return result; +} + + +/* Print the version information. */ +static void +print_version (FILE *stream, struct argp_state *state) +{ + fprintf (stream, "objdump (%s) %s\n", PACKAGE_NAME, VERSION); + fprintf (stream, gettext ("\ +Copyright (C) %s Red Hat, Inc.\n\ +This is free software; see the source for copying conditions. There is NO\n\ +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ +"), "2005"); + fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper"); +} + + +/* Handle program arguments. */ +static error_t +parse_opt (int key, char *arg, struct argp_state *state) +{ + switch (key) + { + case 'j': + { + struct section_list *newp = xmalloc (sizeof (*newp)); + char *endp; + newp->scnndx = strtoul (arg, &endp, 0); + if (*endp == 0) + newp->is_name = false; + else + { + newp->name = arg; + newp->is_name = true; + } + newp->next = section_list; + section_list = newp; + } + break; + + case 'd': + print_disasm = true; + break; + + case 'r': + print_relocs = true; + break; + + case 's': + print_full_content = true; + break; + + default: + return ARGP_ERR_UNKNOWN; + } + return 0; +} + + +/* Open the file and determine the type. */ +static int +process_file (const char *fname, bool more_than_one) +{ + /* Open the file. */ + int fd = open (fname, O_RDONLY); + if (fd == -1) + { + error (0, errno, fname); + return 1; + } + + /* Now get the ELF descriptor. */ + Elf *elf = elf_begin (fd, ELF_C_READ_MMAP, NULL); + if (elf != NULL) + { + if (elf_kind (elf) == ELF_K_ELF) + { + int result = handle_elf (elf, more_than_one ? "" : NULL, + fname, NULL); + + if (elf_end (elf) != 0) + INTERNAL_ERROR (fname); + + if (close (fd) != 0) + error (EXIT_FAILURE, errno, gettext ("while close `%s'"), fname); + + return result; + } + else if (elf_kind (elf) == ELF_K_AR) + { + int result = handle_ar (fd, elf, NULL, fname, NULL); + + if (elf_end (elf) != 0) + INTERNAL_ERROR (fname); + + if (close (fd) != 0) + error (EXIT_FAILURE, errno, gettext ("while close `%s'"), fname); + + return result; + } + + /* We cannot handle this type. Close the descriptor anyway. */ + if (elf_end (elf) != 0) + INTERNAL_ERROR (fname); + } + + error (0, 0, gettext ("%s: File format not recognized"), fname); + + return 1; +} + + +static int +handle_ar (int fd, Elf *elf, const char *prefix, const char *fname, + const char *suffix) +{ + size_t fname_len = strlen (fname) + 1; + size_t prefix_len = prefix != NULL ? strlen (prefix) : 0; + char new_prefix[prefix_len + fname_len + 2]; + size_t suffix_len = suffix != NULL ? strlen (suffix) : 0; + char new_suffix[suffix_len + 2]; + Elf *subelf; + Elf_Cmd cmd = ELF_C_READ_MMAP; + int result = 0; + + char *cp = new_prefix; + if (prefix != NULL) + cp = stpcpy (cp, prefix); + cp = stpcpy (cp, fname); + stpcpy (cp, "["); + + cp = new_suffix; + if (suffix != NULL) + cp = stpcpy (cp, suffix); + stpcpy (cp, "]"); + + /* Process all the files contained in the archive. */ + while ((subelf = elf_begin (fd, cmd, elf)) != NULL) + { + /* The the header for this element. */ + Elf_Arhdr *arhdr = elf_getarhdr (subelf); + + /* Skip over the index entries. */ + if (strcmp (arhdr->ar_name, "/") != 0 + && strcmp (arhdr->ar_name, "//") != 0) + { + if (elf_kind (subelf) == ELF_K_ELF) + result |= handle_elf (subelf, new_prefix, arhdr->ar_name, + new_suffix); + else if (elf_kind (subelf) == ELF_K_AR) + result |= handle_ar (fd, subelf, new_prefix, arhdr->ar_name, + new_suffix); + else + { + error (0, 0, gettext ("%s%s%s: file format not recognized"), + new_prefix, arhdr->ar_name, new_suffix); + result = 1; + } + } + + /* Get next archive element. */ + cmd = elf_next (subelf); + if (elf_end (subelf) != 0) + INTERNAL_ERROR (fname); + } + + return result; +} + + +static void +show_relocs_rel (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr, Elf_Data *data, + Elf_Data *symdata, Elf_Data *xndxdata, size_t symstrndx, + size_t shstrndx) +{ + int elfclass = gelf_getclass (ebl->elf); + int nentries = shdr->sh_size / shdr->sh_entsize; + + for (int cnt = 0; cnt < nentries; ++cnt) + { + GElf_Rel relmem; + GElf_Rel *rel; + + rel = gelf_getrel (data, cnt, &relmem); + if (rel != NULL) + { + char buf[128]; + GElf_Sym symmem; + GElf_Sym *sym; + Elf32_Word xndx; + + sym = gelf_getsymshndx (symdata, xndxdata, GELF_R_SYM (rel->r_info), + &symmem, &xndx); + if (sym == NULL) + printf ("%0*" PRIx64 " %-20s <%s %ld>\n", + elfclass == ELFCLASS32 ? 8 : 16, rel->r_offset, + ebl_reloc_type_check (ebl, GELF_R_TYPE (rel->r_info)) + ? ebl_reloc_type_name (ebl, GELF_R_TYPE (rel->r_info), + buf, sizeof (buf)) + : gettext (""), + gettext ("INVALID SYMBOL"), + (long int) GELF_R_SYM (rel->r_info)); + else if (GELF_ST_TYPE (sym->st_info) != STT_SECTION) + printf ("%0*" PRIx64 " %-20s %s\n", + elfclass == ELFCLASS32 ? 8 : 16, rel->r_offset, + ebl_reloc_type_check (ebl, GELF_R_TYPE (rel->r_info)) + ? ebl_reloc_type_name (ebl, GELF_R_TYPE (rel->r_info), + buf, sizeof (buf)) + : gettext (""), + elf_strptr (ebl->elf, symstrndx, sym->st_name)); + else + { + GElf_Shdr destshdr_mem; + GElf_Shdr *destshdr; + destshdr = gelf_getshdr (elf_getscn (ebl->elf, + sym->st_shndx == SHN_XINDEX + ? xndx : sym->st_shndx), + &destshdr_mem); + + if (shdr == NULL) + printf ("%0*" PRIx64 " %-20s <%s %ld>\n", + elfclass == ELFCLASS32 ? 8 : 16, rel->r_offset, + ebl_reloc_type_check (ebl, GELF_R_TYPE (rel->r_info)) + ? ebl_reloc_type_name (ebl, GELF_R_TYPE (rel->r_info), + buf, sizeof (buf)) + : gettext (""), + gettext ("INVALID SECTION"), + (long int) (sym->st_shndx == SHN_XINDEX + ? xndx : sym->st_shndx)); + else + printf ("%0*" PRIx64 " %-20s %s\n", + elfclass == ELFCLASS32 ? 8 : 16, rel->r_offset, + ebl_reloc_type_check (ebl, GELF_R_TYPE (rel->r_info)) + ? ebl_reloc_type_name (ebl, GELF_R_TYPE (rel->r_info), + buf, sizeof (buf)) + : gettext (""), + elf_strptr (ebl->elf, shstrndx, destshdr->sh_name)); + } + } + } +} + + +static void +show_relocs_rela (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr, Elf_Data *data, + Elf_Data *symdata, Elf_Data *xndxdata, size_t symstrndx, + size_t shstrndx) +{ + int elfclass = gelf_getclass (ebl->elf); + int nentries = shdr->sh_size / shdr->sh_entsize; + + for (int cnt = 0; cnt < nentries; ++cnt) + { + GElf_Rela relmem; + GElf_Rela *rel; + + rel = gelf_getrela (data, cnt, &relmem); + if (rel != NULL) + { + char buf[128]; + GElf_Sym symmem; + GElf_Sym *sym; + Elf32_Word xndx; + + sym = gelf_getsymshndx (symdata, xndxdata, GELF_R_SYM (rel->r_info), + &symmem, &xndx); + if (sym == NULL) + printf ("%0*" PRIx64 " %-20s <%s %ld>", + elfclass == ELFCLASS32 ? 8 : 16, rel->r_offset, + ebl_reloc_type_check (ebl, GELF_R_TYPE (rel->r_info)) + ? ebl_reloc_type_name (ebl, GELF_R_TYPE (rel->r_info), + buf, sizeof (buf)) + : gettext (""), + gettext ("INVALID SYMBOL"), + (long int) GELF_R_SYM (rel->r_info)); + else if (GELF_ST_TYPE (sym->st_info) != STT_SECTION) + printf ("%0*" PRIx64 " %-20s %s", + elfclass == ELFCLASS32 ? 8 : 16, rel->r_offset, + ebl_reloc_type_check (ebl, GELF_R_TYPE (rel->r_info)) + ? ebl_reloc_type_name (ebl, GELF_R_TYPE (rel->r_info), + buf, sizeof (buf)) + : gettext (""), + elf_strptr (ebl->elf, symstrndx, sym->st_name)); + else + { + GElf_Shdr destshdr_mem; + GElf_Shdr *destshdr; + destshdr = gelf_getshdr (elf_getscn (ebl->elf, + sym->st_shndx == SHN_XINDEX + ? xndx : sym->st_shndx), + &destshdr_mem); + + if (shdr == NULL) + printf ("%0*" PRIx64 " %-20s <%s %ld>", + elfclass == ELFCLASS32 ? 8 : 16, rel->r_offset, + ebl_reloc_type_check (ebl, GELF_R_TYPE (rel->r_info)) + ? ebl_reloc_type_name (ebl, GELF_R_TYPE (rel->r_info), + buf, sizeof (buf)) + : gettext (""), + gettext ("INVALID SECTION"), + (long int) (sym->st_shndx == SHN_XINDEX + ? xndx : sym->st_shndx)); + else + printf ("%0*" PRIx64 " %-20s %s", + elfclass == ELFCLASS32 ? 8 : 16, rel->r_offset, + ebl_reloc_type_check (ebl, GELF_R_TYPE (rel->r_info)) + ? ebl_reloc_type_name (ebl, GELF_R_TYPE (rel->r_info), + buf, sizeof (buf)) + : gettext (""), + elf_strptr (ebl->elf, shstrndx, destshdr->sh_name)); + } + + if (rel->r_addend != 0) + printf ("+%#" PRIx64, rel->r_addend); + putchar ('\n'); + } + } +} + + +static bool +section_match (Elf *elf, uint32_t scnndx, GElf_Shdr *shdr, size_t shstrndx) +{ + if (section_list == NULL) + return true; + + struct section_list *runp = section_list; + + do + { + if (runp->is_name) + { + if (strcmp (runp->name, + elf_strptr (elf, shstrndx, shdr->sh_name)) == 0) + return true; + } + else + { + if (runp->scnndx == scnndx) + return true; + } + + runp = runp->next; + } + while (runp != NULL); + + return false; +} + + +static int +show_relocs (Ebl *ebl, const char *fname, uint32_t shstrndx) +{ + int elfclass = gelf_getclass (ebl->elf); + + Elf_Scn *scn = NULL; + while ((scn = elf_nextscn (ebl->elf, scn)) != NULL) + { + GElf_Shdr shdr_mem; + GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); + + if (shdr == NULL) + INTERNAL_ERROR (fname); + + if (shdr->sh_type == SHT_REL || shdr->sh_type == SHT_RELA) + { + if (! section_match (ebl->elf, elf_ndxscn (scn), shdr, shstrndx)) + continue; + + GElf_Shdr destshdr_mem; + GElf_Shdr *destshdr = gelf_getshdr (elf_getscn (ebl->elf, + shdr->sh_info), + &destshdr_mem); + + printf (gettext ("RELOCATION RECORDS FOR [%s]:\n" + "%-*s TYPE VALUE\n"), + elf_strptr (ebl->elf, shstrndx, destshdr->sh_name), + elfclass == ELFCLASS32 ? 8 : 16, gettext ("OFFSET")); + + /* Get the data of the section. */ + Elf_Data *data = elf_getdata (scn, NULL); + if (data == NULL) + continue; + + /* Get the symbol table information. */ + Elf_Scn *symscn = elf_getscn (ebl->elf, shdr->sh_link); + GElf_Shdr symshdr_mem; + GElf_Shdr *symshdr = gelf_getshdr (symscn, &symshdr_mem); + Elf_Data *symdata = elf_getdata (symscn, NULL); + + /* Search for the optional extended section index table. */ + Elf_Data *xndxdata = NULL; + Elf_Scn *xndxscn = NULL; + while ((xndxscn = elf_nextscn (ebl->elf, xndxscn)) != NULL) + { + GElf_Shdr xndxshdr_mem; + GElf_Shdr *xndxshdr; + + xndxshdr = gelf_getshdr (xndxscn, &xndxshdr_mem); + if (xndxshdr != NULL && xndxshdr->sh_type == SHT_SYMTAB_SHNDX + && xndxshdr->sh_link == elf_ndxscn (symscn)) + { + /* Found it. */ + xndxdata = elf_getdata (xndxscn, NULL); + break; + } + } + + if (shdr->sh_type == SHT_REL) + show_relocs_rel (ebl, scn, shdr, data, symdata, xndxdata, + symshdr->sh_link, shstrndx); + else + show_relocs_rela (ebl, scn, shdr, data, symdata, xndxdata, + symshdr->sh_link, shstrndx); + } + } + + fputs_unlocked ("\n\n", stdout); + + return 0; +} + + +static int +show_full_content (Ebl *ebl, const char *fname, uint32_t shstrndx) +{ + Elf_Scn *scn = NULL; + while ((scn = elf_nextscn (ebl->elf, scn)) != NULL) + { + GElf_Shdr shdr_mem; + GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); + + if (shdr == NULL) + INTERNAL_ERROR (fname); + + if (shdr->sh_type == SHT_PROGBITS && shdr->sh_size > 0) + { + if (! section_match (ebl->elf, elf_ndxscn (scn), shdr, shstrndx)) + continue; + + printf (gettext ("Contents of section %s:\n"), + elf_strptr (ebl->elf, shstrndx, shdr->sh_name)); + + /* Get the data of the section. */ + Elf_Data *data = elf_getdata (scn, NULL); + if (data == NULL) + continue; + + unsigned char *cp = data->d_buf; + size_t cnt; + for (cnt = 0; cnt + 16 < data->d_size; cp += 16, cnt += 16) + { + printf (" %04zx ", cnt); + + for (size_t inner = 0; inner < 16; inner += 4) + printf ("%02hhx%02hhx%02hhx%02hhx ", + cp[inner], cp[inner + 1], cp[inner + 2], + cp[inner + 3]); + fputc_unlocked (' ', stdout); + + for (size_t inner = 0; inner < 16; ++inner) + fputc_unlocked (isascii (cp[inner]) && isprint (cp[inner]) + ? cp[inner] : '.', stdout); + fputc_unlocked ('\n', stdout); + } + + printf (" %04zx ", cnt); + + size_t remaining = data->d_size - cnt; + size_t inner; + for (inner = 0; inner + 4 <= remaining; inner += 4) + printf ("%02hhx%02hhx%02hhx%02hhx ", + cp[inner], cp[inner + 1], cp[inner + 2], cp[inner + 3]); + + for (; inner < remaining; ++inner) + printf ("%02hhx", cp[inner]); + + for (inner = 2 * (16 - inner) + (16 - inner + 3) / 4 + 1; inner > 0; + --inner) + fputc_unlocked (' ', stdout); + + for (inner = 0; inner < remaining; ++inner) + fputc_unlocked (isascii (cp[inner]) && isprint (cp[inner]) + ? cp[inner] : '.', stdout); + fputc_unlocked ('\n', stdout); + + fputc_unlocked ('\n', stdout); + } + } + + return 0; +} + + +struct disasm_info +{ + GElf_Addr addr; + const uint8_t *cur; + const uint8_t *last_end; +}; + + +static int +disasm_output (char *buf, size_t buflen, void *arg) +{ + struct disasm_info *info = (struct disasm_info *) arg; + + printf ("%8" PRIx64 ": ", (uint64_t) info->addr); + size_t cnt; + for (cnt = 0; cnt < info->cur - info->last_end; ++cnt) + printf (" %02" PRIx8, info->last_end[cnt]); + printf (" %.*s\n", (int) buflen, buf); + + info->addr += cnt; + info->last_end = info->cur; + + return 0; +} + + +static int +show_disasm (Ebl *ebl, const char *fname, uint32_t shstrndx) +{ + DisasmCtx_t *ctx = disasm_begin (ebl, ebl->elf, NULL /* XXX TODO */); + if (ctx == NULL) + error (EXIT_FAILURE, 0, gettext ("cannot disassemble")); + + Elf_Scn *scn = NULL; + while ((scn = elf_nextscn (ebl->elf, scn)) != NULL) + { + GElf_Shdr shdr_mem; + GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); + + if (shdr == NULL) + INTERNAL_ERROR (fname); + + if (shdr->sh_type == SHT_PROGBITS && shdr->sh_size > 0 + && (shdr->sh_flags & SHF_EXECINSTR) != 0) + { + if (! section_match (ebl->elf, elf_ndxscn (scn), shdr, shstrndx)) + continue; + + Elf_Data *data = elf_getdata (scn, NULL); + if (data == NULL) + continue; + + printf ("Disassembly of section %s:\n\n", + elf_strptr (ebl->elf, shstrndx, shdr->sh_name)); + + struct disasm_info info; + info.addr = 0; // XXX Find load bias + info.last_end = info.cur = data->d_buf; + + disasm_cb (ctx, &info.cur, info.cur + data->d_size, info.addr, + "%7m %.1o%e,%.2o%e,%.3o", disasm_output, &info, + NULL /* XXX */); + } + } + + (void) disasm_end (ctx); + + return 0; +} + + +static int +handle_elf (Elf *elf, const char *prefix, const char *fname, + const char *suffix) +{ + + /* Get the backend for this object file type. */ + Ebl *ebl = ebl_openbackend (elf); + + printf (gettext ("%s: elf%d-%s\n\n"), + fname, gelf_getclass (elf) == ELFCLASS32 ? 32 : 64, + ebl_backend_name (ebl)); + + /* Create the full name of the file. */ + size_t prefix_len = prefix == NULL ? 0 : strlen (prefix); + size_t suffix_len = suffix == NULL ? 0 : strlen (suffix); + size_t fname_len = strlen (fname) + 1; + char fullname[prefix_len + 1 + fname_len + suffix_len]; + char *cp = fullname; + if (prefix != NULL) + cp = mempcpy (cp, prefix, prefix_len); + cp = mempcpy (cp, fname, fname_len); + if (suffix != NULL) + memcpy (cp - 1, suffix, suffix_len + 1); + + /* Get the section header string table index. */ + size_t shstrndx; + if (elf_getshstrndx (ebl->elf, &shstrndx) < 0) + error (EXIT_FAILURE, 0, + gettext ("cannot get section header string table index")); + + int result = 0; + if (print_disasm) + result = show_disasm (ebl, fullname, shstrndx); + if (print_relocs && !print_disasm) + result = show_relocs (ebl, fullname, shstrndx); + if (print_full_content) + result = show_full_content (ebl, fullname, shstrndx); + + /* Close the ELF backend library descriptor. */ + ebl_closebackend (ebl); + + return result; +} +@ + ============================================================ --- tests/importing_a_small,_real_cvs_repository/e/tests/asm-tst3.c,v 9ff963f952db0882b64ea24c41ef95af81fe1bf2 +++ tests/importing_a_small,_real_cvs_repository/e/tests/asm-tst3.c,v 9ff963f952db0882b64ea24c41ef95af81fe1bf2 @@ -0,0 +1,394 @@ +head 1.1; +branch 1.1.1; +access; +symbols + disasm-branch:1.1.1.1.0.2 + initial:1.1.1.1 + redhat:1.1.1; +locks; strict; +comment @ * @; + + +1.1 +date 2003.08.12.06.47.45; author drepper; state Exp; +branches + 1.1.1.1; +next ; + +1.1.1.1 +date 2003.08.12.06.47.45; author drepper; state Exp; +branches + 1.1.1.1.2.1; +next ; + +1.1.1.1.2.1 +date 2005.04.21.23.15.43; author drepper; state Exp; +branches; +next ; + + +desc +@@ + + +1.1 +log address@hidden revision +@ +text +@/* Copyright (C) 2002 Red Hat, Inc. + Written by Ulrich Drepper , 2002. + + This program is Open Source software; you can redistribute it and/or + modify it under the terms of the Open Software License version 1.0 as + published by the Open Source Initiative. + + You should have received a copy of the Open Software License along + with this program; if not, you may obtain a copy of the Open Software + License version 1.0 from http://www.opensource.org/licenses/osl.php or + by writing the Open Source Initiative c/o Lawrence Rosen, Esq., + 3001 King Ranch Road, Ukiah, CA 95482. */ + +#include +#include +#include +#include +#include +#include + + +static const char fname[] = "asm-tst3-out.o"; + + +static const char *scnnames[5] = + { + [0] = "", + [1] = ".data", + [2] = ".strtab", + [3] = ".symtab", + [4] = ".shstrtab" + }; + + +static unsigned int scntypes[5] = + { + [0] = SHT_NULL, + [1] = SHT_PROGBITS, + [2] = SHT_STRTAB, + [3] = SHT_SYMTAB, + [4] = SHT_STRTAB + }; + + +int +main (void) +{ + AsmCtx_t *ctx; + AsmScn_t *scn1; + AsmScn_t *scn2; + int result = 0; + int fd; + Elf *elf; + GElf_Ehdr ehdr_mem; + GElf_Ehdr *ehdr; + size_t cnt; + + elf_version (EV_CURRENT); + + ctx = asm_begin (fname, false, EM_386, ELFCLASS32, ELFDATA2LSB); + if (ctx == NULL) + { + printf ("cannot create assembler context: %s\n", asm_errmsg (-1)); + return 1; + } + + /* Create two sections. */ + scn1 = asm_newscn (ctx, ".data", SHT_PROGBITS, SHF_ALLOC | SHF_WRITE); + scn2 = asm_newsubscn (scn1, 1); + if (scn1 == NULL || scn2 == NULL) + { + printf ("cannot create section in output file: %s\n", asm_errmsg (-1)); + asm_abort (ctx); + return 1; + } + + /* Special alignment for the .text section. */ + if (asm_align (scn1, 16) != 0) + { + printf ("cannot align .text section: %s\n", asm_errmsg (-1)); + result = 1; + } + + /* Add a few strings with names. */ + if (asm_newsym (scn1, "one", 4, STT_OBJECT, STB_GLOBAL) == NULL) + { + printf ("cannot create first name: %s\n", asm_errmsg (-1)); + result = 1; + } + if (asm_addstrz (scn1, "one", 4) != 0) + { + printf ("cannot insert first string: %s\n", asm_errmsg (-1)); + result = 1; + } + if (asm_newsym (scn2, "three", 6, STT_OBJECT, STB_WEAK) == NULL) + { + printf ("cannot create second name: %s\n", asm_errmsg (-1)); + result = 1; + } + if (asm_addstrz (scn2, "three", 0) != 0) + { + printf ("cannot insert second string: %s\n", asm_errmsg (-1)); + result = 1; + } + if (asm_newsym (scn1, "two", 4, STT_OBJECT, STB_LOCAL) == NULL) + { + printf ("cannot create third name: %s\n", asm_errmsg (-1)); + result = 1; + } + if (asm_addstrz (scn1, "two", 4) != 0) + { + printf ("cannot insert third string: %s\n", asm_errmsg (-1)); + result = 1; + } + + /* Create the output file. */ + if (asm_end (ctx) != 0) + { + printf ("cannot create output file: %s\n", asm_errmsg (-1)); + asm_abort (ctx); + return 1; + } + + /* Check the file. */ + fd = open (fname, O_RDONLY); + if (fd == -1) + { + printf ("cannot open generated file: %m\n"); + result = 1; + goto out; + } + + elf = elf_begin (fd, ELF_C_READ, NULL); + if (elf == NULL) + { + printf ("cannot create ELF descriptor: %s\n", elf_errmsg (-1)); + result = 1; + goto out_close; + } + if (elf_kind (elf) != ELF_K_ELF) + { + puts ("not a valid ELF file"); + result = 1; + goto out_close2; + } + + ehdr = gelf_getehdr (elf, &ehdr_mem); + if (ehdr == NULL) + { + printf ("cannot get ELF header: %s\n", elf_errmsg (-1)); + result = 1; + goto out_close2; + } + + for (cnt = 1; cnt < 5; ++cnt) + { + Elf_Scn *scn; + GElf_Shdr shdr_mem; + GElf_Shdr *shdr; + + scn = elf_getscn (elf, cnt); + if (scn == NULL) + { + printf ("cannot get section %Zd: %s\n", cnt, elf_errmsg (-1)); + result = 1; + continue; + } + + shdr = gelf_getshdr (scn, &shdr_mem); + if (shdr == NULL) + { + printf ("cannot get section header for section %Zd: %s\n", + cnt, elf_errmsg (-1)); + result = 1; + continue; + } + + if (strcmp (elf_strptr (elf, ehdr->e_shstrndx, shdr->sh_name), + scnnames[cnt]) != 0) + { + printf ("section %Zd's name differs: %s vs %s\n", cnt, + elf_strptr (elf, ehdr->e_shstrndx, shdr->sh_name), + scnnames[cnt]); + result = 1; + } + + if (shdr->sh_type != scntypes[cnt]) + { + printf ("section %Zd's type differs\n", cnt); + result = 1; + } + + if ((cnt == 1 && shdr->sh_flags != (SHF_ALLOC | SHF_WRITE)) + || (cnt != 1 && shdr->sh_flags != 0)) + { + printf ("section %Zd's flags differs\n", cnt); + result = 1; + } + + if (shdr->sh_addr != 0) + { + printf ("section %Zd's address differs\n", cnt); + result = 1; + } + + if (cnt == 3) + { + Elf_Data *data; + + if (shdr->sh_link != 2) + { + puts ("symbol table has incorrect link"); + result = 1; + } + + data = elf_getdata (scn, NULL); + if (data == NULL) + { + puts ("cannot get data of symbol table"); + result = 1; + } + else + { + size_t inner; + + for (inner = 1; + inner < (shdr->sh_size + / gelf_fsize (elf, ELF_T_SYM, 1, EV_CURRENT)); + ++inner) + { + GElf_Sym sym_mem; + GElf_Sym *sym; + + sym = gelf_getsym (data, inner, &sym_mem); + if (sym == NULL) + { + printf ("cannot get symbol %zu: %s\n", + inner, elf_errmsg (-1)); + result = 1; + } + else + { + /* The order of the third and fourth entry depends + on how the hash table is organized. */ + static const char *names[4] = + { + [0] = "", + [1] = "two", + [2] = "one", + [3] = "three" + }; + static const int info[4] = + { + [0] = GELF_ST_INFO (STB_LOCAL, STT_NOTYPE), + [1] = GELF_ST_INFO (STB_LOCAL, STT_OBJECT), + [2] = GELF_ST_INFO (STB_GLOBAL, STT_OBJECT), + [3] = GELF_ST_INFO (STB_WEAK, STT_OBJECT) + }; + static const unsigned value[4] = + { + [0] = 0, + [1] = 4, + [2] = 0, + [3] = 8 + }; + + if (strcmp (names[inner], + elf_strptr (elf, shdr->sh_link, + sym->st_name)) != 0) + { + printf ("symbol %zu has different name\n", inner); + result = 1; + } + + if (sym->st_value != value[inner]) + { + printf ("symbol %zu has wrong value\n", inner); + result = 1; + } + + if (sym->st_other != 0) + { + printf ("symbol %zu has wrong other info\n", inner); + result = 1; + } + + if (sym->st_shndx != 1) + { + printf ("symbol %zu has wrong section reference\n", + inner); + result = 1; + } + + if (sym->st_info != info[inner]) + { + printf ("symbol %zu has wrong type or binding\n", + inner); + result = 1; + } + + if ((inner != 3 && sym->st_size != 4) + || (inner == 3 && sym->st_size != 6)) + { + printf ("symbol %zu has wrong size\n", inner); + result = 1; + } + } + } + } + } + } + + out_close2: + elf_end (elf); + out_close: + close (fd); + out: + /* We don't need the file anymore. */ + unlink (fname); + + return result; +} +@ + + +1.1.1.1 +log address@hidden import. +@ +text +@@ + + +1.1.1.1.2.1 +log address@hidden changs for disasm support. +@ +text address@hidden 1 +a1 1 +/* Copyright (C) 2002, 2005 Red Hat, Inc. +d60 1 +a60 8 + Ebl *ebl = ebl_openbackend_machine (EM_386); + if (ebl == NULL) + { + puts ("cannot open backend library"); + return 1; + } + + ctx = asm_begin (fname, ebl, false); +a320 2 + ebl_closebackend (ebl); + +@ + ============================================================ --- tests/importing_a_small,_real_cvs_repository/e/tests/asm-tst4.c,v 46bb1be8917640b49b9c412914555c06bdd0e7de +++ tests/importing_a_small,_real_cvs_repository/e/tests/asm-tst4.c,v 46bb1be8917640b49b9c412914555c06bdd0e7de @@ -0,0 +1,177 @@ +head 1.2; +access; +symbols + disasm-branch:1.2.0.2 + initial:1.1.1.1 + redhat:1.1.1; +locks; strict; +comment @ * @; + + +1.2 +date 2004.09.25.19.21.35; author drepper; state Exp; +branches + 1.2.2.1; +next 1.1; + +1.1 +date 2003.08.12.06.47.45; author drepper; state Exp; +branches + 1.1.1.1; +next ; + +1.1.1.1 +date 2003.08.12.06.47.45; author drepper; state Exp; +branches; +next ; + +1.2.2.1 +date 2005.04.21.23.15.43; author drepper; state Exp; +branches; +next ; + + +desc +@@ + + +1.2 +log +@(main): Add LD_LIBRARY_PATH to elflint invocation. +@ +text +@/* Copyright (C) 2002, 2004 Red Hat, Inc. + Written by Ulrich Drepper , 2002. + + This program is Open Source software; you can redistribute it and/or + modify it under the terms of the Open Software License version 1.0 as + published by the Open Source Initiative. + + You should have received a copy of the Open Software License along + with this program; if not, you may obtain a copy of the Open Software + License version 1.0 from http://www.opensource.org/licenses/osl.php or + by writing the Open Source Initiative c/o Lawrence Rosen, Esq., + 3001 King Ranch Road, Ukiah, CA 95482. */ + +#include +#include +#include +#include +#include +#include +#include +#include + + +static const char fname[] = "asm-tst4-out.o"; + + +int +main (void) +{ + AsmCtx_t *ctx; + int result = 0; + size_t cnt; + + elf_version (EV_CURRENT); + + ctx = asm_begin (fname, false, EM_386, ELFCLASS32, ELFDATA2LSB); + if (ctx == NULL) + { + printf ("cannot create assembler context: %s\n", asm_errmsg (-1)); + return 1; + } + + /* Create 66000 sections. */ + for (cnt = 0; cnt < 66000; ++cnt) + { + char buf[20]; + AsmScn_t *scn; + + /* Create a unique name. */ + snprintf (buf, sizeof (buf), ".data.%Zu", cnt); + + /* Create the section. */ + scn = asm_newscn (ctx, buf, SHT_PROGBITS, SHF_ALLOC | SHF_WRITE); + if (scn == NULL) + { + printf ("cannot create section \"%s\" in output file: %s\n", + buf, asm_errmsg (-1)); + asm_abort (ctx); + return 1; + } + + /* Add some content. */ + if (asm_adduint32 (scn, cnt) != 0) + { + printf ("cannot create content of section \"%s\": %s\n", + buf, asm_errmsg (-1)); + asm_abort (ctx); + return 1; + } + } + + /* Create the output file. */ + if (asm_end (ctx) != 0) + { + printf ("cannot create output file: %s\n", asm_errmsg (-1)); + asm_abort (ctx); + return 1; + } + + if (result == 0) + result = WEXITSTATUS (system ("\ +env LD_LIBRARY_PATH=../libelf ../src/elflint -q asm-tst4-out.o")); + + /* We don't need the file anymore. */ + unlink (fname); + + return result; +} +@ + + +1.2.2.1 +log address@hidden changs for disasm support. +@ +text address@hidden 1 +a1 1 +/* Copyright (C) 2002, 2004, 2005 Red Hat, Inc. +d36 1 +a36 8 + Ebl *ebl = ebl_openbackend_machine (EM_386); + if (ebl == NULL) + { + puts ("cannot open backend library"); + return 1; + } + + ctx = asm_begin (fname, ebl, false); +a86 2 + ebl_closebackend (ebl); + +@ + + +1.1 +log address@hidden revision +@ +text address@hidden 1 +a1 1 +/* Copyright (C) 2002 Red Hat, Inc. +d81 2 +a82 1 + result = WEXITSTATUS (system ("../src/elflint -q asm-tst4-out.o")); +@ + + +1.1.1.1 +log address@hidden import. +@ +text +@@ ============================================================ --- tests/importing_a_small,_real_cvs_repository/test.manifest 239a81e972fbdea494bf9d1ecbae1863c7cf2f9d +++ tests/importing_a_small,_real_cvs_repository/test.manifest 239a81e972fbdea494bf9d1ecbae1863c7cf2f9d @@ -0,0 +1,16 @@ +format_version "1" + +dir "" + +dir "src" + + file "src/objdump.c" +content [94c86fa749ed82d76fe8d6cce18d11b8c3f0ee38] + +dir "tests" + + file "tests/asm-tst3.c" +content [01f722126e54806abfa32f867dbeb8529b79298b] + + file "tests/asm-tst4.c" +content [7968cb0c8f62e6f15d710ce0cd42a65f7acd2567] ============================================================ --- tests/importing_cvs_with_vendor_imports_and_branches/__driver__.lua 9738d252a0f89a8870d9420ca1ba06f5048a25ff +++ tests/importing_cvs_with_vendor_imports_and_branches/__driver__.lua 9738d252a0f89a8870d9420ca1ba06f5048a25ff @@ -0,0 +1,68 @@ + +include("/common/cvs.lua") +mtn_setup() +cvs_setup() + +writefile("file1.0", "version 0 of test file1") +writefile("file1.1", "version 1 of test file1") +writefile("file1.2", "version 2 of test file1") +writefile("file2.0", "version 0 of test file2") +writefile("file2.1", "version 1 of test file2") +writefile("changelog.0", "first changelog entry\n") + +check(cat("-", "changelog.0"), 0, true, false, "second changelog\n\n") +rename("stdout", "changelog.1") + +check(cat("-", "changelog.1"), 0, true, false, "third changelog -not on branch-\n\n") +rename("stdout", "changelog.2") + +check(cat("-", "changelog.1"), 0, true, false, "third changelog -on branch-\n\n") +rename("stdout", "changelog.3") + + +-- create the initial 3rd-party vendor import + +mkdir("importdir") +copyfile("file1.0", "importdir/file1") +copyfile("file2.0", "importdir/file2") +copyfile("changelog.0", "importdir/changelog") +check(indir("importdir", cvs("import", "-m", "Initial import of VENDORWARE 1", "testsrc", "VENDOR", "VENDOR_REL_1")), 0, false, false) + +-- now we alter some of the files. +check(cvs("co", "testsrc"), 0, false, false) +copyfile("file1.1", "testsrc/file1") +copyfile("changelog.1", "testsrc/changelog") +check(indir("testsrc", cvs ("commit", "-m", 'commit 0')), 0, false, false) + +-- now we create a branch +check(indir("testsrc", cvs ("tag", "-b", "branched")), 0, false, false) +check(indir("testsrc", cvs ("up", "-r", "branched")), 0, false, false) + +-- alter the files on the branch +copyfile("file1.2", "testsrc/file1") +copyfile("file2.1", "testsrc/file2") +copyfile("changelog.3", "testsrc/changelog") +check(indir("testsrc", cvs ("commit", "-m", 'commit on branch')), 0, false, false) + +-- and create some mainline changes after the branch +check(indir("testsrc", cvs ("up", "-A")), 0, false, false) +copyfile("changelog.2", "testsrc/changelog") +check(indir("testsrc", cvs ("commit", "-m", 'commit on mainline after branch')), 0, false, false) + +-- import into monotone and check presence of files + +check(mtn("--branch=test", "cvs_import", cvsroot.."/testsrc"), 0, false, false) + +-- also check that checkout is correct +-- right one. + +check(mtn("checkout", "--branch=test", "maindir"), 0, false, false) +check(mtn("checkout", "--branch=test.branched", "branchdir"), 0, false, false) + +check(samefile("file1.1", "maindir/file1")) +check(samefile("file2.0", "maindir/file2")) +check(samefile("changelog.2", "maindir/changelog")) + +check(samefile("file1.2", "branchdir/file1")) +check(samefile("file2.1", "branchdir/file2")) +check(samefile("changelog.3", "branchdir/changelog")) ============================================================ --- tests/include()_and_includedir()_lua_functions/__driver__.lua 8a99da73447e7e10466652c3e38c3d93da7bfa1c +++ tests/include()_and_includedir()_lua_functions/__driver__.lua 8a99da73447e7e10466652c3e38c3d93da7bfa1c @@ -0,0 +1,28 @@ + +mtn_setup() + +mkdir("gongolo") + +writefile("include.lua", 'include("../gongolo/aaa.rc")') + +writefile("includedir.lua", 'includedir("../gongolo")') + +-- write two files and check that they will be invoked in alphabetic order +getfile("aaa.rc", "gongolo/aaa.rc") +getfile("bbb.zz", "gongolo/bbb.zz") + +-- setup a wrk dir +check(mtn("setup", "--branch=testbranch", "alt_wrk"), 0, false, false) + +-- include directly a single file +check(indir("alt_wrk", mtn("--root=.", "--rcfile=../include.lua", "status")), 0, true, false) +check(qgrep("BOOGA BOOGA", "stdout")) + +-- include dirs +check(indir("alt_wrk", mtn("--root=.", "--rcfile=../includedir.lua", "status")), 0, true, false) +check(qgrep("BOOGA BOOGACICCA CICCA", "stdout")) + +-- write a third file: should be read between the two previous ones +getfile("aba.rc", "gongolo/aba.rc") +check(indir("alt_wrk", mtn("--root=.", "--rcfile=../includedir.lua", "status")), 0, true, false) +check(qgrep("BOOGA BOOGAhu huCICCA CICCA", "stdout")) ============================================================ --- tests/include()_and_includedir()_lua_functions/aaa.rc 2f9056f39d5bcc01e635cf32ef9ff7eb83af4103 +++ tests/include()_and_includedir()_lua_functions/aaa.rc 2f9056f39d5bcc01e635cf32ef9ff7eb83af4103 @@ -0,0 +1,4 @@ +function paraponzi() + io.write("BOOGA BOOGA") +end +paraponzi() ============================================================ --- tests/include()_and_includedir()_lua_functions/aba.rc 5618e7aa67b39d372a68a74c37ff127743ebe520 +++ tests/include()_and_includedir()_lua_functions/aba.rc 5618e7aa67b39d372a68a74c37ff127743ebe520 @@ -0,0 +1,4 @@ +function notwowithoutthree() + io.write("hu hu") +end +notwowithoutthree() ============================================================ --- tests/include()_and_includedir()_lua_functions/bbb.zz b4a560359d1176679511dda9a06eaf7d4d311309 +++ tests/include()_and_includedir()_lua_functions/bbb.zz b4a560359d1176679511dda9a06eaf7d4d311309 @@ -0,0 +1,4 @@ +function labellagigogin() + io.write("CICCA CICCA") +end +labellagigogin() ============================================================ --- tests/lua_function_existsonpath/__driver__.lua 9021eacf7602e1515221c3b439c9ae4381cf4929 +++ tests/lua_function_existsonpath/__driver__.lua 9021eacf7602e1515221c3b439c9ae4381cf4929 @@ -0,0 +1,7 @@ + +mtn_setup() + +getfile("test.lua") +check(mtn("setup", "--rcfile=test.lua", "--branch=testbranch", "subdir"), 0, true, false) +check(qgrep("asdfghjkl", "stdout")) +check(qgrep("qwertyuiop", "stdout")) ============================================================ --- tests/lua_function_existsonpath/test.lua af3caa7d2d9dfd1d63b965edb61b77e96d83743c +++ tests/lua_function_existsonpath/test.lua af3caa7d2d9dfd1d63b965edb61b77e96d83743c @@ -0,0 +1,13 @@ +-- Need a way to break into the lua interpreter; our strategy is to +-- redefine the use_inodeprints function to run our code, and then +-- create a new workspace. + +function use_inodeprints() + if (existsonpath("ls") == 0 or existsonpath("xcopy") == 0) then + io.write("asdfghjkl\n") + end + if (existsonpath("weaohriosfaoisd") ~= 0) then + io.write("qwertyuiop\n") + end + return false +end ============================================================ --- tests/merge((drop_a),_(drop_a,_add_a))/__driver__.lua 69c464e4552692a45d837b745fcb0687ed2060e6 +++ tests/merge((drop_a),_(drop_a,_add_a))/__driver__.lua 69c464e4552692a45d837b745fcb0687ed2060e6 @@ -0,0 +1,38 @@ + +mtn_setup() + +writefile("original", "some stuff here") +writefile("replaced", "the re-added file") +writefile("nonce", "...nothing here...") + +copyfile("original", "testfile") +check(mtn("add", "testfile"), 0, false, false) +commit() +base = base_revision() + +-- drop it +check(mtn("drop", "testfile"), 0, false, false) +commit() + +revert_to(base) + +-- on the other side of the fork, drop it ... +check(mtn("drop", "testfile"), 0, false, false) +-- we add this file so that we don't end up with the same revision as +-- our first "drop" commit +check(mtn("add", "nonce"), 0, false, false) +commit() + +-- ... and add the replacement +-- on the other side of the fork, drop it +copyfile("replaced", "testfile") +check(mtn("add", "testfile"), 0, false, false) +commit() + +check(mtn("merge"), 0, false, false) +check(mtn("checkout", "-b", "testbranch", "clean"), 0, false, false) + +-- check that the file is the replacement one +check(samefile("clean/testfile", "replaced")) +-- just for good measure +check(samefile("clean/nonce", "nonce")) ============================================================ --- tests/merge((drop_a),_(rename_a_b,_patch_b))/__driver__.lua 6fd049ff377e80271b69e41a84ccc19fe6d2d0e7 +++ tests/merge((drop_a),_(rename_a_b,_patch_b))/__driver__.lua 6fd049ff377e80271b69e41a84ccc19fe6d2d0e7 @@ -0,0 +1,27 @@ + +mtn_setup() + +writefile("original", "some stuff here") + +check(mtn("add", "original"), 0, false, false) +commit() +base = base_revision() + +-- drop it +check(mtn("drop", "original"), 0, false, false) +commit() + +revert_to(base) + +-- patch and rename it +rename("original", "different") +check(mtn("rename", "original", "different"), 0, false, false) +append("different", "more\n") +commit() + +check(mtn("merge"), 0, false, false) +check(mtn("checkout", "-b", "testbranch", "clean"), 0, false, false) + +-- check that the file doesn't exist +check(not exists("clean/original")) +check(not exists("clean/different")) ============================================================ --- tests/merge_manual_file/__driver__.lua 0f88464cc74c9dc9631a81b607d86c3f830dd2cb +++ tests/merge_manual_file/__driver__.lua 0f88464cc74c9dc9631a81b607d86c3f830dd2cb @@ -0,0 +1,90 @@ + +mtn_setup() + +-- This was a real merge error. A binary file happily merged by monotone +-- just because contains some strategically placed line feeds +-- now is a test for the new attribute merge_manual and its effect on merging + +getfile("parent.bmp") +getfile("left.bmp") +getfile("right.bmp") + +-- hook forces all files binary +getfile("binary.lua") + +-- hook forces all files text +getfile("text.lua") + +-- --- first: auto add as binary +copyfile("parent.bmp", "binary.bmp") +check(mtn("--rcfile=binary.lua", "add", "binary.bmp"), 0, false, false) +commit("binbranch") +parent = base_revision() + +check(mtn("attr", "get", "binary.bmp", "mtn:manual_merge"), 0, false, false) + +copyfile("left.bmp", "binary.bmp") +commit("binbranch") + +revert_to(parent) + +copyfile("right.bmp", "binary.bmp") +commit("binbranch") + +-- file marked binary: merge should fail +check(mtn("--branch=binbranch", "merge"), 1, false, false) + +-- --- second: auto add as text +copyfile("parent.bmp", "text.bmp") +check(mtn("--rcfile=text.lua", "add", "text.bmp"), 0, false, false) +commit("textbranch") +parent = base_revision() + +copyfile("left.bmp", "text.bmp") +commit("textbranch") + +revert_to(parent) + +copyfile("right.bmp", "text.bmp") +commit("textbranch") + +-- file marked text: merge should work! +check(mtn("--branch=textbranch", "merge"), 0, false, false) + +-- --- third: manually make filename as binary +copyfile("parent.bmp", "forcebin.bmp") +check(mtn("--rcfile=text.lua", "add", "forcebin.bmp"), 0, false, false) +commit("forcebinbranch") +parent = base_revision() + +copyfile("left.bmp", "forcebin.bmp") +commit("forcebinbranch") + +revert_to(parent) + +copyfile("right.bmp", "forcebin.bmp") + +-- set bin +check(mtn("attr", "set", "forcebin.bmp", "mtn:manual_merge", "true"), 0, false, false) +commit("forcebinbranch") + +-- file marked binary: merge should fail +check(mtn("--branch=forcebinbranch", "merge"), 1, false, false) + +-- --- fourth: automatically make filename as binary, then force text +copyfile("parent.bmp", "forcetext.bmp") +check(mtn("--rcfile=binary.lua", "add", "forcetext.bmp"), 0, false, false) +check(mtn("attr", "set", "forcetext.bmp", "mtn:manual_merge", "false"), 0, false, false) +commit("forcetextbranch") +parent = base_revision() + +copyfile("left.bmp", "forcetext.bmp") +commit("forcetextbranch") + +revert_to(parent) + +copyfile("right.bmp", "forcetext.bmp") +commit("forcetextbranch") + +-- file marked text: merge should work +check(mtn("--branch=forcetextbranch", "merge"), 0, false, false) ============================================================ --- tests/merge_manual_file/binary.lua 8165660330a920f60163cebd9c45ca67d934c463 +++ tests/merge_manual_file/binary.lua 8165660330a920f60163cebd9c45ca67d934c463 @@ -0,0 +1,2 @@ +if (attr_init_functions == nil) then attr_init_functions = {} end +attr_init_functions["mtn:manual_merge"] = function(filename) return "true" end ============================================================ # tests/merge_manual_file/left.bmp is binary ============================================================ # tests/merge_manual_file/parent.bmp is binary ============================================================ # tests/merge_manual_file/right.bmp is binary ============================================================ --- tests/merge_manual_file/text.lua 7a47dcb82afd7a6251eeed4db360c2f19279ee1c +++ tests/merge_manual_file/text.lua 7a47dcb82afd7a6251eeed4db360c2f19279ee1c @@ -0,0 +1,2 @@ +if (attr_init_functions == nil) then attr_init_functions = {} end +attr_init_functions["mtn:manual_merge"] = function(filename) return "false" end ============================================================ --- tests/mtn_up/__driver__.lua 28537ed44bab1e3edc470217a84573ba36d3090c +++ tests/mtn_up/__driver__.lua 28537ed44bab1e3edc470217a84573ba36d3090c @@ -0,0 +1,17 @@ + +mtn_setup() + +-- People expect 'mtn up' to run update. +-- Make sure it does. + +addfile("testfile", "blah blah") +commit() +rev0 = base_revision() + +writefile("testfile", "other stuff") +commit() +rev1 = base_revision() + +check(mtn("checkout", "--branch=testbranch", "--revision", rev0, "codir"), 0, false, false) +check(indir("codir", mtn("up")), 0, false, false) +check(samefile("testfile", "codir/testfile")) ============================================================ --- tests/netsync,--exclude,defaults/__driver__.lua af272762b9ba75768308bd021b2992bee7599531 +++ tests/netsync,--exclude,defaults/__driver__.lua af272762b9ba75768308bd021b2992bee7599531 @@ -0,0 +1,93 @@ + +include("common/netsync.lua") +mtn_setup() +netsync.setup() + +addfile("testfile", "1") +commit("branch1") +B11=base_revision() + +writefile("testfile", "2") +commit("branch2") +B21=base_revision() + + +netsync.pull({'branch*', "--exclude=branch2"}) +check(mtn2("automate", "get_revision", B11), 0, false, false) +check(mtn2("automate", "get_revision", B21), 1, false, false) + +revert_to(B11) +writefile("testfile", "12") +commit("branch1") +B12=base_revision() + +revert_to(B21) +writefile("testfile", "21") +commit("branch2") +B22=base_revision() + +netsync.pull() +check(mtn2("automate", "get_revision", B11), 0, false, false) +check(mtn2("automate", "get_revision", B21), 1, false, false) +check(mtn2("automate", "get_revision", B12), 0, false, false) +check(mtn2("automate", "get_revision", B22), 1, false, false) + +-- passing only an include pattern causes the default exclude to be +-- ignored... +netsync.pull("branch2") +check(mtn2("automate", "get_revision", B11), 0, false, false) +check(mtn2("automate", "get_revision", B21), 0, false, false) +check(mtn2("automate", "get_revision", B12), 0, false, false) +check(mtn2("automate", "get_revision", B22), 0, false, false) + +-- but not set by default + +revert_to(B12) +writefile("testfile", "13") +commit("branch1") +B13=base_revision() + +revert_to(B22) +writefile("testfile", "23") +commit("branch2") +B23=base_revision() + +netsync.pull() +check(mtn2("automate", "get_revision", B11), 0, false, false) +check(mtn2("automate", "get_revision", B21), 0, false, false) +check(mtn2("automate", "get_revision", B12), 0, false, false) +check(mtn2("automate", "get_revision", B22), 0, false, false) +check(mtn2("automate", "get_revision", B13), 0, false, false) +check(mtn2("automate", "get_revision", B23), 1, false, false) + +-- but --set-default overrides + +srv = netsync.start("branch*") +srv:pull({"--set-default", 'branch*'}) +srv:stop() +check(mtn2("automate", "get_revision", B11), 0, false, false) +check(mtn2("automate", "get_revision", B21), 0, false, false) +check(mtn2("automate", "get_revision", B12), 0, false, false) +check(mtn2("automate", "get_revision", B22), 0, false, false) +check(mtn2("automate", "get_revision", B13), 0, false, false) +check(mtn2("automate", "get_revision", B23), 0, false, false) + +revert_to(B13) +writefile("testfile", "14") +commit("branch1") +B14=base_revision() + +revert_to(B23) +writefile("testfile", "24") +commit("branch2") +B24=base_revision() + +netsync.pull() +check(mtn2("automate", "get_revision", B11), 0, false, false) +check(mtn2("automate", "get_revision", B21), 0, false, false) +check(mtn2("automate", "get_revision", B12), 0, false, false) +check(mtn2("automate", "get_revision", B22), 0, false, false) +check(mtn2("automate", "get_revision", B13), 0, false, false) +check(mtn2("automate", "get_revision", B23), 0, false, false) +check(mtn2("automate", "get_revision", B14), 0, false, false) +check(mtn2("automate", "get_revision", B24), 0, false, false) ============================================================ --- tests/netsync,--set-default/__driver__.lua 4c5eb0ab9568e85c306b57953b89f4c2b8830ab8 +++ tests/netsync,--set-default/__driver__.lua 4c5eb0ab9568e85c306b57953b89f4c2b8830ab8 @@ -0,0 +1,44 @@ + +include("common/netsync.lua") +mtn_setup() +netsync.setup() +rseed = os.time() + +addfile("testfile", "foo") +commit() +t1 = base_revision() + +-- set defaults in db 2 +math.randomseed(rseed) +netsync.pull("testbranch") +check(mtn2("automate", "get_revision", t1), 0, false, false) + +writefile("testfile", "blah blah") +commit() +t2 = base_revision() + +-- make sure the defaults really were set to 'testbranch' +math.randomseed(rseed) +srv = netsync.start("testbranch") +check(mtn2("pull"), 0, false, false) +srv:stop() +check(mtn2("automate", "get_revision", t2), 0, false, false) + +-- do a --set-default pull of another branch +math.randomseed(rseed) +srv = netsync.start("otherbranch") +srv:pull({"otherbranch", "--set-default"}) +srv:stop() + +-- create a new revision on that branch +writefile("testfile", "other1") +commit("otherbranch") +o1 = base_revision() + +-- and make sure that our default is now it +math.randomseed(rseed) +srv = netsync.start("otherbranch") +check(mtn2("pull"), 0, false, false) +srv:stop() + +check(mtn2("automate", "get_revision", o1), 0, false, false) ============================================================ --- tests/netsync_badhost_gives_nice_error/__driver__.lua 5f30e23ba6cf8fcbdf56655180684b0fe762eb52 +++ tests/netsync_badhost_gives_nice_error/__driver__.lua 5f30e23ba6cf8fcbdf56655180684b0fe762eb52 @@ -0,0 +1,4 @@ + +mtn_setup() + +check(mtn("pull", "nosuchhost__blahblah__asdvasoih.com", "some.pattern"), 1, false, false) ============================================================ --- tests/netsync_permissions/__driver__.lua 2a9a12c8b7b2ad5ee4152db77bc6a3d5d18771d9 +++ tests/netsync_permissions/__driver__.lua 2a9a12c8b7b2ad5ee4152db77bc6a3d5d18771d9 @@ -0,0 +1,184 @@ + +include("/common/netsync.lua") +mtn_setup() +keys = {} +revs = {} + +-- generate a new key +function genkey(keyname, mt) + if mt == nil then mt = mtn end + check(mt("genkey", keyname), 0, false, false, string.rep(keyname.."\n", 2)) +end + +keys.other = "address@hidden" +genkey(keys.other) + +netsync.setup() + +-- test with open security settings +gettree("open") + +addfile("badfile", "badfile") +commit("badbranch", "badfile") + +copyfile("test.db", "clean.db") +copy_recursive("keys", "clean_keys") +function clean(n) + if n == nil or n == 1 then n = "" end + copyfile("clean.db", "test"..n..".db") + remove_recursive("keys"..n) + copy_recursive("clean_keys", "keys"..n) +end + +addfile("testfile", "testfile") +commit("testbranch", "testfile") +revs.base = base_revision() + +srv = netsync.start({"testbranch", "--confdir=open"}, nil, true) + +-- anonymous pull + +clean(2) + +srv:pull({"testbranch", "--key="}) +check(mtn2("automate", "get_revision", revs.base), 0, true, true) + +-- pull with default key + +clean(2) + +srv:pull("testbranch") +check(mtn2("automate", "get_revision", revs.base), 0, true, true) + +-- pull with other key + +clean(2) + +srv:pull({"testbranch", "--key", keys.other}) +check(mtn2("automate", "get_revision", revs.base), 0, true, true) + +-- pull with unknown key fails + +clean(2) + +keys.unknown = "address@hidden" +genkey(keys.unknown, mtn2) +srv:pull({"testbranch", "--key", keys.unknown}, nil, 1) +check(mtn2("automate", "get_revision", revs.base), 1, true, true) + +-- push with default key + +copyfile("test.db", "test2.db") +remove_recursive("keys2") +copy_recursive("keys", "keys2") +revert_to(revs.base, mtn2) +addfile("default", "default", mtn2) +check(mtn2("commit", "--message", "default"), 0, false, false) +revs.default = base_revision() +srv:push("testbranch") + +-- push with other key + +revert_to(revs.base, mtn2) +addfile("other", "other", mtn2) +check(mtn2("commit", "--message", "other"), 0, false, false) +revs.other = base_revision() +srv:push({"testbranch", "--key", keys.other}) + +-- push with unknown key fails + +revert_to(revs.base, mtn2) +addfile("unknown", "unknown", mtn2) +check(mtn2("commit", "--message", "unknown"), 0, false, false) +revs.unknown = base_revision() +genkey(keys.unknown, mtn2) +srv:push({"testbranch", "--key", keys.unknown}, nil, 1) + +srv:stop() + +check(mtn("automate", "get_revision", revs.default), 0, true, true) +check(mtn("automate", "get_revision", revs.other), 0, true, true) +check(mtn("automate", "get_revision", revs.unknown), 1, true, true) + + +-- test with closed security settings +gettree("closed") + +clean() +writefile("_MTN/revision", "") + +addfile("testfile", "testfile", mtn2) +commit("testbranch", "testfile") +revs.base = base_revision() + +srv = netsync.start({"testbranch", "--confdir=closed"}, nil, true) + +-- anonymous pull fails + +clean(2) + +srv:pull({"testbranch", "--key="}, nil, 1) +check(mtn2("automate", "get_revision", revs.base), 1, true, true) + +-- pull with default key + +clean(2) + +srv:pull("testbranch") +check(mtn2("automate", "get_revision", revs.base), 0, true, true) + +-- pull with bad branch fails + +clean(2) + +srv:pull("badbranch", nil, 1) +check(mtn2("automate", "get_revision", revs.base), 1, true, true) + +-- pull with other key fails + +clean(2) + +srv:pull({"testbranch", "--key", keys.other}, nil, 1) +check(mtn2("automate", "get_revision", revs.base), 1, true, true) + +-- pull with unknown key fails + +clean(2) + +genkey(keys.unknown, mtn2) +srv:pull({"testbranch", "--key", keys.unknown}, nil, 1) +check(mtn2("automate", "get_revision", revs.base), 1, true, true) + +-- push with default key + +copyfile("test.db", "test2.db") +remove_recursive("keys2") +copy_recursive("keys", "keys2") +revert_to(revs.base, mtn2) +addfile("default", "default", mtn2) +check(mtn2("commit", "--message", "default"), 0, false, false) +revs.default = base_revision() +srv:push("testbranch") + +-- push with other key + +revert_to(revs.base, mtn2) +addfile("other", "other", mtn2) +check(mtn2("commit", "--message", "other"), 0, false, false) +revs.other = base_revision() +srv:push({"testbranch", "--key", keys.other}, nil, 1) + +-- push with unknown key fails + +revert_to(revs.base, mtn2) +addfile("unknown", "unknown", mtn2) +check(mtn2("commit", "--message", "unknown"), 0, false, false) +revs.unknown = base_revision() +genkey(keys.unknown, mtn2) +srv:push({"testbranch", "--key", keys.unknown}, nil, 1) + +srv:stop() + +check(mtn("automate", "get_revision", revs.default), 0, true, true) +check(mtn("automate", "get_revision", revs.other), 1, true, true) +check(mtn("automate", "get_revision", revs.unknown), 1, true, true) ============================================================ --- tests/netsync_permissions/closed/read-permissions b9bae8e35f085049ddfa0cfe92308a79998ad6d0 +++ tests/netsync_permissions/closed/read-permissions b9bae8e35f085049ddfa0cfe92308a79998ad6d0 @@ -0,0 +1,2 @@ +pattern "*" +allow "address@hidden" ============================================================ --- tests/netsync_permissions/closed/write-permissions 7c7c39a59bd0707ca1d72192adc9b3871f554918 +++ tests/netsync_permissions/closed/write-permissions 7c7c39a59bd0707ca1d72192adc9b3871f554918 @@ -0,0 +1,1 @@ address@hidden ============================================================ --- tests/netsync_permissions/open/read-permissions 54cdd7a94f8a850db29ca0df95b52cd417fd9620 +++ tests/netsync_permissions/open/read-permissions 54cdd7a94f8a850db29ca0df95b52cd417fd9620 @@ -0,0 +1,2 @@ +pattern "*" +allow "*" ============================================================ --- tests/netsync_permissions/open/write-permissions b462aee1c6c401b3c709a746e9400677c2ffbeb2 +++ tests/netsync_permissions/open/write-permissions b462aee1c6c401b3c709a746e9400677c2ffbeb2 @@ -0,0 +1,1 @@ +* ============================================================ --- tests/netsync_with_globs/__driver__.lua 8ec16aa6ff7e2be6959e78af1ae2c04251150dd9 +++ tests/netsync_with_globs/__driver__.lua 8ec16aa6ff7e2be6959e78af1ae2c04251150dd9 @@ -0,0 +1,37 @@ + +include("common/netsync.lua") +mtn_setup() +netsync.setup() +revs = {} + +addfile("testfile", "foo") +commit("1branch1") +revs[11] = base_revision() + +remove_recursive("_MTN") +check(mtn("setup", "--branch=testbranch", ".")) +addfile("testfile", "bar") +commit("1branch2") +revs[12] = base_revision() + +remove_recursive("_MTN") +check(mtn("setup", "--branch=testbranch", ".")) +addfile("testfile", "baz") +commit("2branch1") +revs[21] = base_revision() + +srv = netsync.start("*branch*") + +-- check a glob +srv:pull("*anch2") +check(mtn2("automate", "get_revision", revs[11]), 1, false, false) +check(mtn2("automate", "get_revision", revs[12]), 0, false, false) +check(mtn2("automate", "get_revision", revs[21]), 1, false, false) + +-- check explicit multiple branches +srv:pull({"1branch1", "2branch1"}, 3) +check(mtn3("automate", "get_revision", revs[11]), 0, false, false) +check(mtn3("automate", "get_revision", revs[12]), 1, false, false) +check(mtn3("automate", "get_revision", revs[21]), 0, false, false) + +srv:stop() ============================================================ --- tests/restricted_commit_with_inodeprints/__driver__.lua b11b4fbd4ed1b88ccb61d2b9ea5347c61a360c47 +++ tests/restricted_commit_with_inodeprints/__driver__.lua b11b4fbd4ed1b88ccb61d2b9ea5347c61a360c47 @@ -0,0 +1,37 @@ + +mtn_setup() + +-- this test is a bug report. the problem is that inodeprints tries to update its +-- cache for all files in the complete manifest, but a restricted commit can +-- succeed with missing files if they are excluded. subsequently the inodeprint +-- update fails because it can't build a complete manifest due to the missing +-- files. + +-- one solution is to let inodeprints update its cache only for files that are +-- included in the restriction, which seems to be safe. the only gaurentee that +-- inodeprints mode makes is that if a file's current inodeprint matches its +-- cached inodprint then it has not changed. i.e. for a missing file, the cache +-- would not be updated but the old cached value can't possibly equal the current +-- value since the file does not exist and cannot have an inodeprint. + +-- also, it may be a useful feature (?) to allow refresh_inodeprints to update +-- its cache for a restricted set of files by allowing paths on the command line +-- to establish a restriction. + +addfile("file1", "file1") + +commit() + +-- enable inodeprints mode +check(mtn("refresh_inodeprints"), 0, false, false) + +addfile("file2", "file2") + +-- create a missing file + +remove("file1") + +-- restricted commit of file2 succeeds with file1 missing +-- but the corresponding inodeprint update fails + +xfail_if(true, mtn("commit", "--message=file2", "file2"), 0, false, false) ============================================================ --- tests/revert_works_with_restrictions/__driver__.lua 029948a123b9fc57318b084f9951a6a33e18614e +++ tests/revert_works_with_restrictions/__driver__.lua 029948a123b9fc57318b084f9951a6a33e18614e @@ -0,0 +1,67 @@ + +mtn_setup() + +writefile("origfile", "some file") +writefile("orig.ignore", "a file type that is usually ignored") +writefile("orig2", "another file") +writefile("modified1", "this is different 1") +writefile("modified2", "this is different 2") +writefile("modified3", "this is different 3") + +getfile("ignore_hook.lua") + +copyfile("origfile", "testfile") +copyfile("orig.ignore", "file.ignore") +copyfile("orig2", "file2") +check(mtn("add", "testfile", "file.ignore", "file2"), 0, false, false) +commit() + +-- modify the files, then revert the 'ignored' file +copyfile("modified1", "testfile") +copyfile("modified2", "file.ignore") + +check(mtn("--rcfile=ignore_hook.lua", "revert", "file.ignore"), 0, false, false) + +-- check that only the 'ignored' file was reverted +check(samefile("testfile", "modified1")) +check(samefile("file.ignore", "orig.ignore")) + +-- now run it again with two paths, one in the ignorehook list, the other normal +check(mtn("revert", "."), 0, false, false) +copyfile("modified1", "testfile") +copyfile("modified2", "file.ignore") +copyfile("modified3", "file2") + +check(mtn("--rcfile=ignore_hook.lua", "revert", "file.ignore", "testfile"), 0, false, false) + +-- check that the files are correct +check(samefile("testfile", "origfile")) +check(samefile("file.ignore", "orig.ignore")) +check(samefile("file2", "modified3")) + + +-- now try just reverting missing files + +copyfile("modified1", "testfile") +copyfile("modified2", "file.ignore") +remove("file2") + +check(mtn("--rcfile=ignore_hook.lua", "revert", "--missing", ".", "--debug"), 0, false, false) + +check(samefile("testfile", "modified1")) +check(samefile("file.ignore", "modified2")) +check(samefile("file2", "orig2")) + + +-- make sure that 'revert --missing' when there are no missing files doesn't +-- revert existing changes + +copyfile("modified1", "testfile") +copyfile("orig.ignore", "file.ignore") +copyfile("orig2", "file2") + +check(mtn("--rcfile=ignore_hook.lua", "revert", "--missing", ".", "--debug"), 0, false, false) + +check(samefile("testfile", "modified1")) +check(samefile("file.ignore", "orig.ignore")) +check(samefile("file2", "orig2")) ============================================================ --- tests/revert_works_with_restrictions/ignore_hook.lua 5cc426588fd14d14e88b53a9aba25ea1667ae043 +++ tests/revert_works_with_restrictions/ignore_hook.lua 5cc426588fd14d14e88b53a9aba25ea1667ae043 @@ -0,0 +1,6 @@ +function ignore_file(name) +if (string.find(name, "test_hooks.lua")) then return true end +if (string.find(name, "test.db")) then return true end +if (string.find(name, "%.ignore$")) then return true end +return false +end ============================================================ --- tests/serve_pull_with_--exclude/__driver__.lua 7b542291fc5d2565cc1f5d7ba2c828e205fa43d2 +++ tests/serve_pull_with_--exclude/__driver__.lua 7b542291fc5d2565cc1f5d7ba2c828e205fa43d2 @@ -0,0 +1,48 @@ + +include("common/netsync.lua") +mtn_setup() +netsync.setup() + +addfile("testfile", "1") +commit("branch1") +B1=base_revision() + +writefile("testfile", "2") +commit("branch2") +B2=base_revision() + +addfile("testfile", "3") +commit("branch3") +B3=base_revision() + +writefile("testfile", "4") +commit("branch4") +B4=base_revision() + +-- Serve excluding branch2, branch4 +-- attempting to pull them should fail +-- pulling everything but them should give revs B1, B2, B3; and only +-- give branch certs on B1, B3. + +srv = netsync.start({'branch*', "--exclude=branch2", "--exclude=branch4"}) + +-- it is apparently a permissions error to pull a branch that is not served +-- i.e. 'received network error: access to branch 'branch2' denied by server' + +srv:pull("branch2", nil, 1) +srv:pull("branch4", nil, 1) +check(mtn2("automate", "get_revision", B1), 1, false, false) +check(mtn2("automate", "get_revision", B2), 1, false, false) +check(mtn2("automate", "get_revision", B3), 1, false, false) +check(mtn2("automate", "get_revision", B4), 1, false, false) + +srv:pull({'branch*', "--exclude=branch2", "--exclude=branch4"}) +check(mtn2("automate", "get_revision", B1), 0, false, false) +check(mtn2("automate", "get_revision", B2), 0, false, false) +check(mtn2("automate", "get_revision", B3), 0, false, false) +check(mtn2("automate", "get_revision", B4), 1, false, false) + +check(mtn2("ls", "certs", B2), 0, true) +check(not qgrep("branch2", "stdout")) + +srv:stop() ============================================================ --- tests/status/__driver__.lua d82db56f60793a252c6f7b7b1a7d49f622b79640 +++ tests/status/__driver__.lua d82db56f60793a252c6f7b7b1a7d49f622b79640 @@ -0,0 +1,62 @@ + +mtn_setup() + +-- patch existing file +-- add new file (with patch) +-- rename existing file +-- rename and patch existing file +-- drop existing file + +-- again with --brief + +addfile("from", "from") +addfile("from_patched", "from_patched") +addfile("patched", "patched") +addfile("dropped", "dropped") + +commit() + +addfile("added", "added") + +writefile("from_patched", "from_patched \npatched") +writefile("patched", "patched \npatched") + +check(mtn("drop", "dropped"), 0, false, false) + +rename("from", "to") +rename("from_patched", "to_patched") + +check(mtn("rename", "from", "to"), 0, false, false) +check(mtn("rename", "from_patched", "to_patched"), 0, false, false) + +check(mtn("status"), 0, true, false) +check(qgrep('^delete "dropped"', "stdout")) +check(qgrep('^rename "from"', "stdout")) +check(qgrep('^ to "to"', "stdout")) +check(qgrep('^rename "from_patched"', "stdout")) +check(qgrep('^ to "to_patched"', "stdout")) +check(qgrep('^add_file "added"', "stdout")) +check(qgrep('^patch "patched"', "stdout")) +check(qgrep('^patch "to_patched"', "stdout")) + +check(mtn("status", "--brief"), 0, true, false) +check(qgrep('^dropped dropped', "stdout")) +check(qgrep('^renamed from', "stdout")) +check(qgrep('^ to to', "stdout")) +check(qgrep('^renamed from_patched', "stdout")) +check(qgrep('^ to to_patched', "stdout")) +check(qgrep('^added added', "stdout")) +check(qgrep('^patched patched', "stdout")) +check(qgrep('^patched to_patched', "stdout")) + +-- restricted + +check(mtn("status", "from", "from_patched"), 0, true, false) +check(not qgrep('^delete "dropped"', "stdout")) +check(qgrep('^rename "from"', "stdout")) +check(qgrep('^ to "to"', "stdout")) +check(qgrep('^rename "from_patched"', "stdout")) +check(qgrep('^ to "to_patched"', "stdout")) +check(not qgrep('^add_file "added"', "stdout")) +check(not qgrep('^patch "patched"', "stdout")) +check(qgrep('^patch "to_patched"', "stdout")) ============================================================ --- tests/update_with_blocked_rename/__driver__.lua 45d2da529267f5a4c45aca31307e7b0ea8d64107 +++ tests/update_with_blocked_rename/__driver__.lua 45d2da529267f5a4c45aca31307e7b0ea8d64107 @@ -0,0 +1,65 @@ + +mtn_setup() + +-- This test is a bug report + +-- 1. Alice starts a project and creates some files +-- 2. Bob checks out the project and gets the files +-- 3. Bob creates a file bar, but forgets to add it +-- 4. Alice renames one of her files to bar +-- 5. Bob updates +-- +-- the update fails after moving renamed files to _MTN/tmp/N +-- where N is the file's tid. +-- +-- Bob is left with a bunch of missing files. + +mkdir("alice") + +-- Alice starts a projectand creates foo +check(mtn("--branch=testbranch", "setup", "alice"), 0, false, false) +for i = 1,10 do + writefile("alice/file."..i, "file "..i) + check(indir("alice", mtn("add", "file."..i)), 0, false, false) +end +check(indir("alice", mtn("commit", "-m", 'alice adds files')), 0, false, false) + +-- Bob checks out project, gets files and creates file bar +check(mtn("--branch=testbranch", "checkout", "bob"), 0, false, false) +writefile("bob/bar", "bob's bar") + +-- Alice renames some files +check(indir("alice", mtn("rename", "file.3", "bar")), 0, false, false) +check(indir("alice", mtn("rename", "file.4", "bar.4")), 0, false, false) +check(indir("alice", mtn("rename", "file.5", "bar.5")), 0, false, false) +rename("alice/file.3", "alice/bar") +rename("alice/file.4", "alice/bar.4") +rename("alice/file.5", "alice/bar.5") +check(indir("alice", mtn("commit", "-m", 'alice renames files')), 0, false, false) + +-- Bob updates but bar is in the way +xfail_if(true, indir("bob", mtn("update")), 0, false, false) + + +-- non-renamed files remain + +check(exists("bob/file.1")) +check(exists("bob/file.2")) +for i in 6,10 do + check(exists("bob/file."..i)) +end + +-- renamed files are gone + +-- check(test -e bob/file.3, 1, true) +-- check(test -e bob/file.4, 1, true) +-- check(test -e bob/file.5, 1, true) + +-- original bar still exists + +-- check(exists("bob/bar")) + +-- other renames are also gone + +-- check(test -e bob/bar.4, 1, true) +-- check(test -e bob/bar.5, 1, true) ============================================================ --- tests/update_with_pending_add/__driver__.lua 706c22d2e8901decc719736c78bc29f59f81460a +++ tests/update_with_pending_add/__driver__.lua 706c22d2e8901decc719736c78bc29f59f81460a @@ -0,0 +1,24 @@ + +mtn_setup() + +-- This test relies on file-suturing + +addfile("file", "file") + +commit() + +check(mtn("--branch", "testbranch", "co", "codir"), 0, false, false) + +addfile("file2", "file2") + +commit() + +writefile("codir/file2", "file2") +check(indir("codir", mtn("add", "file2")), 0, false, false) +xfail_if(true, indir("codir", mtn("update")), 0, false, false) + +-- make sure there are no changes in the workspace + +check(not exists("codir/_MTN/work")) +check(indir("codir", mtn("diff")), 0, true, false) +check(grep('no changes', "stdout"), 0, false, false) ============================================================ --- tests/update_with_pending_drop/__driver__.lua 5c2efb1ebaa72fd90a390531e593aa76e2f910d4 +++ tests/update_with_pending_drop/__driver__.lua 5c2efb1ebaa72fd90a390531e593aa76e2f910d4 @@ -0,0 +1,26 @@ + +mtn_setup() + +addfile("file", "test1") + +commit() + +check(mtn("--branch=testbranch", "co", "codir"), 0, false, false) + +remove("file") +check(mtn("drop", "file"), 0, false, false) + +commit() + +rev = base_revision() + +check(indir("codir", mtn("drop", "file")), 0, false, false) +check(indir("codir", mtn("update")), 0, false, false) + +check(indir("codir", mtn("automate", "get_revision", rev)), 0, false, false) + +-- make sure there are no changes in the workspace + +check(not exists("codir/_MTN/work")) +check(indir("codir", mtn("diff")), 0, true, false) +check(grep('no changes', "stdout"), 0, false, false) ============================================================ --- tests/update_with_pending_rename/__driver__.lua 3e2ddcda0c33999afe2e9d4da25f304f03b9a9ae +++ tests/update_with_pending_rename/__driver__.lua 3e2ddcda0c33999afe2e9d4da25f304f03b9a9ae @@ -0,0 +1,27 @@ + +mtn_setup() + +addfile("file", "test1") + +commit() + +check(mtn("--branch", "testbranch", "co", "codir"), 0, false, false) + +rename("file", "file2") +check(mtn("rename", "file", "file2"), 0, false, false) + +commit() + +rev = base_revision() + +rename("codir/file", "codir/file2") +check(indir("codir", mtn("rename", "file", "file2")), 0, false, false) +check(indir("codir", mtn("update")), 0, false, false) + +check(indir("codir", mtn("automate", "get_revision", rev)), 0, false, false) + +-- make sure there are no changes in the workspace + +check(not exists("codir/_MTN/work")) +check(indir("codir", mtn("diff")), 0, true, false) +check(grep('no changes', "stdout"), 0, false, false) ============================================================ --- tester-testsuite.lua f8a219a25dfb1fec89bec2ff3b85ebde3a2c26a1 +++ tester-testsuite.lua efc8052e5758fde01b30095b8f38c8f7e2c4d371 @@ -1,3 +1,5 @@ table.insert(tests, "tester-tests/isolated-1") table.insert(tests, "tester-tests/isolated-2") +table.insert(tests, "tester-tests/cleanup-1") +table.insert(tests, "tester-tests/cleanup-2") ============================================================ --- tester.cc ebcd0595b678ca833fae72cd88ef06ce04900c3e +++ tester.cc d7d6d95ea8887147d34a4e2c30101c96d13beccb @@ -121,6 +121,10 @@ from = 2; mode = "w"; break; + default: + from = -1; + mode = ""; + break; }; int saved = dup(from); FILE *f = fopen(where.c_str(), mode); @@ -144,6 +148,9 @@ case redirect::err: from = 2; break; + default: + from = -1; + break; }; dup2(saved, from); close(saved); @@ -219,7 +226,7 @@ throw oops("lua error"); } -void copy_recursive(fs::path const &from, fs::path const &to) +void do_copy_recursive(fs::path const &from, fs::path const &to) { if (!fs::exists(from)) return; @@ -229,7 +236,7 @@ { fs::create_directory(to); for (fs::directory_iterator i(from); i != fs::directory_iterator(); ++i) - copy_recursive(*i, to / i->leaf()); + do_copy_recursive(*i, to / i->leaf()); } else fs::copy_file(from, to); @@ -293,7 +300,7 @@ { fs::path from(luaL_checkstring(L, -2)); fs::path to(luaL_checkstring(L, -1)); - copy_recursive(from, to); + do_copy_recursive(from, to); return 0; } @@ -421,8 +428,8 @@ static int timed_wait(lua_State * L) { - pid_t pid = luaL_checknumber(L, -2); - int time = luaL_checknumber(L, -1); + pid_t pid = static_cast(luaL_checknumber(L, -2)); + int time = static_cast(luaL_checknumber(L, -1)); int res; int ret; ret = process_wait(pid, &res, time); ============================================================ --- tester.lua 5f1a016857d523931cf04c1e8fe806438a22f1bb +++ tester.lua ff331bfe3880d27ad016976a761ea1c2a12baf75 @@ -1,10 +1,16 @@ tests = {} -- list of all tests, not visible when running tests test = {} -- table of per-test values -- misc global values + +-- where the main testsuite file is srcdir = get_source_dir() -debugging = false -- was the -d switch given? +-- where the individual test dirs are +-- most paths will be testdir.."/something" +testdir = srcdir +-- was the -d switch given? +debugging = false -- combined logfile logfile = io.open("tester.log", "w") @@ -231,7 +237,8 @@ end function getstdfile(name, as) - copyfile(srcdir .. "/" .. name, as) + if as == nil then as = name end + copyfile(testdir .. "/" .. name, as) end function getfile(name, as) @@ -239,13 +246,22 @@ getstdfile(test.name .. "/" .. name, as) end -function runstdfile(name) - local func, e = loadfile(srcdir.."/"..name) +-- include from the main tests directory; there's no reason +-- to want to include from the dir for the current test, +-- since in that case it could just go in the driver file. +function include(name) + local func, e = loadfile(testdir.."/"..name) if func == nil then err(e, 2) end setfenv(func, getfenv(2)) func() end +function gettree(name, as) + if as == nil then as = name end + L(locheader(), "gettree(", name, ", ", as, ")\n") + copy_recursive(testdir.."/"..test.name.."/"..name, as) +end + function trim(str) return string.gsub(str, "^%s*(.-)%s*$", "%1") end @@ -773,7 +789,7 @@ test.log = io.open(tlog, "w") L("Test number ", i, ", ", shortname, "\n") - local driverfile = srcdir .. "/" .. test.name .. "/__driver__.lua" + local driverfile = testdir .. "/" .. test.name .. "/__driver__.lua" local driver, e = loadfile(driverfile) local r if driver == nil then @@ -782,6 +798,9 @@ else setfenv(driver, env) r,e = xpcall(driver, debug.traceback) + if type(env.cleanup) == "function" then + pcall(env.cleanup) + end for i,b in pairs(test.bglist) do b:finish(0) end ============================================================ --- tests/(imp)_persistent_netsync_server_-_keys_2/__driver__.lua 2fe10078108e4d096b9dbcf5f06646aafa48caa4 +++ tests/(imp)_persistent_netsync_server_-_keys_2/__driver__.lua c1d97d0eb0076014df8ff5035970c98d6974df40 @@ -1,4 +1,5 @@ +include("/common/netsync.lua") mtn_setup() netsync.setup() ============================================================ --- tests/(normal)_netsync_on_partially_unrelated_revisions/__driver__.lua e4a38f668b917cbecbfd6f57c58e4e74e9b49bb9 +++ tests/(normal)_netsync_on_partially_unrelated_revisions/__driver__.lua 356482e7999f737c6c59ed8da992b0c32e971b8c @@ -1,4 +1,5 @@ +include("/common/netsync.lua") mtn_setup() -- This test relies on file-suturing ============================================================ --- tests/(normal)_netsync_revision_with_no_certs/__driver__.lua 2bbd52668852e70d2de34efa8691dfed064f3eb6 +++ tests/(normal)_netsync_revision_with_no_certs/__driver__.lua ff7747ae3821464879ae780c23e43c5fcff9b88c @@ -1,4 +1,5 @@ +include("/common/netsync.lua") mtn_setup() netsync.setup() ============================================================ --- tests/automate_ancestors/__driver__.lua 1047d5c87aa3ac11b1dce31e313bd37ad8a1bf80 +++ tests/automate_ancestors/__driver__.lua 3555788d1dfcdf475b57828e35a6dff1091ed3db @@ -10,7 +10,7 @@ -- D E -- \/ -- F -runstdfile("tests/common/automate_ancestry.lua") +include("/common/automate_ancestry.lua") revs = make_graph() ============================================================ --- tests/automate_ancestry_difference/__driver__.lua 2b18e891d28c87e681cae262a3a31ea336eb4ade +++ tests/automate_ancestry_difference/__driver__.lua 687f03320d55546d2cfb300fae7d51259c9805e7 @@ -8,7 +8,7 @@ -- D E -- \/ -- F -runstdfile("tests/common/automate_ancestry.lua") +include("/common/automate_ancestry.lua") revs = make_graph() ============================================================ --- tests/automate_descendents/__driver__.lua b169f5198dad22ec3e8dfe7127e4d5f26bf39e5d +++ tests/automate_descendents/__driver__.lua 6e65ffe74774c3f662024b3b959e2c062b05612c @@ -10,7 +10,7 @@ -- D E -- \/ -- F -runstdfile("tests/common/automate_ancestry.lua") +include("/common/automate_ancestry.lua") revs = make_graph() ============================================================ --- tests/automate_erase_ancestors/__driver__.lua 6af0ededd123a596151376d854a61caa9612e337 +++ tests/automate_erase_ancestors/__driver__.lua bc2885d75224dd0d39ef378b1fce02a771a019ea @@ -10,7 +10,7 @@ -- D E -- \/ -- F -runstdfile("tests/common/automate_ancestry.lua") +include("/common/automate_ancestry.lua") revs = make_graph() ============================================================ --- tests/automate_graph/__driver__.lua de3087c9f744a1e67622ecf74f2c054eaad14067 +++ tests/automate_graph/__driver__.lua 9311433fa65de02d9e996af9cfc5e3b0ad2a6ca9 @@ -10,7 +10,7 @@ -- D E -- \/ -- F -runstdfile("tests/common/automate_ancestry.lua") +include("/common/automate_ancestry.lua") revs = make_graph() ============================================================ --- tests/automate_parents,_automate_children/__driver__.lua 09b9184690bb407e31001cd30e3f2e38be5dc246 +++ tests/automate_parents,_automate_children/__driver__.lua b1f01aafd20f603f5aa8803ce7c2060f5b34baa4 @@ -11,7 +11,7 @@ -- D E -- \/ -- F -runstdfile("tests/common/automate_ancestry.lua") +include("/common/automate_ancestry.lua") revs = make_graph() ============================================================ --- tests/automate_toposort/__driver__.lua 5c2eebd7c32fe5dcc369bfa3cf38ef8e8cbf2113 +++ tests/automate_toposort/__driver__.lua 2b8c1bd3613ce3c2e6fbaf1f053b39fa1d21aee4 @@ -8,7 +8,7 @@ -- D E -- \/ -- F -runstdfile("tests/common/automate_ancestry.lua") +include("/common/automate_ancestry.lua") revs = make_graph() ============================================================ --- tests/cvs_import,_file_dead_on_head_and_branch/__driver__.lua 7512f38263010410cc684fb08ebcf0405e82d219 +++ tests/cvs_import,_file_dead_on_head_and_branch/__driver__.lua dce710af9d7414029aeef8690593f64fbfc5344e @@ -1,17 +1,8 @@ -skip_if(not existsonpath("cvs")) +include("/common/cvs.lua") mtn_setup() +cvs_setup() -cvsroot = test.root.."/cvs-repository" -function cvs(...) - return {"cvs", "-d", cvsroot, unpack(arg)} -end - -check(cvs("-q", "init"), 0, false, false) -check(exists(cvsroot)) -check(exists(cvsroot.."/CVSROOT")) -check(exists(cvsroot.."/CVSROOT/modules")) - mkdir(cvsroot.."/attest") getfile("cvsfile,v", cvsroot.."/attest/cvsfile,v") ============================================================ --- tests/cvs_import_with_file_added_on_a_branch/__driver__.lua 82696ecdfff800d9d21d8e02338707669be85afe +++ tests/cvs_import_with_file_added_on_a_branch/__driver__.lua f3b915b179ae6001411ef031129e1b3116bf25ee @@ -1,17 +1,13 @@ -skip_if(not existsonpath("cvs")) +include("/common/cvs.lua") mtn_setup() +cvs_setup() -- This tests the case where a file was added on a branch in CVS; CVS -- records this in a strange way (with a delete of the non-existent -- file on mainline, followed by an add of the file on the branch). -- Make sure we handle it correct. -cvsroot = test.root.."/cvsroot" -function cvs(...) - return {"cvs", "-d", cvsroot, unpack(arg)} -end -check(cvs("init"), 0, false, false) mkdir("src") writefile("src/foo", "foo") check(indir("src", cvs("import", "-m", "import", "mod", "vtag", "rtag")), 0, false, false) ============================================================ --- tests/exchanging_work_via_netsync/__driver__.lua 16e19052a2f83d67cef7b23182fbfc42d630e8a5 +++ tests/exchanging_work_via_netsync/__driver__.lua c7d4ecc85f8658688f7951d96f48d28406aae07e @@ -1,4 +1,5 @@ +include("/common/netsync.lua") mtn_setup() netsync.setup() ============================================================ --- tests/importing_a_cvs_file_with_one_version/__driver__.lua 57b8aba74589feb66dc8e04b7cde5dab829685e0 +++ tests/importing_a_cvs_file_with_one_version/__driver__.lua 15c3a5824d24a218b8a2037bad178f78d716149a @@ -1,5 +1,5 @@ -skip_if(not existsonpath("cvs")) +include("/common/cvs.lua") mtn_setup() writefile("importme.0", "version 0 of test file") @@ -8,17 +8,8 @@ -- build the cvs repository -cvsroot = test.root .. "/cvs-repository" +cvs_setup() -function cvs(...) - return {"cvs", "-d", cvsroot, unpack(arg)} -end - -check(cvs("-q", "init"), 0, false, false) -check(exists(cvsroot)) -check(exists(cvsroot .. "/CVSROOT")) -check(exists(cvsroot .. "/CVSROOT/modules")) - -- check out the workspace and make a commit check(cvs("co", "."), 0, false, false) ============================================================ --- tests/importing_cvs_files/__driver__.lua c6e11c43ae0592336f00ab6cf3137eb07af08d35 +++ tests/importing_cvs_files/__driver__.lua c0f9e587b78a71661c20cca06e5ad198547e9e90 @@ -1,14 +1,10 @@ +include("/common/cvs.lua") mtn_setup() -skip_if(not existsonpath("cvs")) - writefile("importme.0", "version 0 of test file") - writefile("importme.1", "version 1 of test file") - writefile("importme.2", "version 2 of test file") - writefile("importme.3", "version 3 of test file") tsha0=sha1("importme.0") @@ -18,17 +14,8 @@ -- build the cvs repository -cvsroot = test.root .. "/cvs-repository" +cvs_setup() -function cvs(...) - return {"cvs", "-d", cvsroot, unpack(arg)} -end - -check(cvs("-q", "init"), 0, false, false) -check(exists(cvsroot)) -check(exists(cvsroot .. "/CVSROOT")) -check(exists(cvsroot .. "/CVSROOT/modules")) - -- check out the workspace and make some commits -- note that this has to use copyfile, rather than rename, to update -- the file in cvs. Apparently, cvs uses timestamps or something to track ============================================================ --- tests/importing_cvs_files_with_identical_logs/__driver__.lua 71e157f3608dfd02f409c731488a38315f21ab2b +++ tests/importing_cvs_files_with_identical_logs/__driver__.lua 7f20e7723843c2ceaec23a4cc7d609fdddd86868 @@ -1,5 +1,5 @@ -skip_if(not existsonpath("cvs")) +include("/common/cvs.lua") mtn_setup() writefile("importme.0", "version 0 of test file") @@ -14,14 +14,7 @@ -- build the cvs repository -cvsroot = test.root .. "/cvs-repository" -function cvs(...) - return {"cvs", "-d", cvsroot, unpack(arg)} -end -check(cvs("-q", "init"), 0, false, false) -check(exists(cvsroot)) -check(exists(cvsroot.."/CVSROOT")) -check(exists(cvsroot.."/CVSROOT/modules")) +cvs_setup() -- check out the workspace and make some commits ============================================================ --- tests/netsync_client_absorbs_and_checks_epochs/__driver__.lua 0f422f4face2e53b5371d7f4b3a9ef17259b7503 +++ tests/netsync_client_absorbs_and_checks_epochs/__driver__.lua 051a9845b19373c494e6b992a81b3e6ba9588217 @@ -1,4 +1,5 @@ +include("/common/netsync.lua") mtn_setup() netsync.setup() revs = {} ============================================================ --- tests/netsync_client_absorbs_server_key/__driver__.lua 0cbcb51504ad96f5bc0bc319afd59324c7864aa7 +++ tests/netsync_client_absorbs_server_key/__driver__.lua dc8fff5b6909710b2f0dea1c2d0ee4be5d4ce1c4 @@ -1,4 +1,5 @@ +include("/common/netsync.lua") mtn_setup() netsync.setup() ============================================================ --- tests/netsync_default_server_pattern/__driver__.lua 9d6bfba198be151bc2dea9365694d0c8af9481eb +++ tests/netsync_default_server_pattern/__driver__.lua ce953484cd6f63ad5b44f054d10c4b3a6ad23c4a @@ -1,4 +1,5 @@ +include("/common/netsync.lua") mtn_setup() netsync.setup() revs = {} ============================================================ --- tests/netsync_default_server_pattern_setting/__driver__.lua 5e7636e39a861076f1e2ef44ab71b31bf09d3320 +++ tests/netsync_default_server_pattern_setting/__driver__.lua 476829800bd76624f072ca5d00c113ffd290a94a @@ -1,4 +1,5 @@ +include("/common/netsync.lua") mtn_setup() netsync.setup() ============================================================ --- tests/netsync_epochs_are_not_sent_upstream_by_pull/__driver__.lua 132cf3ec3c4a54225a1da51ec500c262bedf4dd4 +++ tests/netsync_epochs_are_not_sent_upstream_by_pull/__driver__.lua b71a7986e2d0ae71548e335e91049fc703983a50 @@ -1,4 +1,5 @@ +include("/common/netsync.lua") mtn_setup() netsync.setup() ============================================================ --- tests/netsync_is_not_interrupted_by_SIGPIPE/__driver__.lua 39bccb461318f1b4c5a989cc8216416dcffe4d85 +++ tests/netsync_is_not_interrupted_by_SIGPIPE/__driver__.lua 0a03a6aa0020c42cfb947a1eec7d1b9f41cfc148 @@ -1,5 +1,6 @@ skip_if(ostype == "Windows") +include("/common/netsync.lua") mtn_setup() netsync.setup() ============================================================ --- tests/netsync_largish_file/__driver__.lua 84f89f33bd31f8c1ecf75d199c8c881877a90e3b +++ tests/netsync_largish_file/__driver__.lua e72e457f2d00207b90cfc8bf11d4c1e476a3bf5b @@ -1,4 +1,5 @@ +include("/common/netsync.lua") mtn_setup() netsync.setup() ============================================================ --- tests/netsync_server_absorbs_and_checks_epochs/__driver__.lua cd53ea129784c1c830ac8e46e8118f6432ce713a +++ tests/netsync_server_absorbs_and_checks_epochs/__driver__.lua aa78fe9e8da0888ade6012e92b85de9b8cb493c4 @@ -1,4 +1,5 @@ +include("/common/netsync.lua") mtn_setup() netsync.setup() revs = {} ============================================================ --- tests/netsync_transfers_public_keys/__driver__.lua 04c76345f824f1a784fc848e2bf6c3ce00b6bc46 +++ tests/netsync_transfers_public_keys/__driver__.lua ad35ff87dffb8b24468db3dab113f4b79f425be5 @@ -1,4 +1,5 @@ +include("/common/netsync.lua") mtn_setup() netsync.setup() ============================================================ --- tests/netsync_verifies_server_keys/__driver__.lua 3784142a3b85cfc0a791a2ea42045b4e35c40024 +++ tests/netsync_verifies_server_keys/__driver__.lua dddf09d532cd2f277364b4ff71fa763a976ce34e @@ -1,4 +1,5 @@ +include("/common/netsync.lua") mtn_setup() netsync.setup() ============================================================ --- tests/persistent_netsync_server_-_keys/__driver__.lua a73946ef1a105f8f5751b4c5b7afa130b5709b87 +++ tests/persistent_netsync_server_-_keys/__driver__.lua d69890ecb57963ff920dd98e05de85771d28db3f @@ -1,4 +1,5 @@ +include("/common/netsync.lua") mtn_setup() netsync.setup() ============================================================ --- tests/persistent_netsync_server_-_revs_&_certs/__driver__.lua 426e9f7e63c3f96c69580449eda4419383427e7e +++ tests/persistent_netsync_server_-_revs_&_certs/__driver__.lua d2462ce31147655c4d7b492a9f4c210277a4dde6 @@ -1,4 +1,5 @@ +include("/common/netsync.lua") mtn_setup() netsync.setup() ============================================================ --- tests/pull_a_netsync_branch_which_has_a_parent_from_another_branch/__driver__.lua 39e7147a85425a27ab720a1dee7f120f55dcc831 +++ tests/pull_a_netsync_branch_which_has_a_parent_from_another_branch/__driver__.lua 0c4a245ff7c35951005047da6ec751c4e97f6e3c @@ -1,4 +1,5 @@ +include("/common/netsync.lua") mtn_setup() netsync.setup() ============================================================ --- tests/repeatedly_exchanging_work_via_netsync/__driver__.lua c4be0ca44b72f23097f18b6e0a99127237759bc1 +++ tests/repeatedly_exchanging_work_via_netsync/__driver__.lua a9af63314fe08c9b5e9d8c77de03640f05eb8c0d @@ -1,4 +1,5 @@ +include("/common/netsync.lua") mtn_setup() netsync.setup() ============================================================ --- tests/single_manifest_netsync/__driver__.lua 337cc66d8318ef7f7aec4b37ea1344e3d135d06d +++ tests/single_manifest_netsync/__driver__.lua ba4868d426f68fadbb35775b82ed2f1ed04c7e8e @@ -1,4 +1,5 @@ +include("/common/netsync.lua") mtn_setup() netsync.setup() ============================================================ --- testsuite.at e1d480848ba13a47d78d8fc4ec11d04a947d243f +++ testsuite.at e4e7b224447c223e5e441071baba7d8360b8da1e @@ -608,45 +608,6 @@ # include all the sub-tests we're going to use -m4_include(tests/t_annotate_branch_collision.at) -m4_include(tests/t_netsync_error.at) -m4_include(tests/t_options.at) -m4_include(tests/t_annotate_copy_all.at) -m4_include(tests/t_cvsimport_deleted_invar.at) -m4_include(tests/t_rcfile_stdin.at) -m4_include(tests/t_monotone_up.at) -m4_include(tests/t_drop_vs_patch_rename.at) -m4_include(tests/t_unreadable__MTN.at) -m4_include(tests/t_cvsimport3.at) -m4_include(tests/t_commit_message_file.at) -m4_include(tests/t_automate_attributes.at) -m4_include(tests/t_unidiff3.at) -m4_include(tests/t_netsync_permissions.at) -m4_include(tests/t_update_with_blocked_rename.at) -m4_include(tests/t_drop_vs_dropadd.at) -m4_include(tests/t_annotate_lineage_dependent.at) -m4_include(tests/t_annotate_split_line.at) -m4_include(tests/t_automate_certs.at) -m4_include(tests/t_selector_later_earlier.at) -m4_include(tests/t_automate_stdio.at) -m4_include(tests/t_cvsimport_drepper.at) -m4_include(tests/t_update_with_pending_drop.at) -m4_include(tests/t_update_with_pending_add.at) -m4_include(tests/t_update_with_pending_rename.at) -m4_include(tests/t_restricted_commit_with_inodeprints.at) -m4_include(tests/t_merge_manual.at) -m4_include(tests/t_revert_restrict.at) -m4_include(tests/t_status.at) -m4_include(tests/t_cvsimport_drepper2.at) -m4_include(tests/t_rcfile_dir.at) -m4_include(tests/t_lua_includedir.at) -m4_include(tests/t_existsonpath.at) -m4_include(tests/t_db_kill_branch_certs_locally.at) -m4_include(tests/t_netsync_globs.at) -m4_include(tests/t_set_default.at) -m4_include(tests/t_netsync_read_permissions.at) -m4_include(tests/t_netsync_exclude.at) -m4_include(tests/t_netsync_exclude_default.at) m4_include(tests/t_ambiguous_tags.at) m4_include(tests/t_kill_tag_locally.at) m4_include(tests/t_restricted_diff_unchanged.at) ============================================================ --- testsuite.lua 223f17f5d715b17032c40abffd99eebaa9b3b8b8 +++ testsuite.lua 7cf86a0135ed5ac1219668f597b01192bce857a4 @@ -70,10 +70,11 @@ "address@hidden", unpack(arg)) end -function commit(branch, message) +function commit(branch, message, mt) if branch == nil then branch = "testbranch" end if message == nil then message = "blah-blah" end - check(mtn("commit", "--message", message, "--branch", branch), 0, false, false) + if mt == nil then mt = mtn end + check(mt("commit", "--message", message, "--branch", branch), 0, false, false) end function sha1(what) @@ -92,9 +93,9 @@ end function mtn_setup() - getstdfile("tests/test_keys", "test_keys") - getstdfile("tests/test_hooks.lua", "test_hooks.lua") - getstdfile("tests/min_hooks.lua", "min_hooks.lua") + getstdfile("test_keys") + getstdfile("test_hooks.lua") + getstdfile("min_hooks.lua") check(mtn("db", "init"), 0, false, false) check(mtn("read", "test_keys"), 0, false, false) @@ -102,103 +103,6 @@ os.remove("test_keys") end - --- netsync - -function mtn2(...) - return mtn("--db=test2.db", "--keydir=keys2", unpack(arg)) -end - -function mtn3(...) - return mtn("--db=test3.db", "--keydir=keys3", unpack(arg)) -end - -netsync = {} -netsync.internal = {} - -function netsync.setup() - copyfile("test.db", "test2.db") - copy_recursive("keys", "keys2") - copyfile("test.db", "test3.db") - copy_recursive("keys", "keys3") - getstdfile("tests/netsync.lua", "netsync.lua") - math.randomseed(os.time()) -end - -function netsync.setup_with_notes() - netsync.setup() - getstdfile("tests/netsync_with_notes.lua", "netsync.lua") -end - -function netsync.internal.client(srv, oper, pat, n, res) - if n == nil then n = 2 end - args = {"--rcfile=netsync.lua", "--keydir=keys"..n, - "--db=test"..n..".db", oper, srv.address} - if pat ~= nil then table.insert(args, pat) end - check(mtn(unpack(args)), res, false, false) -end -function netsync.internal.pull(srv, pat, n, res) srv:client("pull", pat, n, res) end -function netsync.internal.push(srv, pat, n, res) srv:client("push", pat, n, res) end -function netsync.internal.sync(srv, pat, n, res) srv:client("sync", pat, n, res) end - -function netsync.start(pat, n, min) - if pat == "" or pat == nil then pat = "*" end - local args = {} - local fn = mtn - local addr = "localhost:" .. math.random(20000, 50000) - table.insert(args, "--dump=_MTN/server_dump") - table.insert(args, "--bind="..addr) - if min then - fn = minhooks_mtn - else - table.insert(args, "--rcfile=netsync.lua") - end - if n ~= nil then - table.insert(args, "--keydir=keys"..n) - table.insert(args, "--db=test"..n..".db") - end - table.insert(args, "serve") - if type(pat) == "string" then - table.insert(args, pat) - elseif type(pat) == "table" then - local function ins(i,x) - table.insert(args,x) - end - table.foreachi(pat, ins) - else - err("Bad pattern type "..type(pat)) - end - local out = bg(fn(unpack(args)), false, false, false) - out.address = addr - local mt = getmetatable(out) - mt.client = netsync.internal.client - mt.pull = netsync.internal.pull - mt.push = netsync.internal.push - mt.sync = netsync.internal.sync - local mt_wait = mt.wait - mt.check = function(obj) return not mt_wait(obj, 0) end - mt.wait = nil -- using this would hang; don't allow it - -- wait for "beginning service..." - while fsize(out.prefix .. "stderr") == 0 do - sleep(1) - check(out:check()) - end - mt.stop = mt.finish - return out -end - -function netsync.internal.run(oper, pat) - local srv = netsync.start(pat) - srv:client(oper, pat) - srv:finish() -end -function netsync.pull(pat) netsync.internal.run("pull", pat) end -function netsync.push(pat) netsync.internal.run("push", pat) end -function netsync.sync(pat) netsync.internal.run("sync", pat) end - - - - function base_revision() return (string.gsub(readfile("_MTN/revision"), "%s*$", "")) end @@ -209,19 +113,25 @@ return res == 0 end -function addfile(filename, contents) +function addfile(filename, contents, mt) if contents ~= nil then writefile(filename, contents) end - check(mtn("add", filename), 0, false, false) + if mt == nil then mt = mtn end + check(mt("add", filename), 0, false, false) end -function revert_to(rev, branch) +function revert_to(rev, branch, mt) + if type(branch) == "function" then + mt = branch + branch = nil + end + if mt == nil then mt = mtn end remove_recursive("_MTN.old") os.rename("_MTN", "_MTN.old") if branch == nil then - check(mtn("checkout", "--revision", rev, "."), 0, false) + check(mt("checkout", "--revision", rev, "."), 0, false) else - check(mtn("checkout", "--branch", branch, "--revision", rev, "."), 0, false) + check(mt("checkout", "--branch", branch, "--revision", rev, "."), 0, false) end check(base_revision() == rev) end @@ -341,216 +251,255 @@ ------------------------------------------------------------------------ --====================================================================-- ------------------------------------------------------------------------ +testdir = srcdir.."/tests" +table.insert(tests, "basic_invocation_and_options") +table.insert(tests, "scanning_trees") +table.insert(tests, "importing_a_file") +table.insert(tests, "generating_and_extracting_keys_and_certs") +table.insert(tests, "calculation_of_unidiffs") +table.insert(tests, "persistence_of_passphrase") +table.insert(tests, "multiple_version_committing") +table.insert(tests, "creating_a_fork") +table.insert(tests, "creating_a_fork_and_updating") +table.insert(tests, "creating_a_fork_and_merging") +table.insert(tests, "merging_adds") +table.insert(tests, "merging_data_in_unrelated_files") +table.insert(tests, "merging_adds_in_unrelated_revisions") +table.insert(tests, "merging_data_in_unrelated_revisions") +table.insert(tests, "calculation_of_other_unidiffs") +table.insert(tests, "delete_work_file_on_checkout") +table.insert(tests, "revert_file_to_base_revision") +table.insert(tests, "addition_of_files_and_directories") +table.insert(tests, "add_and_then_drop_file_does_nothing") +table.insert(tests, "drop_missing_and_unknown_files") +table.insert(tests, "creating_a_bad_criss-cross_merge") +table.insert(tests, "renaming_a_file") +table.insert(tests, "renaming_a_directory") +table.insert(tests, "renaming_and_editing_a_file") +table.insert(tests, "importing_cvs_files") +table.insert(tests, "importing_files_with_non-english_names") +table.insert(tests, "external_unit_test_of_the_line_merger") +table.insert(tests, "exchanging_work_via_netsync") +table.insert(tests, "single_manifest_netsync") +table.insert(tests, "netsync_transfers_public_keys") +table.insert(tests, "repeatedly_exchanging_work_via_netsync") +table.insert(tests, "(normal)_netsync_on_partially_unrelated_revisions") +table.insert(tests, "disapproving_of_a_revision") +table.insert(tests, "creating_a_good_and_bad_test_result") +table.insert(tests, "importing_a_cvs_file_with_one_version") +table.insert(tests, "list_missing_files") +table.insert(tests, "attr_set_get_commands") +table.insert(tests, "single_character_filename_support") +table.insert(tests, "manifest_restrictions") +table.insert(tests, "subdirectory_restrictions") +table.insert(tests, "renaming_a_patched_file") +table.insert(tests, "renaming_a_deleted_file") +table.insert(tests, "merging_a_rename_twice") +table.insert(tests, "updating_from_a_merge_which_adds_a_file") +table.insert(tests, "changing_passphrase_of_a_private_key") +table.insert(tests, "diffing_a_revision_with_an_added_file") +table.insert(tests, "updating_to_a_given_revision") +table.insert(tests, "'heads'") +table.insert(tests, "'heads'_with_discontinuous_branches") +table.insert(tests, "test_a_merge") +table.insert(tests, "test_a_merge_2") +table.insert(tests, "tags_and_tagging_of_revisions") +table.insert(tests, "mtn_add_dot") +table.insert(tests, "(minor)_update_cleans_emptied_directories") +table.insert(tests, "merging_(add_a)_with_(add_a,_drop_a)") +table.insert(tests, "merging_an_add_edge") +table.insert(tests, "merge((),_(patch_a,_drop_a,_add_a))") +table.insert(tests, "merge((),_(add_a,_drop_a,_add_a))") +table.insert(tests, "merge((add_a),_(add_a,_drop_a,_add_a))") +table.insert(tests, "merge((),_(add_a,_patch_a,_drop_a,_add_a))") +table.insert(tests, "merge((patch_a),_(drop_a,_add_a))") +table.insert(tests, "explicit_merge") +table.insert(tests, "update_with_multiple_candidates") +table.insert(tests, "checkout_validates_target_directory") +table.insert(tests, "checkout_creates_right__MTN_options") +table.insert(tests, "trust_hooks_and_'trusted'_command") +table.insert(tests, "attr_set_attr_get") +table.insert(tests, "--rcfile_requires_extant_file") +table.insert(tests, "persistent_netsync_server_-_revs_&_certs") +table.insert(tests, "persistent_netsync_server_-_keys") +table.insert(tests, "first_extent_normalization_pass") +table.insert(tests, "(imp)_deleting_directories") +table.insert(tests, "schema_migration") +table.insert(tests, "database_dump_load") +table.insert(tests, "no-change_deltas_disappear") +table.insert(tests, "merge((),_(drop_a,_rename_b_a,_patch_a))") +table.insert(tests, "verification_of_command_line_options") +table.insert(tests, "log_hides_deleted_renamed_files") +table.insert(tests, "CRLF_line_normalization") +table.insert(tests, "pull_a_netsync_branch_which_has_a_parent_from_another_branch") +table.insert(tests, "(normal)_netsync_revision_with_no_certs") +table.insert(tests, "check_same_db_contents_macro") +table.insert(tests, "merge_rev_with_ancestor") +table.insert(tests, "propagate_a_descendent") +table.insert(tests, "propagate_an_ancestor") +table.insert(tests, "status_with_missing_files") +table.insert(tests, "(imp)_persistent_netsync_server_-_keys_2") +table.insert(tests, "update_1") +table.insert(tests, "(todo)_vcheck") +table.insert(tests, "--db_with_parent_dir") +table.insert(tests, "add_in_subdir") +table.insert(tests, "(minor)_drop_in_subdir") +table.insert(tests, "revert_in_subdirs") +table.insert(tests, "rename_in_subdir") +table.insert(tests, "attr_command_in_subdirs") +table.insert(tests, "(normal)_update_across_discontinuity") +table.insert(tests, "rename_dir_to_non-sibling") +table.insert(tests, "merge_with_add,_rename_file,_and_rename_dir") +table.insert(tests, "merge((rename_a_b),_(rename_a_c))") +table.insert(tests, "merge((patch_foo_a),_(rename_foo__bar_))") +table.insert(tests, "(imp)_merge((patch_foo_a),_(delete_foo_))") +table.insert(tests, "revert_directories") +table.insert(tests, "revert_renames") +table.insert(tests, "revert_unchanged_file_preserves_mtime") +table.insert(tests, "(minor)_context_diff") +table.insert(tests, "rename_cannot_overwrite_files") +table.insert(tests, "failed_checkout_is_a_no-op") +table.insert(tests, "(todo)_write_monotone-agent") +table.insert(tests, "(todo)_design_approval_semantics") +table.insert(tests, "committing_with_a_non-english_message") +table.insert(tests, "warn_on_bad_restriction") +table.insert(tests, "_MTN_revision_is_required") +table.insert(tests, "update_no-ops_when_no_parent_revision") +table.insert(tests, "branch-based_checkout") +table.insert(tests, "db_load_must_create_a_new_db") +table.insert(tests, "automate_automate_version") +table.insert(tests, "automate_heads") +table.insert(tests, "merge_normalization_edge_case") +table.insert(tests, "(todo)_undo_update_command") +table.insert(tests, "modification_of_an_empty_file") +table.insert(tests, "largish_file") +table.insert(tests, "files_with_intermediate__MTN_path_elements") +table.insert(tests, "(minor)_test_a_merge_3") +table.insert(tests, "(minor)_test_a_merge_4") +table.insert(tests, "db_missing") +table.insert(tests, "database_check") +table.insert(tests, "(minor)_add_own_db") +table.insert(tests, "can_execute_things") +table.insert(tests, "diff_a_binary_file") +table.insert(tests, "command_completion") +table.insert(tests, "merge_rename_file_and_rename_dir") +table.insert(tests, "diff_respects_restrictions") +table.insert(tests, "cat_-r_REV_PATH") +table.insert(tests, "netsync_client_absorbs_and_checks_epochs") +table.insert(tests, "netsync_server_absorbs_and_checks_epochs") +table.insert(tests, "netsync_epochs_are_not_sent_upstream_by_pull") +table.insert(tests, "vars") +table.insert(tests, "netsync_default_server_pattern") +table.insert(tests, "netsync_default_server_pattern_setting") +table.insert(tests, "netsync_client_absorbs_server_key") +table.insert(tests, "netsync_verifies_server_keys") +table.insert(tests, "test_a_merge_5") +table.insert(tests, "empty_id_completion") +table.insert(tests, "empty_string_as_a_path_name") +table.insert(tests, "empty_environment") +table.insert(tests, "short_options_work_correctly") +table.insert(tests, "netsync_is_not_interrupted_by_SIGPIPE") +table.insert(tests, "setup_creates__MTN_log") +table.insert(tests, "checkout_creates__MTN_log") +table.insert(tests, "commit_using__MTN_log") +table.insert(tests, "commit_w_o__MTN_log_being_present") +table.insert(tests, "commit_validation_lua_hook") +table.insert(tests, "drop_a_public_key") +table.insert(tests, "drop_a_public_and_private_key") +table.insert(tests, "rename_moves_attributes") +table.insert(tests, "automate_ancestors") +table.insert(tests, "automate_descendents") +table.insert(tests, "automate_erase_ancestors") +table.insert(tests, "automate_toposort") +table.insert(tests, "diff_in_a_never-committed_project") +table.insert(tests, "automate_ancestry_difference") +table.insert(tests, "automate_leaves") +table.insert(tests, "log_--last=N_--next=N") +table.insert(tests, "commit_using__MTN_log_and_--message") +table.insert(tests, "check_that_--xargs_and_-(at)_behave_correctly") +table.insert(tests, "db_execute") +table.insert(tests, "sql_function_gunzip_(which_replaced_unpack)") +table.insert(tests, "files_with_spaces_at_the_end") +table.insert(tests, "inodeprints") +table.insert(tests, "update_updates_inodeprints") +table.insert(tests, "listing_workspace_manifests") +table.insert(tests, "importing_cvs_files_with_identical_logs") +table.insert(tests, "sticky_branches") +table.insert(tests, "checkout_without_--branch_sets_branch") +table.insert(tests, "netsync_largish_file") +table.insert(tests, "update_to_off-branch_rev") +table.insert(tests, "setup_checkout_touch_new__MTN_options_only") +table.insert(tests, "renaming_a_directory_and_then_adding_a_new_with_the_old_name") +table.insert(tests, "test_problematic_cvs_import") +table.insert(tests, "cvs_import_with_file_added_on_a_branch") +table.insert(tests, "use_get_linesep_conv_hook") +table.insert(tests, "add_workspace_commit_in_another") +table.insert(tests, "update_to_non-existent_rev") +table.insert(tests, "--author,_--date") +table.insert(tests, "update_does_not_stomp_non-monotone_files") +table.insert(tests, "db_check_and_non-serious_errors") +table.insert(tests, "db_kill_rev_locally_command") +table.insert(tests, "drop_removes_attributes") +table.insert(tests, "attr_drop") +table.insert(tests, "log_--last=N_FILENAME") +table.insert(tests, "attr_init_functions") +table.insert(tests, "add_executable") +table.insert(tests, "use_inodeprints_hook") +table.insert(tests, "bad_packet_args") +table.insert(tests, "commit_update_multiple_heads_message") +table.insert(tests, "diffing_with_explicit_rev_same_as_wc_rev") +table.insert(tests, "normalized_filenames") +table.insert(tests, "workspace_inventory") +table.insert(tests, "rename_file_to_dir") +table.insert(tests, "replace_file_with_dir") +table.insert(tests, "replace_dir_with_file") +table.insert(tests, "automate_parents,_automate_children") +table.insert(tests, "automate_graph") +table.insert(tests, "files_with_non-utf8_data") +table.insert(tests, "cvs_import,_file_dead_on_head_and_branch") +table.insert(tests, "selecting_arbitrary_certs") +table.insert(tests, "check_automate_select") +table.insert(tests, "refresh_inodeprints") +table.insert(tests, "test_a_merge_6") +table.insert(tests, "test_annotate_command") +table.insert(tests, "annotate_file_added_on_different_forks") +table.insert(tests, "annotate_file_on_multirooted_branch") +table.insert(tests, "netsync_badhost_gives_nice_error") +table.insert(tests, "checking_a_few_command_specific_options") +table.insert(tests, "annotate_where_one_parent_is_full_copy") +table.insert(tests, "cvs_import,_deleted_file_invariant") +table.insert(tests, "--rcfile=-") +table.insert(tests, "mtn_up") +table.insert(tests, "merge((drop_a),_(rename_a_b,_patch_b))") +table.insert(tests, "fail_cleanly_on_unreadable__MTN_options") +table.insert(tests, "importing_cvs_with_vendor_imports_and_branches") +table.insert(tests, "commit_with_--message-file") +table.insert(tests, "automate_attributes") +table.insert(tests, "diff_against_empty_file") +table.insert(tests, "netsync_permissions") +table.insert(tests, "update_with_blocked_rename") +table.insert(tests, "merge((drop_a),_(drop_a,_add_a))") +table.insert(tests, "annotate_where_lineage_depends_on_traversal") +table.insert(tests, "annotate_where_line_splits") +table.insert(tests, "automate_certs") +table.insert(tests, "check_later_and_earlier_selectors") +table.insert(tests, "automate_stdio") +table.insert(tests, "importing_a_small,_real_cvs_repository") +table.insert(tests, "update_with_pending_drop") +table.insert(tests, "update_with_pending_add") +table.insert(tests, "update_with_pending_rename") +table.insert(tests, "restricted_commit_with_inodeprints") +table.insert(tests, "merge_manual_file") +table.insert(tests, "revert_works_with_restrictions") +table.insert(tests, "status") +table.insert(tests, "a_tricky_cvs_repository_with_tags") +table.insert(tests, "--rcfile=directory") +table.insert(tests, "include()_and_includedir()_lua_functions") +table.insert(tests, "lua_function_existsonpath") +table.insert(tests, "db_kill_branch_certs_locally_command") +table.insert(tests, "netsync_with_globs") +table.insert(tests, "netsync,--set-default") +table.insert(tests, "get_netsync_read_permitted") +table.insert(tests, "serve_pull_with_--exclude") +table.insert(tests, "netsync,--exclude,defaults") -table.insert(tests, "tests/basic_invocation_and_options") -table.insert(tests, "tests/scanning_trees") -table.insert(tests, "tests/importing_a_file") -table.insert(tests, "tests/generating_and_extracting_keys_and_certs") -table.insert(tests, "tests/calculation_of_unidiffs") -table.insert(tests, "tests/persistence_of_passphrase") -table.insert(tests, "tests/multiple_version_committing") -table.insert(tests, "tests/creating_a_fork") -table.insert(tests, "tests/creating_a_fork_and_updating") -table.insert(tests, "tests/creating_a_fork_and_merging") -table.insert(tests, "tests/merging_adds") -table.insert(tests, "tests/merging_data_in_unrelated_files") -table.insert(tests, "tests/merging_adds_in_unrelated_revisions") -table.insert(tests, "tests/merging_data_in_unrelated_revisions") -table.insert(tests, "tests/calculation_of_other_unidiffs") -table.insert(tests, "tests/delete_work_file_on_checkout") -table.insert(tests, "tests/revert_file_to_base_revision") -table.insert(tests, "tests/addition_of_files_and_directories") -table.insert(tests, "tests/add_and_then_drop_file_does_nothing") -table.insert(tests, "tests/drop_missing_and_unknown_files") -table.insert(tests, "tests/creating_a_bad_criss-cross_merge") -table.insert(tests, "tests/renaming_a_file") -table.insert(tests, "tests/renaming_a_directory") -table.insert(tests, "tests/renaming_and_editing_a_file") -table.insert(tests, "tests/importing_CVS_files") -table.insert(tests, "tests/importing_files_with_non-english_names") -table.insert(tests, "tests/external_unit_test_of_the_line_merger") -table.insert(tests, "tests/exchanging_work_via_netsync") -table.insert(tests, "tests/single_manifest_netsync") -table.insert(tests, "tests/netsync_transfers_public_keys") -table.insert(tests, "tests/repeatedly_exchanging_work_via_netsync") -table.insert(tests, "tests/(normal)_netsync_on_partially_unrelated_revisions") -table.insert(tests, "tests/disapproving_of_a_revision") -table.insert(tests, "tests/creating_a_good_and_bad_test_result") -table.insert(tests, "tests/importing_a_CVS_file_with_one_version") -table.insert(tests, "tests/list_missing_files") -table.insert(tests, "tests/attr_set_get_commands") -table.insert(tests, "tests/single_character_filename_support") -table.insert(tests, "tests/manifest_restrictions") -table.insert(tests, "tests/subdirectory_restrictions") -table.insert(tests, "tests/renaming_a_patched_file") -table.insert(tests, "tests/renaming_a_deleted_file") -table.insert(tests, "tests/merging_a_rename_twice") -table.insert(tests, "tests/updating_from_a_merge_which_adds_a_file") -table.insert(tests, "tests/changing_passphrase_of_a_private_key") -table.insert(tests, "tests/diffing_a_revision_with_an_added_file") -table.insert(tests, "tests/updating_to_a_given_revision") -table.insert(tests, "tests/'heads'") -table.insert(tests, "tests/'heads'_with_discontinuous_branches") -table.insert(tests, "tests/test_a_merge") -table.insert(tests, "tests/test_a_merge_2") -table.insert(tests, "tests/tags_and_tagging_of_revisions") -table.insert(tests, "tests/mtn_add_dot") -table.insert(tests, "tests/(minor)_update_cleans_emptied_directories") -table.insert(tests, "tests/merging_(add_a)_with_(add_a,_drop_a)") -table.insert(tests, "tests/merging_an_add_edge") -table.insert(tests, "tests/merge((),_(patch_a,_drop_a,_add_a))") -table.insert(tests, "tests/merge((),_(add_a,_drop_a,_add_a))") -table.insert(tests, "tests/merge((add_a),_(add_a,_drop_a,_add_a))") -table.insert(tests, "tests/merge((),_(add_a,_patch_a,_drop_a,_add_a))") -table.insert(tests, "tests/merge((patch_a),_(drop_a,_add_a))") -table.insert(tests, "tests/explicit_merge") -table.insert(tests, "tests/update_with_multiple_candidates") -table.insert(tests, "tests/checkout_validates_target_directory") -table.insert(tests, "tests/checkout_creates_right__MTN_options") -table.insert(tests, "tests/trust_hooks_and_'trusted'_command") -table.insert(tests, "tests/attr_set_attr_get") -table.insert(tests, "tests/--rcfile_requires_extant_file") -table.insert(tests, "tests/persistent_netsync_server_-_revs_&_certs") -table.insert(tests, "tests/persistent_netsync_server_-_keys") -table.insert(tests, "tests/first_extent_normalization_pass") -table.insert(tests, "tests/(imp)_deleting_directories") -table.insert(tests, "tests/schema_migration") -table.insert(tests, "tests/database_dump_load") -table.insert(tests, "tests/no-change_deltas_disappear") -table.insert(tests, "tests/merge((),_(drop_a,_rename_b_a,_patch_a))") -table.insert(tests, "tests/verification_of_command_line_options") -table.insert(tests, "tests/log_hides_deleted_renamed_files") -table.insert(tests, "tests/CRLF_line_normalization") -table.insert(tests, "tests/pull_a_netsync_branch_which_has_a_parent_from_another_branch") -table.insert(tests, "tests/(normal)_netsync_revision_with_no_certs") -table.insert(tests, "tests/check_same_db_contents_macro") -table.insert(tests, "tests/merge_rev_with_ancestor") -table.insert(tests, "tests/propagate_a_descendent") -table.insert(tests, "tests/propagate_an_ancestor") -table.insert(tests, "tests/status_with_missing_files") -table.insert(tests, "tests/(imp)_persistent_netsync_server_-_keys_2") -table.insert(tests, "tests/update_1") -table.insert(tests, "tests/(todo)_vcheck") -table.insert(tests, "tests/--db_with_parent_dir") -table.insert(tests, "tests/add_in_subdir") -table.insert(tests, "tests/(minor)_drop_in_subdir") -table.insert(tests, "tests/revert_in_subdirs") -table.insert(tests, "tests/rename_in_subdir") -table.insert(tests, "tests/attr_command_in_subdirs") -table.insert(tests, "tests/(normal)_update_across_discontinuity") -table.insert(tests, "tests/rename_dir_to_non-sibling") -table.insert(tests, "tests/merge_with_add,_rename_file,_and_rename_dir") -table.insert(tests, "tests/merge((rename_a_b),_(rename_a_c))") -table.insert(tests, "tests/merge((patch_foo_a),_(rename_foo__bar_))") -table.insert(tests, "tests/(imp)_merge((patch_foo_a),_(delete_foo_))") -table.insert(tests, "tests/revert_directories") -table.insert(tests, "tests/revert_renames") -table.insert(tests, "tests/revert_unchanged_file_preserves_mtime") -table.insert(tests, "tests/(minor)_context_diff") -table.insert(tests, "tests/rename_cannot_overwrite_files") -table.insert(tests, "tests/failed_checkout_is_a_no-op") -table.insert(tests, "tests/(todo)_write_monotone-agent") -table.insert(tests, "tests/(todo)_design_approval_semantics") -table.insert(tests, "tests/committing_with_a_non-english_message") -table.insert(tests, "tests/warn_on_bad_restriction") -table.insert(tests, "tests/_MTN_revision_is_required") -table.insert(tests, "tests/update_no-ops_when_no_parent_revision") -table.insert(tests, "tests/branch-based_checkout") -table.insert(tests, "tests/db_load_must_create_a_new_db") -table.insert(tests, "tests/automate_automate_version") -table.insert(tests, "tests/automate_heads") -table.insert(tests, "tests/merge_normalization_edge_case") -table.insert(tests, "tests/(todo)_undo_update_command") -table.insert(tests, "tests/modification_of_an_empty_file") -table.insert(tests, "tests/largish_file") -table.insert(tests, "tests/files_with_intermediate__MTN_path_elements") -table.insert(tests, "tests/(minor)_test_a_merge_3") -table.insert(tests, "tests/(minor)_test_a_merge_4") -table.insert(tests, "tests/db_missing") -table.insert(tests, "tests/database_check") -table.insert(tests, "tests/(minor)_add_own_db") -table.insert(tests, "tests/can_execute_things") -table.insert(tests, "tests/diff_a_binary_file") -table.insert(tests, "tests/command_completion") -table.insert(tests, "tests/merge_rename_file_and_rename_dir") -table.insert(tests, "tests/diff_respects_restrictions") -table.insert(tests, "tests/cat_-r_REV_PATH") -table.insert(tests, "tests/netsync_client_absorbs_and_checks_epochs") -table.insert(tests, "tests/netsync_server_absorbs_and_checks_epochs") -table.insert(tests, "tests/netsync_epochs_are_not_sent_upstream_by_pull") -table.insert(tests, "tests/vars") -table.insert(tests, "tests/netsync_default_server_pattern") -table.insert(tests, "tests/netsync_default_server_pattern_setting") -table.insert(tests, "tests/netsync_client_absorbs_server_key") -table.insert(tests, "tests/netsync_verifies_server_keys") -table.insert(tests, "tests/test_a_merge_5") -table.insert(tests, "tests/empty_id_completion") -table.insert(tests, "tests/empty_string_as_a_path_name") -table.insert(tests, "tests/empty_environment") -table.insert(tests, "tests/short_options_work_correctly") -table.insert(tests, "tests/netsync_is_not_interrupted_by_SIGPIPE") -table.insert(tests, "tests/setup_creates__MTN_log") -table.insert(tests, "tests/checkout_creates__MTN_log") -table.insert(tests, "tests/commit_using__MTN_log") -table.insert(tests, "tests/commit_w_o__MTN_log_being_present") -table.insert(tests, "tests/commit_validation_lua_hook") -table.insert(tests, "tests/drop_a_public_key") -table.insert(tests, "tests/drop_a_public_and_private_key") -table.insert(tests, "tests/rename_moves_attributes") -table.insert(tests, "tests/automate_ancestors") -table.insert(tests, "tests/automate_descendents") -table.insert(tests, "tests/automate_erase_ancestors") -table.insert(tests, "tests/automate_toposort") -table.insert(tests, "tests/diff_in_a_never-committed_project") -table.insert(tests, "tests/automate_ancestry_difference") -table.insert(tests, "tests/automate_leaves") -table.insert(tests, "tests/log_--last=N_--next=N") -table.insert(tests, "tests/commit_using__MTN_log_and_--message") -table.insert(tests, "tests/check_that_--xargs_and_-(at)_behave_correctly") -table.insert(tests, "tests/db_execute") -table.insert(tests, "tests/sql_function_gunzip_(which_replaced_unpack)") -table.insert(tests, "tests/files_with_spaces_at_the_end") -table.insert(tests, "tests/inodeprints") -table.insert(tests, "tests/update_updates_inodeprints") -table.insert(tests, "tests/listing_workspace_manifests") -table.insert(tests, "tests/importing_CVS_files_with_identical_logs") -table.insert(tests, "tests/sticky_branches") -table.insert(tests, "tests/checkout_without_--branch_sets_branch") -table.insert(tests, "tests/netsync_largish_file") -table.insert(tests, "tests/update_to_off-branch_rev") -table.insert(tests, "tests/setup_checkout_touch_new__MTN_options_only") -table.insert(tests, "tests/renaming_a_directory_and_then_adding_a_new_with_the_old_name") -table.insert(tests, "tests/test_problematic_cvs_import") -table.insert(tests, "tests/cvs_import_with_file_added_on_a_branch") -table.insert(tests, "tests/use_get_linesep_conv_hook") -table.insert(tests, "tests/add_workspace_commit_in_another") -table.insert(tests, "tests/update_to_non-existent_rev") -table.insert(tests, "tests/--author,_--date") -table.insert(tests, "tests/update_does_not_stomp_non-monotone_files") -table.insert(tests, "tests/db_check_and_non-serious_errors") -table.insert(tests, "tests/db_kill_rev_locally_command") -table.insert(tests, "tests/drop_removes_attributes") -table.insert(tests, "tests/attr_drop") -table.insert(tests, "tests/log_--last=N_FILENAME") -table.insert(tests, "tests/attr_init_functions") -table.insert(tests, "tests/add_executable") -table.insert(tests, "tests/use_inodeprints_hook") -table.insert(tests, "tests/bad_packet_args") -table.insert(tests, "tests/commit_update_multiple_heads_message") -table.insert(tests, "tests/diffing_with_explicit_rev_same_as_wc_rev") -table.insert(tests, "tests/normalized_filenames") -table.insert(tests, "tests/workspace_inventory") -table.insert(tests, "tests/rename_file_to_dir") -table.insert(tests, "tests/replace_file_with_dir") -table.insert(tests, "tests/replace_dir_with_file") -table.insert(tests, "tests/automate_parents,_automate_children") -table.insert(tests, "tests/automate_graph") -table.insert(tests, "tests/files_with_non-utf8_data") -table.insert(tests, "tests/cvs_import,_file_dead_on_head_and_branch") -table.insert(tests, "tests/selecting_arbitrary_certs") -table.insert(tests, "tests/check_automate_select") -table.insert(tests, "tests/refresh_inodeprints") -table.insert(tests, "tests/test_a_merge_6") -table.insert(tests, "tests/test_annotate_command") -table.insert(tests, "tests/annotate_file_added_on_different_forks") -table.insert(tests, "tests/annotate_file_on_multirooted_branch")