about summary refs log tree commit diff
path: root/src/librustpkg/tests.rs
AgeCommit message (Collapse)AuthorLines
2013-10-27rustpkg: Build dependencies into the correct workspace when using ↵Tim Chevalier-0/+24
--rust-path-hack 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-24Another round of test fixes and merge conflictsAlex Crichton-7/+12
2013-10-22rustpkg: Support arbitrary dependencies in the install APITim Chevalier-12/+109
api::install_pkg now accepts an argument that's a list of (kind, path) dependency pairs. This allows custom package scripts to declare C dependencies, as is demonstrated in rustpkg::tests::test_c_dependency_ok. Closes #6403
2013-10-22Drop the '2' suffix from logging macrosAlex Crichton-96/+96
Who doesn't like a massive renaming?
2013-10-21rustpkg: Search for crates in the current directoryTim Chevalier-2/+57
As per #8520, find crates in the current working directory even if it's not a workspace. Closes #8520
2013-10-18rustpkg: invoke touch with a portable set of argsTim Chevalier-1/+3
2013-10-18rustc: Check that the output file is writeable before linkingTim Chevalier-1/+1
This is because on Linux, the linker will silently overwrite a read-only file.
2013-10-18rustpkg: Make rustpkg tests stop comparing datesTim Chevalier-27/+51
Instead of scrutinizing modification times in rustpkg tests, change output files to be read-only and detect attempts to write to them (hack suggested by Jack). This avoids time granularity problems. As part of this change, I discovered that some dependencies weren't getting written correctly (involving built executables and library files), so this patch fixes that too. This partly addresses #9441, but one test (test_rebuild_when_needed) is still ignored on Linux.
2013-10-16Implement new methods vec.starts_with()/vec.ends_with()Kevin Ballard-6/+2
2013-10-16path2: Update for latest masterKevin Ballard-17/+20
Also fix some issues that crept into earlier commits during the conflict resoution for the rebase.
2013-10-16path2: Update based on more review feedbackKevin Ballard-2/+2
Standardize the is_sep() functions to be the same in both posix and windows, and re-export from path. Update extra::glob to use this. Remove the usage of either, as it's going away. Move the WindowsPath-specific methods out of WindowsPath and make them top-level functions of path::windows instead. This way you cannot accidentally write code that will fail to compile on non-windows architectures without typing ::windows anywhere. Remove GenericPath::from_c_str() and just impl BytesContainer for CString instead. Remove .join_path() and .push_path() and just implement BytesContainer for Path instead. Remove FilenameDisplay and add a boolean flag to Display instead. Remove .each_parent(). It only had one caller, so just inline its definition there.
2013-10-15path2: Adjust the API to remove all the _str mutation methodsKevin Ballard-189/+185
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-333/+424
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-11rustpkg: Set exit codes properly and make tests take advantage of thatTim Chevalier-20/+54
When I started writing the rustpkg tests, task failure didn't set the exit code properly. But bblum's work from July fixed that. Hooray! I just didn't know about it till now. So, now rustpkg uses exit codes in a more conventional way, and some of the tests are simpler. The bigger issue will be to make task failure propagate the error message. Right now, rustpkg does most of the work in separate tasks, which means if a task fails, rustpkg can't distinguish between different types of failure (see #3408)
2013-10-11extra::tempfile: replace mkdtemp with an RAII wrapperBenjamin Herr-262/+331
this incidentally stops `make check` from leaving directories in `/tmp`
2013-10-10rustpkg: Make checked-out source files read-only, and overhaul where ↵Tim Chevalier-41/+140
temporary files are stored rustpkg now makes source files that it checks out automatically read-only, and stores them under build/. Also, refactored the `PkgSrc` type to keep track of separate source and destination workspaces, as well as to have a `build_workspace` method that returns the workspace to put temporary files in (usually the source, sometimes the destination -- see comments for more details). Closes #6480
2013-10-09option: rewrite the API to use compositionDaniel Micay-5/+5
2013-09-30rustpkg: Remove uses of fmt!Alex Crichton-101/+104
2013-09-30rustpkg: Make test_rustpkg_test_output more permissiveTim Chevalier-3/+5
test output may contain color codes, so check for several small strings instead of one big one.
2013-09-27rustpkg: Implement `rustpkg test`Tim Chevalier-12/+67
Towards #7401
2013-09-25rustpkg: Search for packages correctly when using the rust_path_hackTim Chevalier-1/+38
Previously, any package would match any other package ID when searching using the rust_path_hack, so long as the directory had one or more crate files in it. Now, rustpkg checks that the parent directory matches the package ID. Closes #9273
2013-09-23auto merge of #9310 : pcwalton/rust/at-fn, r=pcwaltonbors-2/+5
r? @brson
2013-09-23librustc: Fix merge fallout.Patrick Walton-2/+5
2013-09-23Ignore some rustpkg tests for nowAlex Crichton-0/+2
They're blocking a new snapshot and @catamorphism is on it.
2013-09-18rustpkg: Register correct dependencies for built and installed filesTim Chevalier-0/+53
as per #9112 Closes #9112
2013-09-18rustpkg: Make crates, not packages, the unit of rustpkg dependenciesTim Chevalier-44/+91
Treating a package as the thing that can have other packages depend on it, and depends on other packages, was wrong if a package has more than one crate. Now, rustpkg knows about dependencies between crates in the same package. This solves the problem reported in #7879 where rustpkg wrongly discovered a circular dependency between thhe package and itself, and recursed infinitely. Closes #7879
2013-09-17Ignore a test which is blocking a snapshotAlex Crichton-0/+1
@catamorphism says he has a fix coming soon, so I didn't allocate an issue for it. If it festers for more than a few days I'll open something up though.
2013-09-15rustpkg: CleanupTim Chevalier-59/+42
2013-09-14rustpkg: Always write a package_id attribute into the link metadataTim Chevalier-0/+49
For some reason, I thought it wasn't necessary to write the package_id attribute (which rustc's filesearch checks when searching for a package) if the package ID had a single component (like "foo") as opposed to multiple components (like "foo/bar/quux"). This meant that `extern mod quux = "an-awesome-library";` didn't work, even if an-awesome-library existed in the RUST_PATH. Fixed it.
2013-09-13Remove all usage of change_dir_lockedAlex Crichton-14/+13
While usage of change_dir_locked is synchronized against itself, it's not synchronized against other relative path usage, so I'm of the opinion that it just really doesn't help in running tests. In order to prevent the problems that have been cropping up, this completely removes the function. All existing tests (except one) using it have been moved to run-pass tests where they get their own process and don't need to be synchronized with anyone else. There is one now-ignored rustpkg test because when I moved it to a run-pass test apparently run-pass isn't set up to have 'extern mod rustc' (it ends up having linkage failures).
2013-09-13rustc/rustpkg: Use a target-specific subdirectory in build/ and lib/Tim Chevalier-11/+37
As per rustpkg.md, rustpkg now builds in a target-specific subdirectory of build/, and installs libraries into a target-specific subdirectory of lib. Closes #8672
2013-09-12rustpkg: Install to RUST_PATHTim Chevalier-0/+19
Install to the first directory in the RUST_PATH if the user set a RUST_PATH. In the case where RUST_PATH isn't set, the behavior remains unchanged. Closes #7402
2013-09-12rustpkg: Search RUST_PATH properly for dependencies, and add a test for ↵Tim Chevalier-0/+22
recursive dependencies Closes #8524
2013-09-12rustpkg: Support sub-package-IDsTim Chevalier-20/+51
Package IDs can now refer to a subdirectory of a particular source tree, and not just a top-level directory with a src/ directory as its parent. For example, referring to the package ID a/b/c/d , in workspace W, if W/src/a is a package, will build the sources for the package in a/b/c/d (and not other crates in W/src/a). Closes #6408
2013-09-10rustpkg: Pass command-line arguments to rustcTim Chevalier-6/+291
rustpkg now accepts most of rustc's command-line arguments and passes them along to rustc when building or installing. A few rarely-used arguments aren't implemented yet. rustpkg doesn't support flags that don't make sense with rustpkg (for example, --bin and --lib, which get inferred from crate file names). Closes #8522
2013-09-08rustpkg: Address review comments from JackTim Chevalier-10/+12
2013-09-08rustpkg: Use workcacheTim Chevalier-49/+46
rustpkg now uses the workcache library to avoid recompilation. Hooray!
2013-09-05Rename str::from_bytes to str::from_utf8, closes #8985Florian Hahn-11/+11
2013-09-04Update clients of path.rs to use new API.Felix S. Klock II-2/+2
In most cases this involved removing a ~str allocations or clones (yay), or coercing a ~str to a slice. In a few places, I had to bind an intermediate Path (e.g. path.pop() return values), so that it would live long enough to support the borrowed &str. And in a few places, where the code was actively using the property that the old API returned ~str's, I had to put in to_owned() or clone(); but in those cases, we're trading an allocation within the path.rs code for one in the client code, so they neutralize each other.
2013-08-30rustpkg: Allow package directories to appear in the RUST_PATHTim Chevalier-16/+195
This commit adds a rustpkg flag, --rust-path-hack, that allows rustpkg to *search* inside package directories if they appear in the RUST_PATH, while *building* libraries and executables into a different target directory. This behavior is hidden behind a flag because I believe we only want to support it temporarily, to make it easier to port servo to rustpkg. This commit also includes a fix for how rustpkg fetches sources from git repositories -- it uses a temporary directory as the target when invoking `git clone`, then moves that directory into the workspace if the clone was successful. (The old behavior was that when the `git clone` failed, the empty target directory would be left lying around anyway.)
2013-08-29Revert "auto merge of #8645 : alexcrichton/rust/issue-6436-run-non-blocking, ↵Brian Anderson-8/+6
r=brson" This reverts commit b8d1fa399402c71331aefd634d710004e00b73a6, reversing changes made to f22b4b169854c8a4ba86c16ee43327d6bcf94562. Conflicts: mk/rt.mk src/libuv
2013-08-27auto merge of #8645 : alexcrichton/rust/issue-6436-run-non-blocking, r=brsonbors-6/+8
This overhauls `std::run` to instead run on top of libuv. This is *not* in a mergeable state, I've been attempting to diagnose failures in the compiletest suite. I've managed to find a fair number of bugs so far, but I still don't seem to be done yet. Notable changes: * This requires upgrading libuv. From the discussion on #6567, I took libuv master from a few days ago, applied one patch to fix process spawning with multiple event loops in libuv, and pushed to my own fork * The build system for libuv has changed since we last used it. There's some extra checkout from a google build system which apparently does all the magic if you don't want to require autotools, and the google system just requires python. I updated the Makefile to get this build system and build libuv with it instead. This is untested on windows and arm, and both will probably need to see some improvement. * This required adding some pipe bindings to libuv as well. Currently the support is pretty simple and probably completely unsafe for pipes, but you at least get read/write methods. This is necessary for capturing output of processes. * I didn't redesign `std::run` at all, I simply tried to reimplement all the existing functionality on top of libuv. Some functions ended up dying, but nothing major. All uses of `std::run` in the compiler still work just fine. I'm not quite sure how the rest of the runtime deals with this, but I marked process structures as `no_send` because the waiting/waking up has to happen in the same event loop right now. If processes start migrating between event loops then very bad things can happen. This may be what threadsafe I/O would fix, and I would be more than willing to rebase on that if it lands first. Anyway, for now I wanted to put this up for review, I'm still investigating the corruption/deadlock bugs, but this is in an *almost* workable state. Once I find the bugs I'll also rebase on the current master.
2013-08-27Implement process bindings to libuvAlex Crichton-6/+8
Closes #6436
2013-08-27Handle `rustpkg build`, etc. when given no args properlyKevin Ballard-3/+6
`rustpkg build` et al were only checking one directory up to see if it was in a dir named "src". Ditch that entirely and instead check if the cwd is descended from any of the workspace paths. Besides being more intelligent about whether or not something is a workspace, this also allows for package ids composed of multiple path components.
2013-08-27auto merge of #8792 : adridu59/rust/master, r=catamorphismbors-5/+4
`target_library_in_workspace` is imported but unused: ~/rust/src/librustpkg/tests.rs:21:48: 21:75 warning: unused import [-W unused-imports (default)]
2013-08-27librustpkg/tests.rs: cleanup unused importAdrien Tétar-5/+4
2013-08-26rustpkg: Test that different copies of the same package ID can exist in ↵Tim Chevalier-3/+28
multiple workspaces The test checks that rustpkg uses the first one, rather than complaining about multiple matches. Closes #7241
2013-08-22Suppress a broken test. Issue #8690.Michael Sullivan-0/+1
2013-08-21rustpkg: Add test for #7348. Closes #7348Tim Chevalier-0/+12
2013-08-21rustpkg: Re-enable some more testsTim Chevalier-21/+22