modified logging function to truncate output and adjusted error output formatting tests to be compatible with both the new and old runtimes

This commit is contained in:
toddaaro 2013-08-02 16:48:29 -07:00 committed by Daniel Micay
parent deddb009f0
commit eab749a5f3
9 changed files with 18 additions and 8 deletions

View file

@ -85,6 +85,16 @@ pub fn log_type<T>(level: u32, object: &T) {
fn newsched_log_str(msg: ~str) {
use rt::task::Task;
use rt::local::Local;
use str::StrSlice;
use container::Container;
// Truncate the string
let buf_bytes = 2048;
let msg = if msg.len() > buf_bytes {
msg.slice(0, buf_bytes) + "[...]"
} else {
msg
};
unsafe {
match Local::try_unsafe_borrow::<Task>() {

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// error-pattern:task failed at 'assertion failed: false'
// error-pattern:failed at 'assertion failed: false'
fn main() {
assert!(false);

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// error-pattern:task failed at 'test-assert-fmt 42 rust'
// error-pattern:failed at 'test-assert-fmt 42 rust'
fn main() {
assert!(false, "test-assert-fmt %d %s", 42, "rust");

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// error-pattern:task failed at 'test-assert-owned'
// error-pattern:failed at 'test-assert-owned'
fn main() {
assert!(false, ~"test-assert-owned");

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// error-pattern:task failed at 'test-assert-static'
// error-pattern:failed at 'test-assert-static'
fn main() {
assert!(false, "test-assert-static");

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// error-pattern:task failed at 'explicit failure'
// error-pattern:failed at 'explicit failure'
fn main() {
fail!();

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// error-pattern:task failed at 'test-fail-fmt 42 rust'
// error-pattern:failed at 'test-fail-fmt 42 rust'
fn main() {
fail!("test-fail-fmt %d %s", 42, "rust");

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// error-pattern:task failed at 'test-fail-owned'
// error-pattern:failed at 'test-fail-owned'
fn main() {
fail!("test-fail-owned");

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// error-pattern:task failed at 'test-fail-static'
// error-pattern:failed at 'test-fail-static'
fn main() {
fail!("test-fail-static");