about summary refs log tree commit diff
path: root/src/libextra/test.rs
AgeCommit message (Collapse)AuthorLines
2013-11-26librustuv: Remove all non-`proc` uses of `do` from `libextra` andPatrick Walton-10/+10
`librustuv`.
2013-11-26Removed unneccessary `_iter` suffixes from various APIsMarvin Löbel-1/+1
2013-11-24auto merge of #10603 : alexcrichton/rust/no-linked-failure, r=brsonbors-1/+0
The reasons for doing this are: * The model on which linked failure is based is inherently complex * The implementation is also very complex, and there are few remaining who fully understand the implementation * There are existing race conditions in the core context switching function of the scheduler, and possibly others. * It's unclear whether this model of linked failure maps well to a 1:1 threading model Linked failure is often a desired aspect of tasks, but we would like to take a much more conservative approach in re-implementing linked failure if at all. Closes #8674 Closes #8318 Closes #8863
2013-11-24Remove linked failure from the runtimeAlex Crichton-1/+0
The reasons for doing this are: * The model on which linked failure is based is inherently complex * The implementation is also very complex, and there are few remaining who fully understand the implementation * There are existing race conditions in the core context switching function of the scheduler, and possibly others. * It's unclear whether this model of linked failure maps well to a 1:1 threading model Linked failure is often a desired aspect of tasks, but we would like to take a much more conservative approach in re-implementing linked failure if at all. Closes #8674 Closes #8318 Closes #8863
2013-11-24libextra: Remove @mut from term.Luqman Aden-76/+84
2013-11-19libextra: Convert uses of `&fn(A)->B` to `|A|->B`.Patrick Walton-7/+5
2013-11-18libextra: Remove `~fn()` from libextra.Patrick Walton-7/+12
2013-11-11Move std::rt::io to std::ioAlex Crichton-5/+5
2013-11-11Remove #[fixed_stack_segment] and #[rust_stack]Alex Crichton-2/+0
These two attributes are no longer useful now that Rust has decided to leave segmented stacks behind. It is assumed that the rust task's stack is always large enough to make an FFI call (due to the stack being very large). There's always the case of stack overflow, however, to consider. This does not change the behavior of stack overflow in Rust. This is still normally triggered by the __morestack function and aborts the whole process. C stack overflow will continue to corrupt the stack, however (as it did before this commit as well). The future improvement of a guard page at the end of every rust stack is still unimplemented and is intended to be the mechanism through which we attempt to detect C stack overflow. Closes #8822 Closes #10155
2013-11-03Fill out the remaining functionality in io::fileAlex Crichton-4/+4
This adds bindings to the remaining functions provided by libuv, all of which are useful operations on files which need to get exposed somehow. Some highlights: * Dropped `FileReader` and `FileWriter` and `FileStream` for one `File` type * Moved all file-related methods to be static methods under `File` * All directory related methods are still top-level functions * Created `io::FilePermission` types (backed by u32) that are what you'd expect * Created `io::FileType` and refactored `FileStat` to use FileType and FilePermission * Removed the expanding matrix of `FileMode` operations. The mode of reading a file will not have the O_CREAT flag, but a write mode will always have the O_CREAT flag. Closes #10130 Closes #10131 Closes #10121
2013-11-03Remove all blocking std::os blocking functionsAlex Crichton-10/+6
This commit moves all thread-blocking I/O functions from the std::os module. Their replacements can be found in either std::rt::io::file or in a hidden "old_os" module inside of native::file. I didn't want to outright delete these functions because they have a lot of special casing learned over time for each OS/platform, and I imagine that these will someday get integrated into a blocking implementation of IoFactory. For now, they're moved to a private module to prevent bitrot and still have tests to ensure that they work. I've also expanded the extensions to a few more methods defined on Path, most of which were previously defined in std::os but now have non-thread-blocking implementations as part of using the current IoFactory. The api of io::file is in flux, but I plan on changing it in the next commit as well. Closes #10057
2013-11-01Give test and main tasks better namesAlex Crichton-0/+4
Tests now have the same name as the test that they're running (to allow for easier diagnosing of failure sources), and the main task is now specially named <main> instead of <unnamed>. Closes #10195 Closes #10073
2013-10-28Allow fail messages to be caught, and introduce the Any traitMarvin Löbel-2/+1
Some code cleanup, sorting of import blocks Removed std::unstable::UnsafeArc's use of Either Added run-fail tests for the new FailWithCause impls Changed future_result and try to return Result<(), ~Any>. - Internally, there is an enum of possible fail messages passend around. - In case of linked failure or a string message, the ~Any gets lazyly allocated in future_results recv method. - For that, future result now returns a wrapper around a Port. - Moved and renamed task::TaskResult into rt::task::UnwindResult and made it an internal enum. - Introduced a replacement typedef `type TaskResult = Result<(), ~Any>`.
2013-10-24Remove even more of std::ioAlex Crichton-74/+71
Big fish fried here: extra::json most of the compiler extra::io_util removed extra::fileinput removed Fish left to fry extra::ebml
2013-10-23Removed Unnecessary comments and white spaces #4386reedlepee-8/+0
2013-10-23Making fields in std and extra : private #4386reedlepee-7/+15
2013-10-22Drop the '2' suffix from logging macrosAlex Crichton-16/+16
Who doesn't like a massive renaming?
2013-10-18Made `std::task::TaskBuilder::future_result()` easier to useMarvin Löbel-4/+2
2013-10-15path2: Adjust the API to remove all the _str mutation methodsKevin Ballard-4/+4
Add a new trait BytesContainer that is implemented for both byte vectors and strings. Convert Path::from_vec and ::from_str to one function, Path::new(). Remove all the _str-suffixed mutation methods (push, join, with_*, set_*) and modify the non-suffixed versions to use BytesContainer.
2013-10-15path2: Replace the path module outrightKevin Ballard-6/+6
Remove the old path. Rename path2 to path. Update all clients for the new path. Also make some miscellaneous changes to the Path APIs to help the adoption process.
2013-10-14Only use padded test names to calculate the target padding size.Felix S. Klock II-3/+12
2013-10-14Issue 7655: align the bench printouts so that the numbers tend to be aligned.Felix S. Klock II-12/+51
(scratching an itch.) Rebased and updated. Fixed bug: omitted field init from embedded struct literal in a test. Fixed bug: int underflow during padding length calculation.
2013-10-11auto merge of #9803 : alexcrichton/rust/less-pub2, r=brsonbors-1/+1
This change was waiting for privacy to get sorted out, which should be true now that #8215 has landed. Closes #4427
2013-10-11extra::tempfile: replace mkdtemp with an RAII wrapperBenjamin Herr-7/+3
this incidentally stops `make check` from leaving directories in `/tmp`
2013-10-11De-pub some private runtime componentsAlex Crichton-1/+1
This change was waiting for privacy to get sorted out, which should be true now that #8215 has landed. Closes #4427
2013-10-09option: rewrite the API to use compositionDaniel Micay-4/+4
2013-10-01remove the `float` typeDaniel Micay-10/+10
It is simply defined as `f64` across every platform right now. A use case hasn't been presented for a `float` type defined as the highest precision floating point type implemented in hardware on the platform. Performance-wise, using the smallest precision correct for the use case greatly saves on cache space and allows for fitting more numbers into SSE/AVX registers. If there was a use case, this could be implemented as simply a type alias or a struct thanks to `#[cfg(...)]`. Closes #6592 The mailing list thread, for reference: https://mail.mozilla.org/pipermail/rust-dev/2013-July/004632.html
2013-09-30syntax: Remove usage of fmt!Alex Crichton-1/+1
2013-09-30extra: Remove usage of fmt!Alex Crichton-33/+33
2013-09-24Don't use libc::exit. #9473Brian Anderson-12/+11
This can cause unexpected errors in the runtime when done while scheduler threads are still initializing. Required some restructuring of the main_args functions in our libraries.
2013-09-23librustc: Remove `@fn` managed closures from the language.Patrick Walton-5/+0
2013-09-19Turned extra::getopts functions into methodsMarvin Löbel-11/+11
Some minor api and doc adjustments
2013-09-15Remove {uint,int,u64,i64,...}::from_str,from_str_radixblake2-ppc-3/+2
Remove these in favor of the two traits themselves and the wrapper function std::from_str::from_str. Add the function std::num::from_str_radix in the corresponding role for the FromStrRadix trait.
2013-09-14extra::test: Use Result instead of Either.blake2-ppc-11/+9
OptRes was combining a successful value with an error message, which fits the Result type perfectly.
2013-09-05extra: Don't overcommit test tasks. Closes #8660Brian Anderson-10/+1
The new scheduler makes better use of threads than the old.
2013-08-29extra: error message should reflact that RUST_TEST_TASKS should be strictly ↵Huon Wilson-1/+1
positive (zero is illegal).
2013-08-29Make the unit-test framework check RUST_TEST_TASKS over RUST_THREADS.Huon Wilson-4/+15
Fixes #7335.
2013-08-24auto merge of #8679 : singingboyo/rust/json-to-impl, r=alexcrichtonbors-1/+1
to_str, to_pretty_str, to_writer, and to_pretty_writer were at the top level of extra::json, this moves them into an impl for Json to match with what's been done for the rest of libextra and libstd. (or at least for vec and str) Also meant changing some tests. Closes #8676.
2013-08-23test: add support for sharding testsuite by passing --test-shard=a.bGraydon Hoare-2/+36
2013-08-22Enabled unit tests in std and extra.Vadim Chugunov-1/+0
2013-08-21Make json::to_xxx(&Json) fns Json::to_xxx(&self)Brandon Sanderson-1/+1
to_str, to_pretty_str, to_writer, and to_pretty_writer were at the top level of extra::json, this moves them into an impl for Json to match with what's been done for the rest of libextra and libstd.
2013-08-19Add externfn macro and correctly label fixed_stack_segmentsNiko Matsakis-0/+2
2013-08-15vec: rm obsolete zip and zip_sliceDaniel Micay-9/+2
These are obsoleted by the generic iterator `zip` adaptor. Unlike these, it does not clone the elements or allocate a new vector by default.
2013-08-12Forbid pub/priv where it has no effectAlex Crichton-1/+1
Closes #5495
2013-08-10std: Rename Iterator.transform -> .mapErick Tryzelaar-4/+4
cc #5898
2013-08-10std: merge Iterator and IteratorUtilErick Tryzelaar-1/+0
2013-08-10Mass rename of .consume{,_iter}() to .move_iter()Erick Tryzelaar-3/+3
cc #7887
2013-08-09Remove the C++ runtime. SayonaraBrian Anderson-1/+1
2013-08-07core: option.map_consume -> option.map_moveErick Tryzelaar-4/+4
2013-08-05Updated std::Option, std::Either and std::ResultMarvin Löbel-29/+28
- Made naming schemes consistent between Option, Result and Either - Changed Options Add implementation to work like the maybe monad (return None if any of the inputs is None) - Removed duplicate Option::get and renamed all related functions to use the term `unwrap` instead