1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
mtn_setup()
check(mtn("crash", "I"), 3, false, false)
check(exists("_MTN/debug"))
check(remove("_MTN"))
check(mtn("crash", "I"), 3, false, false)
check(exists("dump"))
mkdir("try")
check(mtn("crash", "I", "--confdir=try"), 3, false, false)
check(exists("try/dump"))
check(mtn("crash", "I", "--dump=fork"), 3, false, false)
check(exists("fork"))
remove("fork")
check(mtn("crash", "double-throw", "--dump=fork"), 3, false, true)
check(exists("fork"))
-- Make sure we're checking the std::terminate handler, rather than
-- normal exception reporting. Sometimes what should result in
-- std::terminate() will instead result in the second exception
-- being propagated. http://bugs.debian.org/516862
check(qgrep("std::terminate", "stderr"))
-- all the exceptions caught in monotone.cc and translated to error messages
for _,tag in pairs({ 'std::bad_cast',
'std::bad_typeid',
'std::bad_exception',
'std::domain_error',
'std::invalid_argument',
'std::length_error',
'std::out_of_range',
'std::range_error',
'std::overflow_error',
'std::underflow_error',
'std::logic_error',
'std::runtime_error',
'std::exception' }) do
remove("fork")
check(mtn("crash", tag, "--dump=fork"), 3, false, false)
check(exists("fork"))
end
-- bad_alloc is special
remove("fork")
check(mtn("crash", "std::bad_alloc", "--dump=fork"), 1, false, false)
check(not exists("fork"))
-- selected signals - note hardwired signal numbers :(
skip_if(ostype == "Windows")
remove("fork")
for _,tag in pairs({ 3, 6, 11 }) do
check(mtn("crash", tag, "--dump=fork"), -tag, false, false)
check(not exists("fork"))
end
|