about summary refs log tree commit diff
path: root/src/librustpkg/tests.rs
AgeCommit message (Collapse)AuthorLines
2014-02-02Remove rustpkg.Corey Richardson-2407/+0
I'm sorry :'( Closes #11859
2014-01-29Removing do keyword from librustpkgScott Lawrence-2/+2
2014-01-28Generate rlibs by default (instead of dylibs)Alex Crichton-5/+4
Closes #11253
2014-01-27debuginfo: Fix name attribute for DWARF compile unitsMichael Woerister-5/+2
2014-01-23rustpkg::crate_id: Remove CrateIdklutzy-248/+261
There is no significant difference between `rustpkg::crate_id::CrateId` and `syntax::crateid::CrateId`. rustpkg's one is replaced by syntax's one.
2014-01-23rustpkg: Compute hash to find crateklutzy-40/+37
Previously rustpkg tried to parse filenames to find crate. Now ue use deterministic hashes, so it becomes possible to directly construct filename and check if the file exists.
2014-01-23rustpkg::version: Remove enum Versionklutzy-53/+48
Currently rustpkg doesn't use SemanticVersion or Tagged, so they are removed. Remaining variants are replaced by `Option<~str>`.
2014-01-23rustpkg: Do not guess version if not givenklutzy-42/+2
rustpkg accessed git repo to read tags and guess package version, but it's not quite useful: version can be given explicitly by user, and implicit guess may cause confusions.
2014-01-21[std::str] Rename from_utf8_owned_opt() to from_utf8_owned(), drop the old ↵Simon Sapin-1/+1
from_utf8_owned() behavior
2014-01-21[std::str] Rename from_utf8_opt() to from_utf8(), drop the old from_utf8() ↵Simon Sapin-15/+15
behavior
2014-01-17Warning police.Jack Moffitt-16/+1
2014-01-17Change some rustpkg tests to use new crate_id syntax.Jack Moffitt-3/+5
2014-01-17Use the libsyntax PkgId parser in Rustpkg, but keep Rustpkg's version smarts.Jack Moffitt-3/+3
This fixes a bug where new syntax crate IDs would cause rustpkg to fail to build crates.
2014-01-11extra::workcache: Remove unused Loggerklutzy-2/+1
2014-01-07Fixup the rest of the tests in the compilerAlex Crichton-0/+1
2014-01-08Renamed Option::map_default and mutate_default to map_or and mutate_or_setMarvin Löbel-6/+6
2014-01-06auto merge of #11327 : nielsle/rust/rustpkg_argparse, r=alexcrichtonbors-2/+2
Rearrange some code in rustpkg: * Move command line argument parsing to parse_args.rs * Introduce an enum to descibe commands such as Build, Install, and Clean. * Move sysroot from Context to BuildContext, to make parse_args more modular. This is my first pull request, so please tell me if there is anything I need to do.
2014-01-05Make rustc's own lib directory configurable and change the default to ↵Jan Niklas Hasse-2/+2
rustlib. Fixes #3319
2014-01-05Move syslog to BuildContextNiels langager Ellegaard-2/+2
2014-01-01rustc::driver: Remove two @sklutzy-1/+1
2013-12-29Rename uses of PkgId to CrateId in librustpkgLuis de Bethencourt-123/+124
2013-12-25Test fixes and rebase conflictsAlex Crichton-4/+5
* vec::raw::to_ptr is gone * Pausible => Pausable * Removing @ * Calling the main task "<main>" * Removing unused imports * Removing unused mut * Bringing some libextra tests up to date * Allowing compiletest to work at stage0 * Fixing the bootstrap-from-c rmake tests * assert => rtassert in a few cases * printing to stderr instead of stdout in fail!()
2013-12-19Rename pkgid to crate_idCorey Richardson-3/+3
Closes #11035
2013-12-14Fix #10754 - `std::run` functions fail after io_errorCadence Marseille-6/+8
The problem was that std::run::Process::new() was unwrap()ing the result of std::io::process::Process::new(), which returns None in the case where the io_error condition is raised to signal failure to start the process. Have std::run::Process::new() similarly return an Option<run::Process> to reflect the fact that a subprocess might have failed to start. Update utility functions run::process_status() and run::process_output() to return Option<ProcessExit> and Option<ProcessOutput>, respectively. Various parts of librustc and librustpkg needed to be updated to reflect these API changes. closes #10754
2013-12-10Make crate hash stable and externally computable.Jack Moffitt-45/+47
This replaces the link meta attributes with a pkgid attribute and uses a hash of this as the crate hash. This makes the crate hash computable by things other than the Rust compiler. It also switches the hash function ot SHA1 since that is much more likely to be available in shell, Python, etc than SipHash. Fixes #10188, #8523.
2013-12-06auto merge of #10364 : Kimundi/rust/result_compose, r=alexcrichtonbors-1/+1
This implements parts of the changes to `Result` and `Option` I proposed and discussed in this thread: https://mail.mozilla.org/pipermail/rust-dev/2013-November/006254.html This PR includes: - Adding `ok()` and `err()` option adapters for both `Result` variants. - Removing `get_ref`, `expect` and iterator constructors for `Result`, as they are reachable with the variant adapters. - Removing `Result`s `ToStr` bound on the error type because of composability issues. (See https://mail.mozilla.org/pipermail/rust-dev/2013-November/006283.html) - Some warning cleanups
2013-12-06Link rustllvm statically, and distribute a static snapshotAlex Crichton-0/+1
In order to keep up to date with changes to the libraries that `llvm-config` spits out, the dependencies to the LLVM are a dynamically generated rust file. This file is now automatically updated whenever LLVM is updated to get kept up-to-date. At the same time, this cleans out some old cruft which isn't necessary in the makefiles in terms of dependencies. Closes #10745 Closes #10744
2013-12-06Made Results API more composableMarvin Löbel-1/+1
2013-12-04Revert "libstd: Change `Path::new` to `Path::init`."Kevin Ballard-45/+45
This reverts commit c54427ddfbbab41a39d14f2b1dc4f080cbc2d41b. Leave the #[ignores] in that were added to rustpkg tests. Conflicts: src/librustc/driver/driver.rs src/librustc/metadata/creader.rs
2013-12-04std::str: s/from_utf8_slice/from_utf8/, to make the basic case shorter.Huon Wilson-16/+16
2013-12-04std::str: remove from_utf8.Huon Wilson-17/+17
This function had type &[u8] -> ~str, i.e. it allocates a string internally, even though the non-allocating version that take &[u8] -> &str and ~[u8] -> ~str are all that is necessary in most circumstances.
2013-11-29Add generation of static libraries to rustcAlex Crichton-1/+3
This commit implements the support necessary for generating both intermediate and result static rust libraries. This is an implementation of my thoughts in https://mail.mozilla.org/pipermail/rust-dev/2013-November/006686.html. When compiling a library, we still retain the "lib" option, although now there are "rlib", "staticlib", and "dylib" as options for crate_type (and these are stackable). The idea of "lib" is to generate the "compiler default" instead of having too choose (although all are interchangeable). For now I have left the "complier default" to be a dynamic library for size reasons. Of the rust libraries, lib{std,extra,rustuv} will bootstrap with an rlib/dylib pair, but lib{rustc,syntax,rustdoc,rustpkg} will only be built as a dynamic object. I chose this for size reasons, but also because you're probably not going to be embedding the rustc compiler anywhere any time soon. Other than the options outlined above, there are a few defaults/preferences that are now opinionated in the compiler: * If both a .dylib and .rlib are found for a rust library, the compiler will prefer the .rlib variant. This is overridable via the -Z prefer-dynamic option * If generating a "lib", the compiler will generate a dynamic library. This is overridable by explicitly saying what flavor you'd like (rlib, staticlib, dylib). * If no options are passed to the command line, and no crate_type is found in the destination crate, then an executable is generated With this change, you can successfully build a rust program with 0 dynamic dependencies on rust libraries. There is still a dynamic dependency on librustrt, but I plan on removing that in a subsequent commit. This change includes no tests just yet. Our current testing infrastructure/harnesses aren't very amenable to doing flavorful things with linking, so I'm planning on adding a new mode of testing which I believe belongs as a separate commit. Closes #552
2013-11-29libstd: Change `Path::new` to `Path::init`.Patrick Walton-45/+49
2013-11-28Register new snapshotsAlex Crichton-14/+14
2013-11-26test: Remove all remaining non-procedure uses of `do`.Patrick Walton-1/+1
2013-11-26librustc: Remove non-procedure uses of `do` from librustc, librustdoc,Patrick Walton-12/+10
and librustpkg.
2013-11-26Removed unneccessary `_iter` suffixes from various APIsMarvin Löbel-2/+2
2013-11-12rustpkg: Eliminate the spurious ↵Tim Chevalier-15/+49
`os::path_exists(&pkg_src.start_dir.join(p))` assertion failure This addresses the problem reported in #10253 and possibly elsewhere. Closes #10253
2013-11-11Move std::rt::io to std::ioAlex Crichton-5/+5
2013-11-12Implemented a ProcessExit enum and helper methods to std::rt::io::process ↵Matthew Iselin-21/+28
for getting process termination status, or the signal that terminated a process. A test has been added to rtio-processes.rs to ensure signal termination is picked up correctly.
2013-11-11Remove #[fixed_stack_segment] and #[rust_stack]Alex Crichton-3/+3
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-08rustpkg: Add a test that `rustpkg install` doesn't copy a non-changed fileTim Chevalier-0/+18
This bug was already fixed, just needed a test. Closes #9569
2013-11-04Allow --cfg on rustpkg testSteven Fackler-0/+13
Closes #10238
2013-11-04auto merge of #10179 : alexcrichton/rust/rt-improvements, r=cmrbors-129/+103
This fleshes out the io::file module a fair bit more, adding all of the functionality that I can think of that we would want. Some questions about the representation which I'm curious about: * I modified `FileStat` to be a little less platform-agnostic, but it's still fairly platform-specific. I don't want to hide information that we have, but I don't want to depend on this information being available. One possible route is to have an `extra` field which has all this os-dependent stuff which is clearly documented as it should be avoided. * Does it make sense for directory functions to be top-level functions instead of static methods? It seems silly to import `std::rt::io::file` and `std::rt::io::File` at the top of files that need to deal with directories and files.
2013-11-04Move io::file to io::fs and fns out of FileAlex Crichton-37/+37
This renames the `file` module to `fs` because that more accurately describes its current purpose (manipulating the filesystem, not just files). Additionally, this adds an UnstableFileStat structure as a nested structure of FileStat to signify that the fields should not be depended on. The structure is currently flagged with #[unstable], but it's unlikely that it has much meaning. Closes #10241
2013-11-03Ensure rustpkg test fails if tests failedSteven Fackler-0/+15
It previously set the exit status, but the main wrapper paved over that with an exit code of 0. Closes #9761
2013-11-03Fill out the remaining functionality in io::fileAlex Crichton-23/+12
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-123/+108
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-10-28auto merge of #10110 : catamorphism/rust/rustpkg-dependency-build-dir, ↵bors-0/+24
r=metajack r? @metajack When invoked with the --rust-path-hack flag, rustpkg was correctly building the package into the default workspace (and not into the build/ subdirectory of the parent directory of the source directory), but not correctly putting the output for any dependencies into the default workspace as well. Spotted by Jack.
2013-10-28Allow fail messages to be caught, and introduce the Any traitMarvin Löbel-3/+2
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>`.