# # # add_dir "tests/imp_test_filesync_confdir" # # add_file "tests/imp_test_filesync_confdir/__driver__.lua" # content [4962a95b8b12e9d65c4efc64781033fed9d088d7] # # patch "tests/test_hooks.lua" # from [731fd61c7d9490548d9eed744629a6950748890b] # to [843c3d1b361597a1b2302b4ca22e3cc72cbf238b] # ============================================================ --- tests/imp_test_filesync_confdir/__driver__.lua 4962a95b8b12e9d65c4efc64781033fed9d088d7 +++ tests/imp_test_filesync_confdir/__driver__.lua 4962a95b8b12e9d65c4efc64781033fed9d088d7 @@ -0,0 +1,25 @@ +-- Test that --confdir gets passed properly on file: sync +mtn_setup() + +copy("test.db", "test2.db") + +addfile("testfile", "foo") +commit() + +rcfile = io.open('test_hooks.lua', 'a') +if rcfile ~= nil then + rcfile:write('\n') + rcfile:write('x = io.open("checkfile", "a")\n') + rcfile:write('x:write(get_confdir() .. "\\n")') + rcfile:write('x:close()\n') + rcfile:close() +end + +check(mtn("sync", "file:test2.db", "testbranch"), 0, true, false) + +n = 0 +for line in io.lines("checkfile") do + check(line == test.root) + n = n + 1 +end +check(n == 2) ============================================================ --- tests/test_hooks.lua 731fd61c7d9490548d9eed744629a6950748890b +++ tests/test_hooks.lua 843c3d1b361597a1b2302b4ca22e3cc72cbf238b @@ -80,3 +80,18 @@ end function get_encloser_pattern(name) return "^[[:alnum:]$_]" end + +do + local std_get_netsync_connect_command + = get_netsync_connect_command + function get_netsync_connect_command(uri, args) + local argv = std_get_netsync_connect_command(uri, args) + + if argv then + table.insert(argv, "--confdir="..get_confdir()) + table.insert(argv, "--rcfile="..get_confdir().."/test_hooks.lua") + end + + return argv; + end +end