# # # patch "charset.cc" # from [5f2544c7802ebd05b8963c13015b7d451e93966e] # to [0f3d04bb12b1f68cdb7cec32cec64ee9a8794bef] # # patch "dates.cc" # from [758fad800224cec0eb2115b55b51082167f00504] # to [be2d1eab6749b750b4304c6f3d646a27d1bf034e] # # patch "globish.cc" # from [c31853a13f7206ac2ef1e94be74f67bdb7ccd7fc] # to [3aecf8455aa7c028b29afd3d5437560dbf039bc3] # # patch "netcmd.cc" # from [1f0f0491fbc24e90eb64d9d9fd0dcc57b62b33d1] # to [5fdb6c151fe6bc04b5304bf8510ddcd0a8e76ae7] # # patch "netxx_pipe.cc" # from [12729ada48b2d0def552f2754204db5e321ddf76] # to [6dcfc8169b0df0041a2df3cd02574177e12dee35] # # patch "packet.cc" # from [75b0671dd6fccd7d8625ceb14e671f9f67537985] # to [b03a705bacfefcd03be113ad27cb8139cce85915] # # patch "paths.cc" # from [ee1fe4664673614e20546d37d9612b0be243228f] # to [a53b0c0a5948913606695990415f5138fd363b36] # # patch "restrictions.cc" # from [4423c2d69e15a5b8835405646e1c85fef5839081] # to [9f51a6b8ccdabffe3799d93c2e3a24b57ad74a54] # # patch "roster_merge.cc" # from [44b779b583bfc3087a9f23ac87c2b0f736df9a53] # to [3f7ab8dfc67847a8e893864663cee2e8f1177b51] # # patch "tester.cc" # from [2d74a12843efda14c39c58b773889a122a534d4a] # to [d879cd83eb36960f1eb5dc12211c95bebaac7ee3] # # patch "unix/tester-plaf.cc" # from [577f702ea3292bc5315044849d13f2f9a52cc4a1] # to [839e25268631815a9c6a3a8864a4b9d5dc4a78a1] # ============================================================ --- charset.cc 5f2544c7802ebd05b8963c13015b7d451e93966e +++ charset.cc 0f3d04bb12b1f68cdb7cec32cec64ee9a8794bef @@ -599,7 +599,7 @@ UNIT_TEST(charset, idna_encoding) UNIT_TEST_CHECK(a == lowercase(tace)); utf8 tutf; - ace_to_utf8(a, tutf); + ace_to_utf8(a, tutf, origin::internal); L(FL("UTF-encoded %s: '%s'") % idna_vec[i].name % tutf); UNIT_TEST_CHECK(u == lowercase(tutf())); } ============================================================ --- dates.cc 758fad800224cec0eb2115b55b51082167f00504 +++ dates.cc be2d1eab6749b750b4304c6f3d646a27d1bf034e @@ -350,7 +350,7 @@ UNIT_TEST(date, from_string) { #define OK(x,y) UNIT_TEST_CHECK(date_t::from_string(x).as_iso_8601_extended() \ == (y)) -#define NO(x) UNIT_TEST_CHECK_THROW(date_t::from_string(x), informative_failure) +#define NO(x) UNIT_TEST_CHECK_THROW(date_t::from_string(x), recoverable_failure) // canonical format OK("2007-03-01T18:41:13", "2007-03-01T18:41:13"); ============================================================ --- globish.cc c31853a13f7206ac2ef1e94be74f67bdb7ccd7fc +++ globish.cc 3aecf8455aa7c028b29afd3d5437560dbf039bc3 @@ -604,7 +604,7 @@ UNIT_TEST(globish, syntax) for (tcase const * p = good; p->in; p++) { - globish g(p->in); + globish g(p->in, origin::internal); string s; dump(g, s); L(FL("globish syntax: %s -> %s [expect %s]") % p->in % s % p->out); @@ -614,7 +614,8 @@ UNIT_TEST(globish, syntax) for (char const * const * p = bad; *p; p++) { L(FL("globish syntax: invalid %s") % *p); - UNIT_TEST_CHECK_THROW(I(globish(*p).matches(dummy)), informative_failure); + UNIT_TEST_CHECK_THROW(I(globish(*p, origin::user).matches(dummy)), recoverable_failure); + UNIT_TEST_CHECK_THROW(I(globish(*p, origin::internal).matches(dummy)), unrecoverable_failure); } } @@ -632,60 +633,61 @@ UNIT_TEST(globish, simple_matches) UNIT_TEST(globish, simple_matches) { - UNIT_TEST_CHECK(globish("abc").matches("abc")); - UNIT_TEST_CHECK(!globish("abc").matches("aac")); + UNIT_TEST_CHECK(globish("abc", origin::internal).matches("abc")); + UNIT_TEST_CHECK(!globish("abc", origin::internal).matches("aac")); - UNIT_TEST_CHECK(globish("a[bc]d").matches("abd")); - UNIT_TEST_CHECK(globish("a[bc]d").matches("acd")); - UNIT_TEST_CHECK(!globish("a[bc]d").matches("and")); - UNIT_TEST_CHECK(!globish("a[bc]d").matches("ad")); - UNIT_TEST_CHECK(!globish("a[bc]d").matches("abbd")); + UNIT_TEST_CHECK(globish("a[bc]d", origin::internal).matches("abd")); + UNIT_TEST_CHECK(globish("a[bc]d", origin::internal).matches("acd")); + UNIT_TEST_CHECK(!globish("a[bc]d", origin::internal).matches("and")); + UNIT_TEST_CHECK(!globish("a[bc]d", origin::internal).matches("ad")); + UNIT_TEST_CHECK(!globish("a[bc]d", origin::internal).matches("abbd")); - UNIT_TEST_CHECK(globish("a[!bc]d").matches("and")); - UNIT_TEST_CHECK(globish("a[!bc]d").matches("a#d")); - UNIT_TEST_CHECK(!globish("a[!bc]d").matches("abd")); - UNIT_TEST_CHECK(!globish("a[!bc]d").matches("acd")); - UNIT_TEST_CHECK(!globish("a[!bc]d").matches("ad")); - UNIT_TEST_CHECK(!globish("a[!bc]d").matches("abbd")); + UNIT_TEST_CHECK(globish("a[!bc]d", origin::internal).matches("and")); + UNIT_TEST_CHECK(globish("a[!bc]d", origin::internal).matches("a#d")); + UNIT_TEST_CHECK(!globish("a[!bc]d", origin::internal).matches("abd")); + UNIT_TEST_CHECK(!globish("a[!bc]d", origin::internal).matches("acd")); + UNIT_TEST_CHECK(!globish("a[!bc]d", origin::internal).matches("ad")); + UNIT_TEST_CHECK(!globish("a[!bc]d", origin::internal).matches("abbd")); - UNIT_TEST_CHECK(globish("a?c").matches("abc")); - UNIT_TEST_CHECK(globish("a?c").matches("aac")); - UNIT_TEST_CHECK(globish("a?c").matches("a%c")); - UNIT_TEST_CHECK(!globish("a?c").matches("a%d")); - UNIT_TEST_CHECK(!globish("a?c").matches("d%d")); - UNIT_TEST_CHECK(!globish("a?c").matches("d%c")); - UNIT_TEST_CHECK(!globish("a?c").matches("a%%d")); + UNIT_TEST_CHECK(globish("a?c", origin::internal).matches("abc")); + UNIT_TEST_CHECK(globish("a?c", origin::internal).matches("aac")); + UNIT_TEST_CHECK(globish("a?c", origin::internal).matches("a%c")); + UNIT_TEST_CHECK(!globish("a?c", origin::internal).matches("a%d")); + UNIT_TEST_CHECK(!globish("a?c", origin::internal).matches("d%d")); + UNIT_TEST_CHECK(!globish("a?c", origin::internal).matches("d%c")); + UNIT_TEST_CHECK(!globish("a?c", origin::internal).matches("a%%d")); - UNIT_TEST_CHECK(globish("a*c").matches("ac")); - UNIT_TEST_CHECK(globish("a*c").matches("abc")); - UNIT_TEST_CHECK(globish("a*c").matches("abac")); - UNIT_TEST_CHECK(globish("a*c").matches("abbcc")); - UNIT_TEST_CHECK(globish("a*c").matches("abcbbc")); - UNIT_TEST_CHECK(!globish("a*c").matches("abcbb")); - UNIT_TEST_CHECK(!globish("a*c").matches("abcb")); - UNIT_TEST_CHECK(!globish("a*c").matches("aba")); - UNIT_TEST_CHECK(!globish("a*c").matches("ab")); + UNIT_TEST_CHECK(globish("a*c", origin::internal).matches("ac")); + UNIT_TEST_CHECK(globish("a*c", origin::internal).matches("abc")); + UNIT_TEST_CHECK(globish("a*c", origin::internal).matches("abac")); + UNIT_TEST_CHECK(globish("a*c", origin::internal).matches("abbcc")); + UNIT_TEST_CHECK(globish("a*c", origin::internal).matches("abcbbc")); + UNIT_TEST_CHECK(!globish("a*c", origin::internal).matches("abcbb")); + UNIT_TEST_CHECK(!globish("a*c", origin::internal).matches("abcb")); + UNIT_TEST_CHECK(!globish("a*c", origin::internal).matches("aba")); + UNIT_TEST_CHECK(!globish("a*c", origin::internal).matches("ab")); - UNIT_TEST_CHECK(globish("*.bak").matches(".bak")); - UNIT_TEST_CHECK(globish("*.bak").matches("a.bak")); - UNIT_TEST_CHECK(globish("*.bak").matches("foo.bak")); - UNIT_TEST_CHECK(globish("*.bak").matches(".bak.bak")); - UNIT_TEST_CHECK(globish("*.bak").matches("fwibble.bak.bak")); + UNIT_TEST_CHECK(globish("*.bak", origin::internal).matches(".bak")); + UNIT_TEST_CHECK(globish("*.bak", origin::internal).matches("a.bak")); + UNIT_TEST_CHECK(globish("*.bak", origin::internal).matches("foo.bak")); + UNIT_TEST_CHECK(globish("*.bak", origin::internal).matches(".bak.bak")); + UNIT_TEST_CHECK(globish("*.bak", origin::internal).matches("fwibble.bak.bak")); - UNIT_TEST_CHECK(globish("a*b*[cd]").matches("abc")); - UNIT_TEST_CHECK(globish("a*b*[cd]").matches("abcd")); - UNIT_TEST_CHECK(globish("a*b*[cd]").matches("aabrd")); - UNIT_TEST_CHECK(globish("a*b*[cd]").matches("abbbbbbbccd")); - UNIT_TEST_CHECK(!globish("a*b*[cd]").matches("ab")); - UNIT_TEST_CHECK(!globish("a*b*[cd]").matches("abde")); - UNIT_TEST_CHECK(!globish("a*b*[cd]").matches("aaaaaaab")); - UNIT_TEST_CHECK(!globish("a*b*[cd]").matches("axxxxd")); - UNIT_TEST_CHECK(!globish("a*b*[cd]").matches("adb")); + UNIT_TEST_CHECK(globish("a*b*[cd]", origin::internal).matches("abc")); + UNIT_TEST_CHECK(globish("a*b*[cd]", origin::internal).matches("abcd")); + UNIT_TEST_CHECK(globish("a*b*[cd]", origin::internal).matches("aabrd")); + UNIT_TEST_CHECK(globish("a*b*[cd]", origin::internal).matches("abbbbbbbccd")); + UNIT_TEST_CHECK(!globish("a*b*[cd]", origin::internal).matches("ab")); + UNIT_TEST_CHECK(!globish("a*b*[cd]", origin::internal).matches("abde")); + UNIT_TEST_CHECK(!globish("a*b*[cd]", origin::internal).matches("aaaaaaab")); + UNIT_TEST_CHECK(!globish("a*b*[cd]", origin::internal).matches("axxxxd")); + UNIT_TEST_CHECK(!globish("a*b*[cd]", origin::internal).matches("adb")); } UNIT_TEST(globish, complex_matches) { { - globish_matcher m(globish("{a,b}?*\\*|"), globish("*c*")); + globish_matcher m(globish("{a,b}?*\\*|", origin::internal), + globish("*c*", origin::internal)); UNIT_TEST_CHECK(m("aq*|")); UNIT_TEST_CHECK(m("bq*|")); UNIT_TEST_CHECK(!m("bc*|")); @@ -694,7 +696,8 @@ UNIT_TEST(globish, complex_matches) UNIT_TEST_CHECK(!m("")); } { - globish_matcher m(globish("{a,\\\\,b*}"), globish("*c*")); + globish_matcher m(globish("{a,\\\\,b*}", origin::internal), + globish("*c*", origin::internal)); UNIT_TEST_CHECK(m("a")); UNIT_TEST_CHECK(!m("ab")); UNIT_TEST_CHECK(m("\\")); @@ -704,12 +707,14 @@ UNIT_TEST(globish, complex_matches) UNIT_TEST_CHECK(!m("bfoobarcfoobar")); } { - globish_matcher m(globish("*"), globish("")); + globish_matcher m(globish("*", origin::internal), + globish("", origin::internal)); UNIT_TEST_CHECK(m("foo")); UNIT_TEST_CHECK(m("")); } { - globish_matcher m(globish("{foo}"), globish("")); + globish_matcher m(globish("{foo}", origin::internal), + globish("", origin::internal)); UNIT_TEST_CHECK(m("foo")); UNIT_TEST_CHECK(!m("bar")); } @@ -717,7 +722,7 @@ UNIT_TEST(globish, nested_matches) UNIT_TEST(globish, nested_matches) { - globish g("a.{i.{x,y},j}"); + globish g("a.{i.{x,y},j}", origin::internal); UNIT_TEST_CHECK(g.matches("a.i.x")); UNIT_TEST_CHECK(g.matches("a.i.y")); UNIT_TEST_CHECK(g.matches("a.j")); ============================================================ --- netcmd.cc 1f0f0491fbc24e90eb64d9d9fd0dcc57b62b33d1 +++ netcmd.cc 5fdb6c151fe6bc04b5304bf8510ddcd0a8e76ae7 @@ -681,8 +681,10 @@ UNIT_TEST(netcmd, functions) // total cheat, since we don't actually verify that rsa_oaep_sha_data // is sensible anywhere here... rsa_oaep_sha_data out_key("nonce start my heart"), in_key; - globish out_include_pattern("radishes galore!"), in_include_pattern; - globish out_exclude_pattern("turnips galore!"), in_exclude_pattern; + globish out_include_pattern("radishes galore!", origin::internal), + in_include_pattern; + globish out_exclude_pattern("turnips galore!", origin::internal), + in_exclude_pattern; out_cmd.write_anonymous_cmd(out_role, out_include_pattern, out_exclude_pattern, out_key); do_netcmd_roundtrip(out_cmd, in_cmd, buf); @@ -706,8 +708,10 @@ UNIT_TEST(netcmd, functions) // is sensible anywhere here... rsa_oaep_sha_data out_key("nonce start my heart"), in_key; rsa_sha1_signature out_signature(raw_sha1("burble") + raw_sha1("gorby")), in_signature; - globish out_include_pattern("radishes galore!"), in_include_pattern; - globish out_exclude_pattern("turnips galore!"), in_exclude_pattern; + globish out_include_pattern("radishes galore!", origin::user), + in_include_pattern; + globish out_exclude_pattern("turnips galore!", origin::user), + in_exclude_pattern; out_cmd.write_auth_cmd(out_role, out_include_pattern, out_exclude_pattern , out_client, out_nonce1, out_key, out_signature); ============================================================ --- netxx_pipe.cc 12729ada48b2d0def552f2754204db5e321ddf76 +++ netxx_pipe.cc 6dcfc8169b0df0041a2df3cd02574177e12dee35 @@ -594,7 +594,8 @@ UNIT_TEST(pipe, simple_pipe) probe.clear(); probe.add(pipe, Netxx::Probe::ready_read); res = probe.ready(timeout); - E(res.second & Netxx::Probe::ready_read, F("timeout reading data %d") % c); + E(res.second & Netxx::Probe::ready_read, origin::system, + F("timeout reading data %d") % c); #ifdef WIN32 I(res.first == pipe.get_socketfd()); #else @@ -611,7 +612,7 @@ UNIT_TEST(pipe, simple_pipe) pipe.close(); } -catch (informative_failure &e) +catch (recoverable_failure &e) // for some reason boost does not provide // enough information { ============================================================ --- packet.cc 75b0671dd6fccd7d8625ceb14e671f9f67537985 +++ packet.cc b03a705bacfefcd03be113ad27cb8139cce85915 @@ -409,7 +409,7 @@ UNIT_TEST(packet, validators) ostringstream oss; packet_writer pw(oss); size_t count; - feed_packet_consumer f(count, pw); + feed_packet_consumer f(count, pw, origin::user); #define N_THROW(expr) UNIT_TEST_CHECK_NOT_THROW(expr, recoverable_failure) #define Y_THROW(expr) UNIT_TEST_CHECK_THROW(expr, recoverable_failure) ============================================================ --- paths.cc ee1fe4664673614e20546d37d9612b0be243228f +++ paths.cc a53b0c0a5948913606695990415f5138fd363b36 @@ -1171,7 +1171,7 @@ UNIT_TEST(paths, file_path_external_null for (char const * const * c = baddies; *c; ++c) { L(FL("test_file_path_external_null_prefix: trying baddie: %s") % *c); - UNIT_TEST_CHECK_THROW(file_path_external(utf8(*c)), informative_failure); + UNIT_TEST_CHECK_THROW(file_path_external(utf8(*c)), recoverable_failure); } check_fp_normalizes_to("a", "a"); @@ -1208,9 +1208,9 @@ UNIT_TEST(paths, file_path_external_pref initial_rel_path.unset(); initial_rel_path.set(string("_MTN"), true); - UNIT_TEST_CHECK_THROW(file_path_external(utf8("foo")), informative_failure); - UNIT_TEST_CHECK_THROW(file_path_external(utf8(".")), informative_failure); - UNIT_TEST_CHECK_THROW(file_path_external(utf8("./blah")), informative_failure); + UNIT_TEST_CHECK_THROW(file_path_external(utf8("foo")), recoverable_failure); + UNIT_TEST_CHECK_THROW(file_path_external(utf8(".")), recoverable_failure); + UNIT_TEST_CHECK_THROW(file_path_external(utf8("./blah")), recoverable_failure); check_fp_normalizes_to("..", ""); check_fp_normalizes_to("../foo", "foo"); } @@ -1252,7 +1252,7 @@ UNIT_TEST(paths, file_path_external_pref for (char const * const * c = baddies; *c; ++c) { L(FL("test_file_path_external_prefix_a_b: trying baddie: %s") % *c); - UNIT_TEST_CHECK_THROW(file_path_external(utf8(*c)), informative_failure); + UNIT_TEST_CHECK_THROW(file_path_external(utf8(*c)), recoverable_failure); } check_fp_normalizes_to("foo", "a/b/foo"); @@ -1579,7 +1579,7 @@ UNIT_TEST(paths, system) initial_abs_path.unset(); initial_abs_path.set(system_path("/a/b"), true); - UNIT_TEST_CHECK_THROW(system_path(""), informative_failure); + UNIT_TEST_CHECK_THROW(system_path(""), unrecoverable_failure); check_system_normalizes_to("foo", "/a/b/foo"); check_system_normalizes_to("foo/bar", "/a/b/foo/bar"); @@ -1626,7 +1626,7 @@ UNIT_TEST(paths, system) == "/a/b/~this_user_does_not_exist_anywhere"); #else UNIT_TEST_CHECK_THROW(system_path("~this_user_does_not_exist_anywhere"), - informative_failure); + unrecoverable_failure); #endif // finally, make sure that the copy-from-any_path constructor works right ============================================================ --- restrictions.cc 4423c2d69e15a5b8835405646e1c85fef5839081 +++ restrictions.cc 9f51a6b8ccdabffe3799d93c2e3a24b57ad74a54 @@ -956,7 +956,7 @@ UNIT_TEST(restrictions, invalid_roster_p excludes.push_back(file_path_internal("bar")); UNIT_TEST_CHECK_THROW(node_restriction(includes, excludes, -1, roster), - informative_failure); + recoverable_failure); } UNIT_TEST(restrictions, invalid_workspace_paths) @@ -969,7 +969,7 @@ UNIT_TEST(restrictions, invalid_workspac excludes.push_back(file_path_internal("bar")); UNIT_TEST_CHECK_THROW(path_restriction(includes, excludes, -1), - informative_failure); + recoverable_failure); } UNIT_TEST(restrictions, ignored_invalid_workspace_paths) ============================================================ --- roster_merge.cc 44b779b583bfc3087a9f23ac87c2b0f736df9a53 +++ roster_merge.cc 3f7ab8dfc67847a8e893864663cee2e8f1177b51 @@ -37,7 +37,7 @@ namespace resolve_conflicts return boost::shared_ptr(new file_path(file_path_external(utf8(path)))); }; - static char const * const + static char const * image(resolve_conflicts::resolution_t resolution) { switch (resolution) ============================================================ --- tester.cc 2d74a12843efda14c39c58b773889a122a534d4a +++ tester.cc d879cd83eb36960f1eb5dc12211c95bebaac7ee3 @@ -73,7 +73,7 @@ static void ensure_dir(string const & di { do_mkdir(dir); } - catch (informative_failure &) + catch (recoverable_failure &) { if (get_path_status(dir) != path::directory) throw; @@ -205,7 +205,7 @@ void do_copy_recursive(string const & fr { path::status fromstat = get_path_status(from); - E(fromstat != path::nonexistent, + E(fromstat != path::nonexistent, origin::user, F("Source '%s' for copy does not exist") % from); switch (get_path_status(to)) @@ -233,7 +233,8 @@ void do_copy_recursive(string const & fr struct file_copier copy_files(from, to); do_read_directory(from, copy_files, get_subdirs, get_specials); - E(specials.empty(), F("cannot copy special files in '%s'") % from); + E(specials.empty(), origin::user, + F("cannot copy special files in '%s'") % from); for (vector::const_iterator i = subdirs.begin(); i != subdirs.end(); i++) do_copy_recursive(from + "/" + *i, to + "/" + *i); @@ -252,14 +253,14 @@ LUAEXT(posix_umask, ) LUAEXT(posix_umask, ) { unsigned int decmask = (unsigned int)luaL_checknumber(LS, -1); - E(decmask <= 777, + E(decmask <= 777, origin::user, F("invalid argument %d to umask") % decmask); unsigned int a = decmask / 100 % 10; unsigned int b = decmask / 10 % 10; unsigned int c = decmask / 1 % 10; - E(a <= 7 && b <= 7 && c <= 7, + E(a <= 7 && b <= 7 && c <= 7, origin::user, F("invalid octal number %d in umask") % decmask); int oldmask = do_umask((a*8 + b)*8 + c); @@ -288,7 +289,7 @@ LUAEXT(chdir, ) lua_pushstring(LS, from.c_str()); return 1; } - catch(informative_failure & e) + catch(recoverable_failure & e) { lua_pushnil(LS); return 1; @@ -303,7 +304,7 @@ LUAEXT(remove_recursive, ) lua_pushboolean(LS, true); return 1; } - catch(informative_failure & e) + catch(recoverable_failure & e) { lua_pushboolean(LS, false); lua_pushstring(LS, e.what()); @@ -319,7 +320,7 @@ LUAEXT(make_tree_accessible, ) lua_pushboolean(LS, true); return 1; } - catch(informative_failure & e) + catch(recoverable_failure & e) { lua_pushboolean(LS, false); lua_pushstring(LS, e.what()); @@ -337,7 +338,7 @@ LUAEXT(copy_recursive, ) lua_pushboolean(LS, true); return 1; } - catch(informative_failure & e) + catch(recoverable_failure & e) { lua_pushboolean(LS, false); lua_pushstring(LS, e.what()); @@ -354,7 +355,7 @@ LUAEXT(mkdir, ) lua_pushboolean(LS, true); return 1; } - catch(informative_failure & e) + catch(recoverable_failure & e) { lua_pushnil(LS); return 1; @@ -371,7 +372,7 @@ LUAEXT(make_temp_dir, ) delete [] tmpdir; return 1; } - catch(informative_failure & e) + catch(recoverable_failure & e) { lua_pushnil(LS); return 1; @@ -392,7 +393,7 @@ LUAEXT(mtime, ) lua_pushnumber(LS, t); return 1; } - catch(informative_failure & e) + catch(recoverable_failure & e) { lua_pushnil(LS); return 1; @@ -411,7 +412,7 @@ LUAEXT(exists, ) case path::directory: lua_pushboolean(LS, true); break; } } - catch(informative_failure & e) + catch(recoverable_failure & e) { lua_pushnil(LS); } @@ -430,7 +431,7 @@ LUAEXT(isdir, ) case path::directory: lua_pushboolean(LS, true); break; } } - catch(informative_failure & e) + catch(recoverable_failure & e) { lua_pushnil(LS); } @@ -467,7 +468,7 @@ LUAEXT(read_directory, ) do_read_directory(path, tbl, tbl, tbl); } - catch(informative_failure &) + catch(recoverable_failure &) { // discard the table and any pending path element lua_settop(LS, top); @@ -617,7 +618,7 @@ int test_invoker::operator()(std::string } catch (std::exception & e) { - E(false, F("test %s: %s") % testname % e.what()); + E(false, origin::no_fault, F("test %s: %s") % testname % e.what()); retcode = 124; } return retcode; @@ -985,6 +986,7 @@ parse_command_line(int argc, char const E(!run_one || (!want_help && !debugging && !list_only && tests_to_run.size() == 3 && jobs == 0), + origin::user, F("incorrect self-invocation; -r ")); if (tests_to_run.empty()) @@ -1066,7 +1068,8 @@ int main(int argc, char **argv) lua_lib st(tests_to_run[1], tests_to_run[0]); return test_invoker(st())(tests_to_run[2]); #else - E(false, F("self-invocation should not be used on Unix\n")); + E(false, origin::user, + F("self-invocation should not be used on Unix\n")); #endif } else @@ -1135,7 +1138,7 @@ int main(int argc, char **argv) .extract_int(retcode); } } - catch (informative_failure & e) + catch (recoverable_failure & e) { P(F("%s\n") % e.what()); retcode = 1; ============================================================ --- unix/tester-plaf.cc 577f702ea3292bc5315044849d13f2f9a52cc4a1 +++ unix/tester-plaf.cc 839e25268631815a9c6a3a8864a4b9d5dc4a78a1 @@ -24,7 +24,7 @@ void make_accessible(string const & name if (stat(name.c_str(), &st) != 0) { const int err = errno; - E(false, F("stat(%s) failed: %s") % name % os_strerror(err)); + E(false, origin::system, F("stat(%s) failed: %s") % name % os_strerror(err)); } mode_t new_mode = st.st_mode; @@ -35,7 +35,7 @@ void make_accessible(string const & name if (chmod(name.c_str(), new_mode) != 0) { const int err = errno; - E(false, F("chmod(%s) failed: %s") % name % os_strerror(err)); + E(false, origin::system, F("chmod(%s) failed: %s") % name % os_strerror(err)); } } @@ -45,7 +45,7 @@ time_t get_last_write_time(char const * if (stat(name, &st) != 0) { const int err = errno; - E(false, F("stat(%s) failed: %s") % name % os_strerror(err)); + E(false, origin::system, F("stat(%s) failed: %s") % name % os_strerror(err)); } return st.st_mtime; @@ -57,7 +57,7 @@ void do_copy_file(string const & from, s int ifd, ofd; ifd = open(from.c_str(), O_RDONLY); const int err = errno; - E(ifd >= 0, F("open %s: %s") % from % os_strerror(err)); + E(ifd >= 0, origin::system, F("open %s: %s") % from % os_strerror(err)); struct stat st; st.st_mode = 0666; // sane default if fstat fails fstat(ifd, &st); @@ -66,7 +66,7 @@ void do_copy_file(string const & from, s { const int err = errno; close(ifd); - E(false, F("open %s: %s") % to % os_strerror(err)); + E(false, origin::system, F("open %s: %s") % to % os_strerror(err)); } ssize_t nread, nwrite; @@ -103,21 +103,22 @@ void do_copy_file(string const & from, s int err = errno; close(ifd); close(ofd); - E(false, F("read error copying %s to %s: %s") + E(false, origin::system, F("read error copying %s to %s: %s") % from % to % os_strerror(err)); } write_error: { int err = errno; close(ifd); close(ofd); - E(false, F("write error copying %s to %s: %s") + E(false, origin::system, F("write error copying %s to %s: %s") % from % to % os_strerror(err)); } spinning: { close(ifd); close(ofd); - E(false, F("abandoning copy of %s to %s after four zero-length writes") + E(false, origin::system, + F("abandoning copy of %s to %s after four zero-length writes") % from % to); } } @@ -202,7 +203,8 @@ char * make_temp_dir() { strcpy(tmpdir, templ); result = mktemp(tmpdir); - E(result, F("mktemp(%s) failed: %s") % tmpdir % os_strerror(errno)); + E(result, origin::system, + F("mktemp(%s) failed: %s") % tmpdir % os_strerror(errno)); I(result == tmpdir); if (mkdir(tmpdir, 0700) == 0) @@ -212,11 +214,11 @@ char * make_temp_dir() return templ; } - E(errno == EEXIST, + E(errno == EEXIST, origin::system, F("mkdir(%s) failed: %s") % tmpdir % os_strerror(errno)); cycles++; - E(cycles < limit, + E(cycles < limit, origin::system, F("%d temporary names are all in use") % limit); } @@ -379,7 +381,7 @@ void prepare_for_parallel_testcases(int if (jread == -1 && jwrite == -1) { int jp[2]; - E(pipe(jp) == 0, + E(pipe(jp) == 0, origin::system, F("creating jobs pipe: %s") % os_strerror(errno)); jread = jp[0]; jwrite = jp[1]; @@ -446,7 +448,7 @@ void run_tests_in_children(test_enumerat sa.sa_handler = sigchld; sa.sa_flags = SA_NOCLDSTOP; // deliberate non-use of SA_RESTART - E(sigaction(SIGCHLD, &sa, &osa) == 0, + E(sigaction(SIGCHLD, &sa, &osa) == 0, origin::system, F("setting SIGCHLD handler: %s") % os_strerror(errno)); while (next_test(t)) @@ -468,7 +470,8 @@ void run_tests_in_children(test_enumerat break; if (errno == EINTR) continue; - E(false, F("waitpid failed: %s") % os_strerror(errno)); + E(false, origin::system, + F("waitpid failed: %s") % os_strerror(errno)); } map::iterator tfin = children.find(pid); @@ -527,7 +530,8 @@ void run_tests_in_children(test_enumerat break; if (errno == EINTR) continue; - E(false, F("waitpid failed: %s") % os_strerror(errno)); + E(false, origin::system, + F("waitpid failed: %s") % os_strerror(errno)); } map::iterator tfin = children.find(pid);