use std::fs::{self, File};
use std::io::Write;
-#[test]
+#[cargo_test]
fn depend_on_alt_registry() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn depend_on_alt_registry_depends_on_same_registry_no_index() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn depend_on_alt_registry_depends_on_same_registry() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn depend_on_alt_registry_depends_on_crates_io() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn registry_and_path_dep_works() {
registry::init();
.run();
}
-#[test]
+#[cargo_test]
fn registry_incompatible_with_git() {
registry::init();
.run();
}
-#[test]
+#[cargo_test]
fn cannot_publish_to_crates_io_with_registry_dependency() {
let fakeio_path = paths::root().join("fake.io");
let fakeio_url = fakeio_path.to_url().unwrap();
.run();
}
-#[test]
+#[cargo_test]
fn publish_with_registry_dependency() {
let p = project()
.file(
);
}
-#[test]
+#[cargo_test]
fn alt_registry_and_crates_io_deps() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn block_publish_due_to_no_token() {
let p = project().file("src/main.rs", "fn main() {}").build();
.run();
}
-#[test]
+#[cargo_test]
fn publish_to_alt_registry() {
let p = project().file("src/main.rs", "fn main() {}").build();
);
}
-#[test]
+#[cargo_test]
fn publish_with_crates_io_dep() {
let p = project()
.file(
);
}
-#[test]
+#[cargo_test]
fn passwords_in_registry_index_url_forbidden() {
registry::init();
.run();
}
-#[test]
+#[cargo_test]
fn passwords_in_registries_index_url_forbidden() {
registry::init();
.run();
}
-#[test]
+#[cargo_test]
fn patch_alt_reg() {
Package::new("bar", "0.1.0").publish();
let p = project()
.run();
}
-#[test]
+#[cargo_test]
fn bad_registry_name() {
let p = project()
.file(
}
}
-#[test]
+#[cargo_test]
fn no_api() {
Package::new("bar", "0.0.1").alternative(true).publish();
// Configure without `api`.
.run();
}
-#[test]
+#[cargo_test]
fn alt_reg_metadata() {
// Check for "registry" entries in `cargo metadata` with alternative registries.
let p = project()
.run();
}
-#[test]
+#[cargo_test]
fn unknown_registry() {
// A known registry refers to an unknown registry.
// foo -> bar(crates.io) -> baz(alt)
.run();
}
-#[test]
+#[cargo_test]
fn registries_index_relative_url() {
let config = paths::root().join(".cargo/config");
fs::create_dir_all(config.parent().unwrap()).unwrap();
.run();
}
-#[test]
+#[cargo_test]
fn registry_index_relative_url() {
let config = paths::root().join(".cargo/config");
fs::create_dir_all(config.parent().unwrap()).unwrap();
.run();
}
-#[test]
+#[cargo_test]
fn registries_index_relative_path_not_allowed() {
let config = paths::root().join(".cargo/config");
fs::create_dir_all(config.parent().unwrap()).unwrap();
use crate::support::registry::Package;
use crate::support::{basic_manifest, project};
-#[test]
+#[cargo_test]
fn bad1() {
let p = project()
.file("src/lib.rs", "")
.run();
}
-#[test]
+#[cargo_test]
fn bad2() {
let p = project()
.file("src/lib.rs", "")
.run();
}
-#[test]
+#[cargo_test]
fn bad3() {
let p = project()
.file("src/lib.rs", "")
.run();
}
-#[test]
+#[cargo_test]
fn bad4() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn bad6() {
let p = project()
.file("src/lib.rs", "")
.run();
}
-#[test]
+#[cargo_test]
fn bad_cargo_config_jobs() {
let p = project()
.file("src/lib.rs", "")
.run();
}
-#[test]
+#[cargo_test]
fn default_cargo_config_jobs() {
let p = project()
.file("src/lib.rs", "")
p.cargo("build -v").run();
}
-#[test]
+#[cargo_test]
fn good_cargo_config_jobs() {
let p = project()
.file("src/lib.rs", "")
p.cargo("build -v").run();
}
-#[test]
+#[cargo_test]
fn invalid_global_config() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn bad_cargo_lock() {
let p = project()
.file("Cargo.lock", "[[package]]\nfoo = 92")
.run();
}
-#[test]
+#[cargo_test]
fn duplicate_packages_in_cargo_lock() {
Package::new("bar", "0.1.0").publish();
.run();
}
-#[test]
+#[cargo_test]
fn bad_source_in_cargo_lock() {
Package::new("bar", "0.1.0").publish();
.run();
}
-#[test]
+#[cargo_test]
fn bad_dependency_in_lockfile() {
let p = project()
.file("src/lib.rs", "")
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn bad_git_dependency() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn bad_crate_type() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn malformed_override() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn duplicate_binary_names() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn duplicate_example_names() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn duplicate_bench_names() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn duplicate_deps() {
let p = project()
.file("shim-bar/Cargo.toml", &basic_manifest("bar", "0.0.1"))
.run();
}
-#[test]
+#[cargo_test]
fn duplicate_deps_diff_sources() {
let p = project()
.file("shim-bar/Cargo.toml", &basic_manifest("bar", "0.0.1"))
.run();
}
-#[test]
+#[cargo_test]
fn unused_keys() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn unused_keys_in_virtual_manifest() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn empty_dependencies() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn invalid_toml_historically_allowed_is_warned() {
let p = project()
.file(".cargo/config", "[bar] baz = 2")
.run();
}
-#[test]
+#[cargo_test]
fn ambiguous_git_reference() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn bad_source_config1() {
let p = project()
.file("src/lib.rs", "")
.run();
}
-#[test]
+#[cargo_test]
fn bad_source_config2() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn bad_source_config3() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn bad_source_config4() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn bad_source_config5() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn both_git_and_path_specified() {
let foo = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn bad_source_config6() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn ignored_git_revision() {
let foo = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn bad_source_config7() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn bad_dependency() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn bad_debuginfo() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn bad_opt_level() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn warn_semver_metadata() {
Package::new("bar", "1.0.0").publish();
let p = project()
.run();
}
-#[test]
+#[cargo_test]
fn bench_dir_containing_cargo_toml() {
assert_not_a_cargo_toml("bench", "foo");
}
-#[test]
+#[cargo_test]
fn bench_dir_plus_file() {
assert_not_a_cargo_toml("bench", "foo/bar");
}
-#[test]
+#[cargo_test]
fn bench_dir_plus_path() {
assert_not_a_cargo_toml("bench", "foo/bar/baz");
}
-#[test]
+#[cargo_test]
fn bench_dir_to_nonexistent_cargo_toml() {
assert_cargo_toml_doesnt_exist("bench", "foo/bar/baz/Cargo.toml");
}
-#[test]
+#[cargo_test]
fn build_dir_containing_cargo_toml() {
assert_not_a_cargo_toml("build", "foo");
}
-#[test]
+#[cargo_test]
fn build_dir_plus_file() {
assert_not_a_cargo_toml("bench", "foo/bar");
}
-#[test]
+#[cargo_test]
fn build_dir_plus_path() {
assert_not_a_cargo_toml("bench", "foo/bar/baz");
}
-#[test]
+#[cargo_test]
fn build_dir_to_nonexistent_cargo_toml() {
assert_cargo_toml_doesnt_exist("build", "foo/bar/baz/Cargo.toml");
}
-#[test]
+#[cargo_test]
fn clean_dir_containing_cargo_toml() {
assert_not_a_cargo_toml("clean", "foo");
}
-#[test]
+#[cargo_test]
fn clean_dir_plus_file() {
assert_not_a_cargo_toml("clean", "foo/bar");
}
-#[test]
+#[cargo_test]
fn clean_dir_plus_path() {
assert_not_a_cargo_toml("clean", "foo/bar/baz");
}
-#[test]
+#[cargo_test]
fn clean_dir_to_nonexistent_cargo_toml() {
assert_cargo_toml_doesnt_exist("clean", "foo/bar/baz/Cargo.toml");
}
-#[test]
+#[cargo_test]
fn doc_dir_containing_cargo_toml() {
assert_not_a_cargo_toml("doc", "foo");
}
-#[test]
+#[cargo_test]
fn doc_dir_plus_file() {
assert_not_a_cargo_toml("doc", "foo/bar");
}
-#[test]
+#[cargo_test]
fn doc_dir_plus_path() {
assert_not_a_cargo_toml("doc", "foo/bar/baz");
}
-#[test]
+#[cargo_test]
fn doc_dir_to_nonexistent_cargo_toml() {
assert_cargo_toml_doesnt_exist("doc", "foo/bar/baz/Cargo.toml");
}
-#[test]
+#[cargo_test]
fn fetch_dir_containing_cargo_toml() {
assert_not_a_cargo_toml("fetch", "foo");
}
-#[test]
+#[cargo_test]
fn fetch_dir_plus_file() {
assert_not_a_cargo_toml("fetch", "foo/bar");
}
-#[test]
+#[cargo_test]
fn fetch_dir_plus_path() {
assert_not_a_cargo_toml("fetch", "foo/bar/baz");
}
-#[test]
+#[cargo_test]
fn fetch_dir_to_nonexistent_cargo_toml() {
assert_cargo_toml_doesnt_exist("fetch", "foo/bar/baz/Cargo.toml");
}
-#[test]
+#[cargo_test]
fn generate_lockfile_dir_containing_cargo_toml() {
assert_not_a_cargo_toml("generate-lockfile", "foo");
}
-#[test]
+#[cargo_test]
fn generate_lockfile_dir_plus_file() {
assert_not_a_cargo_toml("generate-lockfile", "foo/bar");
}
-#[test]
+#[cargo_test]
fn generate_lockfile_dir_plus_path() {
assert_not_a_cargo_toml("generate-lockfile", "foo/bar/baz");
}
-#[test]
+#[cargo_test]
fn generate_lockfile_dir_to_nonexistent_cargo_toml() {
assert_cargo_toml_doesnt_exist("generate-lockfile", "foo/bar/baz/Cargo.toml");
}
-#[test]
+#[cargo_test]
fn package_dir_containing_cargo_toml() {
assert_not_a_cargo_toml("package", "foo");
}
-#[test]
+#[cargo_test]
fn package_dir_plus_file() {
assert_not_a_cargo_toml("package", "foo/bar");
}
-#[test]
+#[cargo_test]
fn package_dir_plus_path() {
assert_not_a_cargo_toml("package", "foo/bar/baz");
}
-#[test]
+#[cargo_test]
fn package_dir_to_nonexistent_cargo_toml() {
assert_cargo_toml_doesnt_exist("package", "foo/bar/baz/Cargo.toml");
}
-#[test]
+#[cargo_test]
fn pkgid_dir_containing_cargo_toml() {
assert_not_a_cargo_toml("pkgid", "foo");
}
-#[test]
+#[cargo_test]
fn pkgid_dir_plus_file() {
assert_not_a_cargo_toml("pkgid", "foo/bar");
}
-#[test]
+#[cargo_test]
fn pkgid_dir_plus_path() {
assert_not_a_cargo_toml("pkgid", "foo/bar/baz");
}
-#[test]
+#[cargo_test]
fn pkgid_dir_to_nonexistent_cargo_toml() {
assert_cargo_toml_doesnt_exist("pkgid", "foo/bar/baz/Cargo.toml");
}
-#[test]
+#[cargo_test]
fn publish_dir_containing_cargo_toml() {
assert_not_a_cargo_toml("publish", "foo");
}
-#[test]
+#[cargo_test]
fn publish_dir_plus_file() {
assert_not_a_cargo_toml("publish", "foo/bar");
}
-#[test]
+#[cargo_test]
fn publish_dir_plus_path() {
assert_not_a_cargo_toml("publish", "foo/bar/baz");
}
-#[test]
+#[cargo_test]
fn publish_dir_to_nonexistent_cargo_toml() {
assert_cargo_toml_doesnt_exist("publish", "foo/bar/baz/Cargo.toml");
}
-#[test]
+#[cargo_test]
fn read_manifest_dir_containing_cargo_toml() {
assert_not_a_cargo_toml("read-manifest", "foo");
}
-#[test]
+#[cargo_test]
fn read_manifest_dir_plus_file() {
assert_not_a_cargo_toml("read-manifest", "foo/bar");
}
-#[test]
+#[cargo_test]
fn read_manifest_dir_plus_path() {
assert_not_a_cargo_toml("read-manifest", "foo/bar/baz");
}
-#[test]
+#[cargo_test]
fn read_manifest_dir_to_nonexistent_cargo_toml() {
assert_cargo_toml_doesnt_exist("read-manifest", "foo/bar/baz/Cargo.toml");
}
-#[test]
+#[cargo_test]
fn run_dir_containing_cargo_toml() {
assert_not_a_cargo_toml("run", "foo");
}
-#[test]
+#[cargo_test]
fn run_dir_plus_file() {
assert_not_a_cargo_toml("run", "foo/bar");
}
-#[test]
+#[cargo_test]
fn run_dir_plus_path() {
assert_not_a_cargo_toml("run", "foo/bar/baz");
}
-#[test]
+#[cargo_test]
fn run_dir_to_nonexistent_cargo_toml() {
assert_cargo_toml_doesnt_exist("run", "foo/bar/baz/Cargo.toml");
}
-#[test]
+#[cargo_test]
fn rustc_dir_containing_cargo_toml() {
assert_not_a_cargo_toml("rustc", "foo");
}
-#[test]
+#[cargo_test]
fn rustc_dir_plus_file() {
assert_not_a_cargo_toml("rustc", "foo/bar");
}
-#[test]
+#[cargo_test]
fn rustc_dir_plus_path() {
assert_not_a_cargo_toml("rustc", "foo/bar/baz");
}
-#[test]
+#[cargo_test]
fn rustc_dir_to_nonexistent_cargo_toml() {
assert_cargo_toml_doesnt_exist("rustc", "foo/bar/baz/Cargo.toml");
}
-#[test]
+#[cargo_test]
fn test_dir_containing_cargo_toml() {
assert_not_a_cargo_toml("test", "foo");
}
-#[test]
+#[cargo_test]
fn test_dir_plus_file() {
assert_not_a_cargo_toml("test", "foo/bar");
}
-#[test]
+#[cargo_test]
fn test_dir_plus_path() {
assert_not_a_cargo_toml("test", "foo/bar/baz");
}
-#[test]
+#[cargo_test]
fn test_dir_to_nonexistent_cargo_toml() {
assert_cargo_toml_doesnt_exist("test", "foo/bar/baz/Cargo.toml");
}
-#[test]
+#[cargo_test]
fn update_dir_containing_cargo_toml() {
assert_not_a_cargo_toml("update", "foo");
}
-#[test]
+#[cargo_test]
fn update_dir_plus_file() {
assert_not_a_cargo_toml("update", "foo/bar");
}
-#[test]
+#[cargo_test]
fn update_dir_plus_path() {
assert_not_a_cargo_toml("update", "foo/bar/baz");
}
-#[test]
+#[cargo_test]
fn update_dir_to_nonexistent_cargo_toml() {
assert_cargo_toml_doesnt_exist("update", "foo/bar/baz/Cargo.toml");
}
-#[test]
+#[cargo_test]
fn verify_project_dir_containing_cargo_toml() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn verify_project_dir_plus_file() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn verify_project_dir_plus_path() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn verify_project_dir_to_nonexistent_cargo_toml() {
let p = project().build();
p.cargo("verify-project --manifest-path foo/bar/baz/Cargo.toml")
use crate::support::paths::CargoPathExt;
use crate::support::{basic_bin_manifest, basic_lib_manifest, basic_manifest, project};
-#[test]
+#[cargo_test]
fn cargo_bench_simple() {
if !is_nightly() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn bench_bench_implicit() {
if !is_nightly() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn bench_bin_implicit() {
if !is_nightly() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn bench_tarname() {
if !is_nightly() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn bench_multiple_targets() {
if !is_nightly() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn cargo_bench_verbose() {
if !is_nightly() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn many_similar_names() {
if !is_nightly() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn cargo_bench_failing_test() {
if !is_nightly() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn bench_with_lib_dep() {
if !is_nightly() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn bench_with_deep_lib_dep() {
if !is_nightly() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn external_bench_explicit() {
if !is_nightly() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn external_bench_implicit() {
if !is_nightly() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn bench_autodiscover_2015() {
if !is_nightly() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn dont_run_examples() {
if !is_nightly() {
return;
p.cargo("bench").run();
}
-#[test]
+#[cargo_test]
fn pass_through_command_line() {
if !is_nightly() {
return;
// Regression test for running cargo-bench twice with
// tests in an rlib
-#[test]
+#[cargo_test]
fn cargo_bench_twice() {
if !is_nightly() {
return;
}
}
-#[test]
+#[cargo_test]
fn lib_bin_same_name() {
if !is_nightly() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn lib_with_standard_name() {
if !is_nightly() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn lib_with_standard_name2() {
if !is_nightly() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn bench_dylib() {
if !is_nightly() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn bench_twice_with_build_cmd() {
if !is_nightly() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn bench_with_examples() {
if !is_nightly() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn test_a_bench() {
if !is_nightly() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn test_bench_no_run() {
if !is_nightly() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn test_bench_no_fail_fast() {
if !is_nightly() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn test_bench_multiple_packages() {
if !is_nightly() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn bench_all_workspace() {
if !is_nightly() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn bench_all_exclude() {
if !is_nightly() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn bench_all_virtual_manifest() {
if !is_nightly() {
return;
}
// https://github.com/rust-lang/cargo/issues/4287
-#[test]
+#[cargo_test]
fn legacy_bench_name() {
if !is_nightly() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn bench_virtual_manifest_all_implied() {
if !is_nightly() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn json_artifact_includes_executable_for_benchmark() {
if !is_nightly() {
return;
use crate::support::{main_file, project, Execs};
use cargo::util::paths::dylib_path_envvar;
-#[test]
+#[cargo_test]
fn cargo_compile_simple() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
p.process(&p.bin("foo")).with_stdout("i am foo\n").run();
}
-#[test]
+#[cargo_test]
fn cargo_fail_with_no_stderr() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
/// Checks that the `CARGO_INCREMENTAL` environment variable results in
/// `rustc` getting `-C incremental` passed to it.
-#[test]
+#[cargo_test]
fn cargo_compile_incremental() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn incremental_profile() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn incremental_config() {
let p = project()
.file("src/main.rs", "fn main() {}")
.run();
}
-#[test]
+#[cargo_test]
fn cargo_compile_with_workspace_excluded() {
let p = project().file("src/main.rs", "fn main() {}").build();
.run();
}
-#[test]
+#[cargo_test]
fn cargo_compile_manifest_path() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
assert!(p.bin("foo").is_file());
}
-#[test]
+#[cargo_test]
fn cargo_compile_with_invalid_manifest() {
let p = project().file("Cargo.toml", "").build();
.run();
}
-#[test]
+#[cargo_test]
fn cargo_compile_with_invalid_manifest2() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn cargo_compile_with_invalid_manifest3() {
let p = project().file("src/Cargo.toml", "a = bar").build();
.run();
}
-#[test]
+#[cargo_test]
fn cargo_compile_duplicate_build_targets() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn cargo_compile_with_invalid_version() {
let p = project()
.file("Cargo.toml", &basic_manifest("foo", "1.0"))
.run();
}
-#[test]
+#[cargo_test]
fn cargo_compile_with_empty_package_name() {
let p = project()
.file("Cargo.toml", &basic_manifest("", "0.0.0"))
.run();
}
-#[test]
+#[cargo_test]
fn cargo_compile_with_invalid_package_name() {
let p = project()
.file("Cargo.toml", &basic_manifest("foo::bar", "0.0.0"))
.run();
}
-#[test]
+#[cargo_test]
fn cargo_compile_with_invalid_bin_target_name() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn cargo_compile_with_forbidden_bin_target_name() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn cargo_compile_with_bin_and_crate_type() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn cargo_compile_with_bin_and_proc() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn cargo_compile_with_invalid_lib_target_name() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn cargo_compile_with_invalid_non_numeric_dep_version() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn cargo_compile_without_manifest() {
let p = project().no_manifest().build();
.run();
}
-#[test]
+#[cargo_test]
fn cargo_compile_with_invalid_code() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
assert!(p.root().join("Cargo.lock").is_file());
}
-#[test]
+#[cargo_test]
fn cargo_compile_with_invalid_code_in_deps() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn cargo_compile_with_warnings_in_the_root_package() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn cargo_compile_with_warnings_in_a_dep_package() {
let p = project()
.file(
p.process(&p.bin("foo")).with_stdout("test passed\n").run();
}
-#[test]
+#[cargo_test]
fn cargo_compile_with_nested_deps_inferred() {
let p = project()
.file(
p.process(&p.bin("foo")).with_stdout("test passed\n").run();
}
-#[test]
+#[cargo_test]
fn cargo_compile_with_nested_deps_correct_bin() {
let p = project()
.file(
p.process(&p.bin("foo")).with_stdout("test passed\n").run();
}
-#[test]
+#[cargo_test]
fn cargo_compile_with_nested_deps_shorthand() {
let p = project()
.file(
p.process(&p.bin("foo")).with_stdout("test passed\n").run();
}
-#[test]
+#[cargo_test]
fn cargo_compile_with_nested_deps_longhand() {
let p = project()
.file(
// Check that Cargo gives a sensible error if a dependency can't be found
// because of a name mismatch.
-#[test]
+#[cargo_test]
fn cargo_compile_with_dep_name_mismatch() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn cargo_compile_with_filename() {
let p = project()
.file("src/lib.rs", "")
.run();
}
-#[test]
+#[cargo_test]
fn incompatible_dependencies() {
Package::new("bad", "0.1.0").publish();
Package::new("bad", "1.0.0").publish();
.run();
}
-#[test]
+#[cargo_test]
fn incompatible_dependencies_with_multi_semver() {
Package::new("bad", "1.0.0").publish();
Package::new("bad", "1.0.1").publish();
.run();
}
-#[test]
+#[cargo_test]
fn compile_path_dep_then_change_version() {
let p = project()
.file(
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn ignores_carriage_return_in_lockfile() {
let p = project()
.file("src/main.rs", r"mod a; fn main() {}")
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn cargo_default_env_metadata_env_var() {
// Ensure that path dep + dylib + env_var get metadata
// (even though path_dep + dylib should not)
.run();
}
-#[test]
+#[cargo_test]
fn crate_env_vars() {
let p = project()
.file(
p.cargo("test -v").run();
}
-#[test]
+#[cargo_test]
fn crate_authors_env_vars() {
let p = project()
.file(
p.cargo("test -v").run();
}
-#[test]
+#[cargo_test]
fn vv_prints_rustc_env_vars() {
let p = project()
.file(
}
// Regression test for #4277
-#[test]
+#[cargo_test]
fn crate_library_path_env_var() {
let p = project()
.file(
}
// Regression test for #4277
-#[test]
+#[cargo_test]
fn build_with_fake_libc_not_loading() {
let p = project()
.file("src/main.rs", "fn main() {}")
}
// this is testing that src/<pkg-name>.rs still works (for now)
-#[test]
+#[cargo_test]
fn many_crate_types_old_style_lib_location() {
let p = project()
.file(
assert!(p.root().join("target/debug").join(&fname).is_file());
}
-#[test]
+#[cargo_test]
fn many_crate_types_correct() {
let p = project()
.file(
assert!(p.root().join("target/debug").join(&fname).is_file());
}
-#[test]
+#[cargo_test]
fn self_dependency() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn ignore_broken_symlinks() {
// windows and symlinks don't currently agree that well
if cfg!(windows) {
p.process(&p.bin("foo")).with_stdout("i am foo\n").run();
}
-#[test]
+#[cargo_test]
fn missing_lib_and_bin() {
let p = project().build();
p.cargo("build")
.run();
}
-#[test]
+#[cargo_test]
fn lto_build() {
// FIXME: currently this hits a linker bug on 32-bit MSVC
if cfg!(all(target_env = "msvc", target_pointer_width = "32")) {
.run();
}
-#[test]
+#[cargo_test]
fn verbose_build() {
let p = project().file("src/lib.rs", "").build();
p.cargo("build -v")
.run();
}
-#[test]
+#[cargo_test]
fn verbose_release_build() {
let p = project().file("src/lib.rs", "").build();
p.cargo("build -v --release")
.run();
}
-#[test]
+#[cargo_test]
fn verbose_release_build_deps() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn explicit_examples() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn non_existing_example() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn non_existing_binary() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn legacy_binary_paths_warnings() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn implicit_examples() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn standard_build_no_ndebug() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
p.process(&p.bin("foo")).with_stdout("slow\n").run();
}
-#[test]
+#[cargo_test]
fn release_build_ndebug() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
p.process(&p.release_bin("foo")).with_stdout("fast\n").run();
}
-#[test]
+#[cargo_test]
fn inferred_main_bin() {
let p = project().file("src/main.rs", "fn main() {}").build();
p.process(&p.bin("foo")).run();
}
-#[test]
+#[cargo_test]
fn deletion_causes_failure() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn bad_cargo_toml_in_target_dir() {
let p = project()
.file("src/main.rs", "fn main() {}")
p.process(&p.bin("foo")).run();
}
-#[test]
+#[cargo_test]
fn lib_with_standard_name() {
let p = project()
.file("Cargo.toml", &basic_manifest("syntax", "0.0.1"))
.run();
}
-#[test]
+#[cargo_test]
fn simple_staticlib() {
let p = project()
.file(
p.cargo("build").env("CARGO_LOG", "nekoneko=trace").run();
}
-#[test]
+#[cargo_test]
fn staticlib_rlib_and_bin() {
let p = project()
.file(
p.cargo("build -v").run();
}
-#[test]
+#[cargo_test]
fn opt_out_of_bin() {
let p = project()
.file(
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn single_lib() {
let p = project()
.file(
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn freshness_ignores_excluded() {
let foo = project()
.file(
foo.cargo("build").with_stdout("").run();
}
-#[test]
+#[cargo_test]
fn rebuild_preserves_out_dir() {
let foo = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn dep_no_libs() {
let foo = project()
.file(
foo.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn recompile_space_in_name() {
let foo = project()
.file(
}
#[cfg(unix)]
-#[test]
+#[cargo_test]
fn ignore_bad_directories() {
use std::os::unix::prelude::*;
let foo = project()
fs::set_permissions(&dir, perms).unwrap();
}
-#[test]
+#[cargo_test]
fn bad_cargo_config() {
let foo = project()
.file("Cargo.toml", &basic_manifest("foo", "0.0.0"))
.run();
}
-#[test]
+#[cargo_test]
fn cargo_platform_specific_dependency() {
let host = rustc_host();
let p = project()
p.cargo("test").run();
}
-#[test]
+#[cargo_test]
fn bad_platform_specific_dependency() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn cargo_platform_specific_dependency_wrong_platform() {
let p = project()
.file(
assert!(lockfile.contains("bar"));
}
-#[test]
+#[cargo_test]
fn example_as_lib() {
let p = project()
.file(
assert!(p.example_lib("ex", "lib").is_file());
}
-#[test]
+#[cargo_test]
fn example_as_rlib() {
let p = project()
.file(
assert!(p.example_lib("ex", "rlib").is_file());
}
-#[test]
+#[cargo_test]
fn example_as_dylib() {
let p = project()
.file(
assert!(p.example_lib("ex", "dylib").is_file());
}
-#[test]
+#[cargo_test]
fn example_as_proc_macro() {
let p = project()
.file(
assert!(p.example_lib("ex", "proc-macro").is_file());
}
-#[test]
+#[cargo_test]
fn example_bin_same_name() {
let p = project()
.file("src/main.rs", "fn main() {}")
assert!(p.bin("examples/foo").is_file());
}
-#[test]
+#[cargo_test]
fn compile_then_delete() {
let p = project().file("src/main.rs", "fn main() {}").build();
p.cargo("run -v").run();
}
-#[test]
+#[cargo_test]
fn transitive_dependencies_not_available() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn cyclic_deps_rejected() {
let p = project()
.file(
).run();
}
-#[test]
+#[cargo_test]
fn predictable_filenames() {
let p = project()
.file(
assert!(p.root().join("target/debug").join(dylib_name).is_file());
}
-#[test]
+#[cargo_test]
fn dashes_to_underscores() {
let p = project()
.file("Cargo.toml", &basic_manifest("foo-bar", "0.0.1"))
assert!(p.bin("foo-bar").is_file());
}
-#[test]
+#[cargo_test]
fn dashes_in_crate_name_bad() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn rustc_env_var() {
let p = project().file("src/lib.rs", "").build();
assert!(!p.bin("a").is_file());
}
-#[test]
+#[cargo_test]
fn filtering() {
let p = project()
.file("src/lib.rs", "")
assert!(!p.bin("examples/b").is_file());
}
-#[test]
+#[cargo_test]
fn filtering_implicit_bins() {
let p = project()
.file("src/lib.rs", "")
assert!(!p.bin("examples/b").is_file());
}
-#[test]
+#[cargo_test]
fn filtering_implicit_examples() {
let p = project()
.file("src/lib.rs", "")
assert!(p.bin("examples/b").is_file());
}
-#[test]
+#[cargo_test]
fn ignore_dotfile() {
let p = project()
.file("src/bin/.a.rs", "")
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn ignore_dotdirs() {
let p = project()
.file("src/bin/a.rs", "fn main() {}")
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn dotdir_root() {
let p = ProjectBuilder::new(root().join(".foo"))
.file("src/bin/a.rs", "fn main() {}")
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn custom_target_dir_env() {
let p = project().file("src/main.rs", "fn main() {}").build();
assert!(p.root().join("target/debug").join(&exe_name).is_file());
}
-#[test]
+#[cargo_test]
fn custom_target_dir_line_parameter() {
let p = project().file("src/main.rs", "fn main() {}").build();
assert!(p.root().join("target/debug").join(&exe_name).is_file());
}
-#[test]
+#[cargo_test]
fn build_multiple_packages() {
let p = project()
.file(
p.process(d2_path).with_stdout("d2").run();
}
-#[test]
+#[cargo_test]
fn invalid_spec() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn manifest_with_bom_is_ok() {
let p = project()
.file(
p.cargo("build -v").run();
}
-#[test]
+#[cargo_test]
fn panic_abort_compiles_with_panic_abort() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn explicit_color_config_is_propagated_to_rustc() {
let p = project()
.file("Cargo.toml", &basic_manifest("test", "0.0.0"))
.run();
}
-#[test]
+#[cargo_test]
fn compiler_json_error_format() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn wrong_message_format_option() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn message_format_json_forward_stderr() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn no_warn_about_package_metadata() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn cargo_build_empty_target() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn build_all_workspace() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn build_all_exclude() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn build_all_workspace_implicit_examples() {
let p = project()
.file(
assert!(p.bin("examples/h").is_file());
}
-#[test]
+#[cargo_test]
fn build_all_virtual_manifest() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn build_virtual_manifest_all_implied() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn build_virtual_manifest_one_project() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn build_all_virtual_manifest_implicit_examples() {
let p = project()
.file(
assert!(p.bin("examples/h").is_file());
}
-#[test]
+#[cargo_test]
fn build_all_member_dependency_same_name() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn run_proper_binary() {
let p = project()
.file(
p.cargo("run --bin other").run();
}
-#[test]
+#[cargo_test]
fn run_proper_binary_main_rs() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
p.cargo("run --bin foo").run();
}
-#[test]
+#[cargo_test]
fn run_proper_alias_binary_from_src() {
let p = project()
.file(
p.process(&p.bin("bar")).with_stdout("bar\n").run();
}
-#[test]
+#[cargo_test]
fn run_proper_alias_binary_main_rs() {
let p = project()
.file(
p.process(&p.bin("bar")).with_stdout("main\n").run();
}
-#[test]
+#[cargo_test]
fn run_proper_binary_main_rs_as_foo() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
p.cargo("run --bin foo").run();
}
-#[test]
+#[cargo_test]
// NOTE: we don't have `/usr/bin/env` on Windows.
#[cfg(not(windows))]
fn rustc_wrapper() {
.run();
}
-#[test]
+#[cargo_test]
#[cfg(not(windows))]
fn rustc_wrapper_relative() {
let p = project().file("src/lib.rs", "").build();
.run();
}
-#[test]
+#[cargo_test]
#[cfg(not(windows))]
fn rustc_wrapper_from_path() {
let p = project().file("src/lib.rs", "").build();
.run();
}
-#[test]
+#[cargo_test]
fn cdylib_not_lifted() {
let p = project()
.file(
}
}
-#[test]
+#[cargo_test]
fn cdylib_final_outputs() {
let p = project()
.file(
}
}
-#[test]
+#[cargo_test]
fn deterministic_cfg_flags() {
// This bug is non-deterministic.
.run();
}
-#[test]
+#[cargo_test]
fn explicit_bins_without_paths() {
let p = project()
.file(
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn no_bin_in_src_with_lib() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn inferred_bins() {
let p = project()
.file("src/main.rs", "fn main() {}")
assert!(p.bin("baz").is_file());
}
-#[test]
+#[cargo_test]
fn inferred_bins_duplicate_name() {
// this should fail, because we have two binaries with the same name
let p = project()
.run();
}
-#[test]
+#[cargo_test]
fn inferred_bin_path() {
let p = project()
.file(
assert!(p.bin("bar").is_file());
}
-#[test]
+#[cargo_test]
fn inferred_examples() {
let p = project()
.file("src/lib.rs", "fn main() {}")
assert!(p.bin("examples/baz").is_file());
}
-#[test]
+#[cargo_test]
fn inferred_tests() {
let p = project()
.file("src/lib.rs", "fn main() {}")
p.cargo("test --test=bar --test=baz").run();
}
-#[test]
+#[cargo_test]
fn inferred_benchmarks() {
let p = project()
.file("src/lib.rs", "fn main() {}")
p.cargo("bench --bench=bar --bench=baz").run();
}
-#[test]
+#[cargo_test]
fn target_edition() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn target_edition_override() {
let p = project()
.file(
p.cargo("build -v").run();
}
-#[test]
+#[cargo_test]
fn same_metadata_different_directory() {
// A top-level crate built in two different workspaces should have the
// same metadata hash.
.run();
}
-#[test]
+#[cargo_test]
fn building_a_dependent_crate_witout_bin_should_fail() {
Package::new("testless", "0.1.0")
.file(
.run();
}
-#[test]
+#[cargo_test]
#[cfg(any(target_os = "macos", target_os = "ios"))]
fn uplift_dsym_of_bin_on_mac() {
let p = project()
assert!(!p.target_debug_dir().join("d.dSYM").exists());
}
-#[test]
+#[cargo_test]
#[cfg(all(target_os = "windows", target_env = "msvc"))]
fn uplift_pdb_of_bin_on_windows() {
let p = project()
// Ensure that `cargo build` chooses the correct profile for building
// targets based on filters (assuming `--profile` is not specified).
-#[test]
+#[cargo_test]
fn build_filter_infer_profile() {
let p = project()
.file("src/lib.rs", "")
.run();
}
-#[test]
+#[cargo_test]
fn targets_selected_default() {
let p = project().file("src/main.rs", "fn main() {}").build();
p.cargo("build -v")
.run();
}
-#[test]
+#[cargo_test]
fn targets_selected_all() {
let p = project().file("src/main.rs", "fn main() {}").build();
p.cargo("build -v --all-targets")
.run();
}
-#[test]
+#[cargo_test]
fn all_targets_no_lib() {
let p = project().file("src/main.rs", "fn main() {}").build();
p.cargo("build -v --all-targets")
.run();
}
-#[test]
+#[cargo_test]
fn no_linkable_target() {
// Issue 3169: this is currently not an error as per discussion in PR #4797.
let p = project()
.run();
}
-#[test]
+#[cargo_test]
fn avoid_dev_deps() {
Package::new("foo", "1.0.0").publish();
let p = project()
.run();
}
-#[test]
+#[cargo_test]
fn invalid_jobs() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn target_filters_workspace() {
let ws = project()
.at("ws")
.run();
}
-#[test]
+#[cargo_test]
fn target_filters_workspace_not_found() {
let ws = project()
.at("ws")
}
#[cfg(unix)]
-#[test]
+#[cargo_test]
fn signal_display() {
// Cause the compiler to crash with a signal.
let foo = project()
.run();
}
-#[test]
+#[cargo_test]
fn tricky_pipelining() {
if !crate::support::is_nightly() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn pipelining_works() {
if !crate::support::is_nightly() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn forward_rustc_output() {
let foo = project()
.file(
use git2;
// Tests that HTTP auth is offered from `credential.helper`.
-#[test]
+#[cargo_test]
fn http_auth_offered() {
let server = TcpListener::bind("127.0.0.1:0").unwrap();
let addr = server.local_addr().unwrap();
}
// Boy, sure would be nice to have a TLS implementation in rust!
-#[test]
+#[cargo_test]
fn https_something_happens() {
let server = TcpListener::bind("127.0.0.1:0").unwrap();
let addr = server.local_addr().unwrap();
}
// It would sure be nice to have an SSH implementation in Rust!
-#[test]
+#[cargo_test]
fn ssh_something_happens() {
let server = TcpListener::bind("127.0.0.1:0").unwrap();
let addr = server.local_addr().unwrap();
use crate::support::{basic_bin_manifest, basic_manifest, project};
-#[test]
+#[cargo_test]
fn build_lib_only() {
let p = project()
.file("src/main.rs", "fn main() {}")
.run();
}
-#[test]
+#[cargo_test]
fn build_with_no_lib() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn build_with_relative_cargo_home_path() {
let p = project()
.file(
use crate::support::registry::Package;
use crate::support::{basic_bin_manifest, basic_manifest, main_file, project};
-#[test]
+#[cargo_test]
fn cargo_build_plan_simple() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
assert!(!p.bin("foo").is_file());
}
-#[test]
+#[cargo_test]
fn cargo_build_plan_single_dep() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn cargo_build_plan_build_script() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn build_plan_with_dev_dep() {
Package::new("bar", "0.1.0").publish();
use crate::support::{rustc_host, sleep_ms, slow_cpu_multiplier};
use cargo::util::paths::remove_dir_all;
-#[test]
+#[cargo_test]
fn custom_build_script_failed() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn custom_build_env_vars() {
let p = project()
.file(
p.cargo("build --features bar_feat").run();
}
-#[test]
+#[cargo_test]
fn custom_build_env_var_rustc_linker() {
if cross_compile::disabled() {
return;
p.cargo("build --target").arg(&target).run();
}
-#[test]
+#[cargo_test]
fn custom_build_script_wrong_rustc_flags() {
let p = project()
.file(
}
/*
-#[test]
+#[cargo_test]
fn custom_build_script_rustc_flags() {
let p = project()
.file(
}
*/
-#[test]
+#[cargo_test]
fn links_no_build_cmd() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn links_duplicates() {
// this tests that the links_duplicates are caught at resolver time
let p = project()
").run();
}
-#[test]
+#[cargo_test]
fn links_duplicates_deep_dependency() {
// this tests that the links_duplicates are caught at resolver time
let p = project()
").run();
}
-#[test]
+#[cargo_test]
fn overrides_and_links() {
let target = rustc_host();
.run();
}
-#[test]
+#[cargo_test]
fn unused_overrides() {
let target = rustc_host();
p.cargo("build -v").run();
}
-#[test]
+#[cargo_test]
fn links_passes_env_vars() {
let p = project()
.file(
p.cargo("build -v").run();
}
-#[test]
+#[cargo_test]
fn only_rerun_build_script() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn rebuild_continues_to_pass_env_vars() {
let a = project()
.at("a")
p.cargo("build -v").run();
}
-#[test]
+#[cargo_test]
fn testing_and_such() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn propagation_of_l_flags() {
let target = rustc_host();
let p = project()
.run();
}
-#[test]
+#[cargo_test]
fn propagation_of_l_flags_new() {
let target = rustc_host();
let p = project()
.run();
}
-#[test]
+#[cargo_test]
fn build_deps_simple() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn build_deps_not_for_normal() {
let target = rustc_host();
let p = project()
.run();
}
-#[test]
+#[cargo_test]
fn build_cmd_with_a_build_cmd() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn out_dir_is_preserved() {
let p = project()
.file(
p.cargo("build -v").run();
}
-#[test]
+#[cargo_test]
fn output_separate_lines() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn output_separate_lines_new() {
let p = project()
.file(
}
#[cfg(not(windows))] // FIXME(#867)
-#[test]
+#[cargo_test]
fn code_generation() {
let p = project()
.file(
p.cargo("test").run();
}
-#[test]
+#[cargo_test]
fn release_with_build_script() {
let p = project()
.file(
p.cargo("build -v --release").run();
}
-#[test]
+#[cargo_test]
fn build_script_only() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn shared_dep_with_a_build_script() {
let p = project()
.file(
p.cargo("build -v").run();
}
-#[test]
+#[cargo_test]
fn transitive_dep_host() {
let p = project()
.file(
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn test_a_lib_with_a_build_command() {
let p = project()
.file(
p.cargo("test").run();
}
-#[test]
+#[cargo_test]
fn test_dev_dep_build_script() {
let p = project()
.file(
p.cargo("test").run();
}
-#[test]
+#[cargo_test]
fn build_script_with_dynamic_native_dependency() {
let build = project()
.at("builder")
.run();
}
-#[test]
+#[cargo_test]
fn profile_and_opt_level_set_correctly() {
let p = project()
.file(
p.cargo("bench").run();
}
-#[test]
+#[cargo_test]
fn profile_debug_0() {
let p = project()
.file(
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn build_script_with_lto() {
let p = project()
.file(
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn test_duplicate_deps() {
let p = project()
.file(
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn cfg_feedback() {
let p = project()
.file(
p.cargo("build -v").run();
}
-#[test]
+#[cargo_test]
fn cfg_override() {
let target = rustc_host();
p.cargo("build -v").run();
}
-#[test]
+#[cargo_test]
fn cfg_test() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn cfg_doc() {
let p = project()
.file(
assert!(p.root().join("target/doc/bar/fn.bar.html").is_file());
}
-#[test]
+#[cargo_test]
fn cfg_override_test() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn cfg_override_doc() {
let p = project()
.file(
assert!(p.root().join("target/doc/bar/fn.bar.html").is_file());
}
-#[test]
+#[cargo_test]
fn env_build() {
let p = project()
.file(
p.cargo("run -v").with_stdout("foo\n").run();
}
-#[test]
+#[cargo_test]
fn env_test() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn env_doc() {
let p = project()
.file(
p.cargo("doc -v").run();
}
-#[test]
+#[cargo_test]
fn flags_go_into_tests() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn diamond_passes_args_only_once() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn adding_an_override_invalidates() {
let target = rustc_host();
let p = project()
.run();
}
-#[test]
+#[cargo_test]
fn changing_an_override_invalidates() {
let target = rustc_host();
let p = project()
.run();
}
-#[test]
+#[cargo_test]
fn fresh_builds_possible_with_link_libs() {
// The bug is non-deterministic. Sometimes you can get a fresh build
let target = rustc_host();
.run();
}
-#[test]
+#[cargo_test]
fn fresh_builds_possible_with_multiple_metadata_overrides() {
// The bug is non-deterministic. Sometimes you can get a fresh build
let target = rustc_host();
.run();
}
-#[test]
+#[cargo_test]
fn rebuild_only_on_explicit_paths() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn doctest_receives_build_link_args() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn please_respect_the_dag() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn non_utf8_output() {
let p = project()
.file(
p.cargo("build -v").run();
}
-#[test]
+#[cargo_test]
fn custom_target_dir() {
let p = project()
.file(
p.cargo("build -v").run();
}
-#[test]
+#[cargo_test]
fn panic_abort_with_build_scripts() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn warnings_emitted() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn warnings_hidden_for_upstream() {
Package::new("bar", "0.1.0")
.file(
.run();
}
-#[test]
+#[cargo_test]
fn warnings_printed_on_vv() {
Package::new("bar", "0.1.0")
.file(
.run();
}
-#[test]
+#[cargo_test]
fn output_shows_on_vv() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn links_with_dots() {
let target = rustc_host();
.run();
}
-#[test]
+#[cargo_test]
fn rustc_and_rustdoc_set_correctly() {
let p = project()
.file(
p.cargo("bench").run();
}
-#[test]
+#[cargo_test]
fn cfg_env_vars_available() {
let p = project()
.file(
p.cargo("bench").run();
}
-#[test]
+#[cargo_test]
fn switch_features_rerun() {
let p = project()
.file(
p.rename_run("foo", "with_foo2").with_stdout("foo\n").run();
}
-#[test]
+#[cargo_test]
fn assume_build_script_when_build_rs_present() {
let p = project()
.file(
p.cargo("run -v").run();
}
-#[test]
+#[cargo_test]
fn if_build_set_to_false_dont_treat_build_rs_as_build_script() {
let p = project()
.file(
p.cargo("run -v").run();
}
-#[test]
+#[cargo_test]
fn deterministic_rustc_dependency_flags() {
// This bug is non-deterministic hence the large number of dependencies
// in the hopes it will have a much higher chance of triggering it.
.run();
}
-#[test]
+#[cargo_test]
fn links_duplicates_with_cycle() {
// this tests that the links_duplicates are caught at resolver time
let p = project()
").run();
}
-#[test]
+#[cargo_test]
fn rename_with_link_search_path() {
_rename_with_link_search_path(false);
}
-#[test]
+#[cargo_test]
fn rename_with_link_search_path_cross() {
if cross_compile::disabled() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn optional_build_script_dep() {
let p = project()
.file(
p.cargo("run --features bar").with_stdout("1\n").run();
}
-#[test]
+#[cargo_test]
fn optional_build_dep_and_required_normal_dep() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn using_rerun_if_changed_does_not_rebuild() {
let p = project()
.file(
p.cargo("build").with_stderr("[FINISHED] [..]").run();
}
-#[test]
+#[cargo_test]
fn links_interrupted_can_restart() {
// Test for a `links` dependent build script getting canceled and then
// restarted. Steps:
.run();
}
-#[test]
+#[cargo_test]
#[cfg(unix)]
fn build_script_scan_eacces() {
// build.rs causes a scan of the whole project, which can be a problem if
use crate::support::project;
use crate::support::sleep_ms;
-#[test]
+#[cargo_test]
fn rerun_if_env_changes() {
let p = project()
.file("src/main.rs", "fn main() {}")
.run();
}
-#[test]
+#[cargo_test]
fn rerun_if_env_or_file_changes() {
let p = project()
.file("src/main.rs", "fn main() {}")
std::str::from_utf8(bytes).expect("valid utf-8")
}
-#[test]
+#[cargo_test]
fn simple() {
if !is_nightly() {
// --json-rendered is unstable
assert!(cargo_output2.stdout.is_empty());
}
-#[test]
+#[cargo_test]
fn color() {
if !is_nightly() {
// --json-rendered is unstable
assert_eq!(rustc_nocolor, as_str(&cargo_output_nocolor.stderr));
}
-#[test]
+#[cargo_test]
fn cached_as_json() {
if !is_nightly() {
// --json-rendered is unstable
assert_eq!(fix_fresh, orig_cargo_out);
}
-#[test]
+#[cargo_test]
fn clears_cache_after_fix() {
if !is_nightly() {
// --json-rendered is unstable
.run();
}
-#[test]
+#[cargo_test]
fn rustdoc() {
if !is_nightly() {
// --json-rendered is unstable
assert_eq!(as_str(&rustdoc_output.stderr), rustdoc_stderr);
}
-#[test]
+#[cargo_test]
fn clippy() {
if !is_nightly() {
// --json-rendered is unstable
.run();
}
-#[test]
+#[cargo_test]
fn fix() {
if !is_nightly() {
// --json-rendered is unstable
assert_eq!(p.read_file("src/lib.rs"), "pub fn r#try() {}");
}
-#[test]
+#[cargo_test]
fn very_verbose() {
if !is_nightly() {
// --json-rendered is unstable
.run();
}
-#[test]
+#[cargo_test]
fn short_incompatible() {
let p = project().file("src/lib.rs", "").build();
p.cargo("check -Zcache-messages --message-format=short")
use crate::support::{basic_bin_manifest, project};
-#[test]
+#[cargo_test]
fn alias_incorrect_config_type() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn alias_config() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn recursive_alias() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn alias_list_test() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn alias_with_flags_config() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn alias_cannot_shadow_builtin_command() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn alias_override_builtin_alias() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn builtin_alias_takes_options() {
// #6381
let p = project()
env::split_paths(&env::var_os("PATH").unwrap_or_default()).collect()
}
-#[test]
+#[cargo_test]
fn list_commands_with_descriptions() {
let p = project().build();
p.cargo("--list")
.run();
}
-#[test]
+#[cargo_test]
fn list_command_looks_at_path() {
let proj = project().build();
let proj = fake_file(
// Windows and symlinks don't currently mix well.
#[cfg(unix)]
-#[test]
+#[cargo_test]
fn list_command_resolves_symlinks() {
let proj = project().build();
let proj = fake_file(
);
}
-#[test]
+#[cargo_test]
fn find_closest_biuld_to_build() {
cargo_process("biuld")
.with_status(101)
}
// If a subcommand is more than an edit distance of 3 away, we don't make a suggestion.
-#[test]
+#[cargo_test]
fn find_closest_dont_correct_nonsense() {
cargo_process("there-is-no-way-that-there-is-a-command-close-to-this")
.cwd(&paths::root())
.run();
}
-#[test]
+#[cargo_test]
fn displays_subcommand_on_error() {
cargo_process("invalid-command")
.with_status(101)
.run();
}
-#[test]
+#[cargo_test]
fn override_cargo_home() {
let root = paths::root();
let my_home = root.join("my_home");
assert!(contents.contains(r#"authors = ["foo <bar>"]"#));
}
-#[test]
+#[cargo_test]
fn cargo_subcommand_env() {
let src = format!(
r#"
.run();
}
-#[test]
+#[cargo_test]
fn cargo_subcommand_args() {
let p = project()
.at("cargo-foo")
.run();
}
-#[test]
+#[cargo_test]
fn cargo_help() {
cargo_process("").run();
cargo_process("help").run();
cargo_process("help help").run();
}
-#[test]
+#[cargo_test]
fn cargo_help_external_subcommand() {
Package::new("cargo-fake-help", "1.0.0")
.file(
.run();
}
-#[test]
+#[cargo_test]
fn explain() {
cargo_process("--explain E0001")
.with_stdout_contains(
// Test that the output of `cargo -Z help` shows a different help screen with
// all the `-Z` flags.
-#[test]
+#[cargo_test]
fn z_flags_help() {
cargo_process("-Z help")
.with_stdout_contains(
use crate::support::{project, registry};
-#[test]
+#[cargo_test]
fn feature_required() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn unknown_feature() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn stable_feature_warns() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn nightly_feature_requires_nightly() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn nightly_feature_requires_nightly_in_dep() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn cant_publish() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn z_flags_rejected() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn publish_allowed() {
registry::init();
);
}
-#[test]
+#[cargo_test]
fn cfg_syntax() {
good("foo", c!(foo));
good("_bar", c!(_bar));
good("foo = \"3 e\"", c!(foo = "3 e"));
}
-#[test]
+#[cargo_test]
fn cfg_syntax_bad() {
bad::<Cfg>("", "found nothing");
bad::<Cfg>(" ", "found nothing");
bad::<Cfg>("foo, bar", "malformed cfg value");
}
-#[test]
+#[cargo_test]
fn cfg_expr() {
good("foo", e!(foo));
good("_bar", e!(_bar));
good("not(all(a))", e!(not(all(a))));
}
-#[test]
+#[cargo_test]
fn cfg_expr_bad() {
bad::<CfgExpr>(" ", "found nothing");
bad::<CfgExpr>(" all", "expected `(`");
bad::<CfgExpr>("foo(a)", "consider using all() or any() explicitly");
}
-#[test]
+#[cargo_test]
fn cfg_matches() {
assert!(e!(foo).matches(&[c!(bar), c!(foo), c!(baz)]));
assert!(e!(any(foo)).matches(&[c!(bar), c!(foo), c!(baz)]));
assert!(!e!(any((not(foo)), (all(foo, bar)))).matches(&[c!(foo)]));
}
-#[test]
+#[cargo_test]
fn cfg_easy() {
let p = project()
.file(
p.cargo("build -v").run();
}
-#[test]
+#[cargo_test]
fn dont_include() {
let other_family = if cfg!(unix) { "windows" } else { "unix" };
let p = project()
.run();
}
-#[test]
+#[cargo_test]
fn works_through_the_registry() {
Package::new("baz", "0.1.0").publish();
Package::new("bar", "0.1.0")
.run();
}
-#[test]
+#[cargo_test]
fn ignore_version_from_other_platform() {
let this_family = if cfg!(unix) { "unix" } else { "windows" };
let other_family = if cfg!(unix) { "windows" } else { "unix" };
.run();
}
-#[test]
+#[cargo_test]
fn bad_target_spec() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn bad_target_spec2() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn multiple_match_ok() {
let p = project()
.file(
p.cargo("build -v").run();
}
-#[test]
+#[cargo_test]
fn any_ok() {
let p = project()
.file(
}
// https://github.com/rust-lang/cargo/issues/5313
-#[test]
+#[cargo_test]
#[cfg(all(target_arch = "x86_64", target_os = "linux", target_env = "gnu"))]
fn cfg_looks_at_rustflags_for_target() {
let p = project()
use crate::support::registry::Package;
use crate::support::{basic_manifest, project};
-#[test]
+#[cargo_test]
fn check_success() {
let foo = project()
.file(
foo.cargo("check").run();
}
-#[test]
+#[cargo_test]
fn check_fail() {
let foo = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn custom_derive() {
let foo = project()
.file(
foo.cargo("check").run();
}
-#[test]
+#[cargo_test]
fn check_build() {
let foo = project()
.file(
foo.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn build_check() {
let foo = project()
.file(
// Checks that where a project has both a lib and a bin, the lib is only checked
// not built.
-#[test]
+#[cargo_test]
fn issue_3418() {
let foo = project()
.file("src/lib.rs", "")
// Some weirdness that seems to be caused by a crate being built as well as
// checked, but in this case with a proc macro too.
-#[test]
+#[cargo_test]
fn issue_3419() {
let p = project()
.file(
}
// Check on a dylib should have a different metadata hash than build.
-#[test]
+#[cargo_test]
fn dylib_check_preserves_build_cache() {
let p = project()
.file(
}
// test `cargo rustc --profile check`
-#[test]
+#[cargo_test]
fn rustc_check() {
let foo = project()
.file(
foo.cargo("rustc --profile check -- --emit=metadata").run();
}
-#[test]
+#[cargo_test]
fn rustc_check_err() {
let foo = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn check_all() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn check_virtual_all_implied() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn exclude_warns_on_non_existing_package() {
let p = project().file("src/lib.rs", "").build();
p.cargo("check --all --exclude bar")
.run();
}
-#[test]
+#[cargo_test]
fn targets_selected_default() {
let foo = project()
.file("src/main.rs", "fn main() {}")
.run();
}
-#[test]
+#[cargo_test]
fn targets_selected_all() {
let foo = project()
.file("src/main.rs", "fn main() {}")
.run();
}
-#[test]
+#[cargo_test]
fn check_unit_test_profile() {
let foo = project()
.file(
}
// Verify what is checked with various command-line filters.
-#[test]
+#[cargo_test]
fn check_filters() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn check_artifacts() {
// Verify which artifacts are created when running check (#4059).
let p = project()
assert_eq!(p.glob("target/debug/deps/libb1-*.rmeta").count(), 1);
}
-#[test]
+#[cargo_test]
fn short_message_format() {
let foo = project()
.file("src/lib.rs", "fn foo() { let _x: bool = 'a'; }")
.run();
}
-#[test]
+#[cargo_test]
fn proc_macro() {
let p = project()
.file(
p.cargo("check -v").env("CARGO_LOG", "cargo=trace").run();
}
-#[test]
+#[cargo_test]
fn does_not_use_empty_rustc_wrapper() {
let p = project().file("src/lib.rs", "").build();
p.cargo("check").env("RUSTC_WRAPPER", "").run();
}
-#[test]
+#[cargo_test]
fn error_from_deep_recursion() -> Result<(), fmt::Error> {
let mut big_macro = String::new();
writeln!(big_macro, "macro_rules! m {{")?;
use crate::support::registry::Package;
use crate::support::{basic_bin_manifest, basic_manifest, git, main_file, project};
-#[test]
+#[cargo_test]
fn cargo_clean_simple() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
assert!(!p.build_dir().is_dir());
}
-#[test]
+#[cargo_test]
fn different_dir() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
assert!(!p.build_dir().is_dir());
}
-#[test]
+#[cargo_test]
fn clean_multiple_packages() {
let p = project()
.file(
assert!(!d2_path.is_file());
}
-#[test]
+#[cargo_test]
fn clean_release() {
let p = project()
.file(
assert!(!p.build_dir().join("release").is_dir());
}
-#[test]
+#[cargo_test]
fn clean_doc() {
let p = project()
.file(
assert!(p.build_dir().is_dir());
}
-#[test]
+#[cargo_test]
fn build_script() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn clean_git() {
let git = git::new("dep", |project| {
project
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn registry() {
let p = project()
.file(
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn clean_verbose() {
let p = project()
.file(
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn clean_remove_rlib_rmeta() {
let p = project()
.file(
use crate::support::{basic_manifest, project};
use std::env;
-#[test]
+#[cargo_test]
fn collision_dylib() {
// Path dependencies don't include metadata hash in filename for dylibs.
let p = project()
.run();
}
-#[test]
+#[cargo_test]
fn collision_example() {
// Examples in a workspace can easily collide.
let p = project()
.run();
}
-#[test]
+#[cargo_test]
fn collision_export() {
// `--out-dir` combines some things which can cause conflicts.
let p = project()
.run();
}
-#[test]
+#[cargo_test]
fn collision_doc() {
let p = project()
.file(
.publish();
}
-#[test]
+#[cargo_test]
fn multiple_installs() {
let p = project()
.no_manifest()
assert_has_installed_exe(cargo_home(), "bar");
}
-#[test]
+#[cargo_test]
fn concurrent_installs() {
const LOCKED_BUILD: &str = "waiting for file lock on build directory";
assert_has_installed_exe(cargo_home(), "bar");
}
-#[test]
+#[cargo_test]
fn one_install_should_be_bad() {
let p = project()
.no_manifest()
assert_has_installed_exe(cargo_home(), "foo");
}
-#[test]
+#[cargo_test]
fn multiple_registry_fetches() {
let mut pkg = Package::new("bar", "1.0.2");
for i in 0..10 {
.is_file());
}
-#[test]
+#[cargo_test]
fn git_same_repo_different_tags() {
let a = git::new("dep", |project| {
project
execs().run_output(&b);
}
-#[test]
+#[cargo_test]
fn git_same_branch_different_revs() {
let a = git::new("dep", |project| {
project
execs().run_output(&b);
}
-#[test]
+#[cargo_test]
fn same_project() {
let p = project()
.file("src/main.rs", "fn main() {}")
// Make sure that if Cargo dies while holding a lock that it's released and the
// next Cargo to come in will take over cleanly.
// older win versions don't support job objects, so skip test there
-#[test]
+#[cargo_test]
#[cfg_attr(target_os = "windows", ignore)]
fn killing_cargo_releases_the_lock() {
let p = project()
execs().run_output(&b);
}
-#[test]
+#[cargo_test]
fn debug_release_ok() {
let p = project().file("src/main.rs", "fn main() {}");
let p = p.build();
.run_output(&b);
}
-#[test]
+#[cargo_test]
fn no_deadlock_with_git_dependencies() {
let dep1 = git::new("dep1", |project| {
project
use cargo::util::toml::{self, VecStringOrBool as VSOB};
use serde::Deserialize;
-#[test]
+#[cargo_test]
fn read_env_vars_for_config() {
let p = project()
.file(
}
}
-#[test]
+#[cargo_test]
fn get_config() {
write_config(
"\
assert_eq!(s, S { f1: Some(456) });
}
-#[test]
+#[cargo_test]
fn config_unused_fields() {
write_config(
"\
}
}
-#[test]
+#[cargo_test]
fn config_load_toml_profile() {
write_config(
"\
);
}
-#[test]
+#[cargo_test]
fn config_deserialize_any() {
// Some tests to exercise deserialize_any for deserializers that need to
// be told the format.
}
}
-#[test]
+#[cargo_test]
fn config_toml_errors() {
write_config(
"\
);
}
-#[test]
+#[cargo_test]
fn load_nested() {
write_config(
"\
assert_eq!(n, expected);
}
-#[test]
+#[cargo_test]
fn get_errors() {
write_config(
"\
);
}
-#[test]
+#[cargo_test]
fn config_get_option() {
write_config(
"\
assert_eq!(config.get::<Option<i32>>("bar.zzzz").unwrap(), None);
}
-#[test]
+#[cargo_test]
fn config_bad_toml() {
write_config("asdf");
let config = new_config(&[]);
);
}
-#[test]
+#[cargo_test]
fn config_get_list() {
write_config(
"\
);
}
-#[test]
+#[cargo_test]
fn config_get_other_types() {
write_config(
"\
);
}
-#[test]
+#[cargo_test]
fn config_relative_path() {
write_config(&format!(
"\
);
}
-#[test]
+#[cargo_test]
fn config_get_integers() {
write_config(
"\
use crate::support::{basic_manifest, git, project};
use cargo::util::paths as cargopaths;
-#[test]
+#[cargo_test]
fn deleting_database_files() {
let project = project();
let git_project = git::new("bar", |project| {
}
}
-#[test]
+#[cargo_test]
fn deleting_checkout_files() {
let project = project();
let git_project = git::new("bar", |project| {
use crate::support::{basic_bin_manifest, basic_manifest, cross_compile, project};
use crate::support::{is_nightly, rustc_host};
-#[test]
+#[cargo_test]
fn simple_cross() {
if cross_compile::disabled() {
return;
p.process(&p.target_bin(&target, "foo")).run();
}
-#[test]
+#[cargo_test]
fn simple_cross_config() {
if cross_compile::disabled() {
return;
p.process(&p.target_bin(&target, "foo")).run();
}
-#[test]
+#[cargo_test]
fn simple_deps() {
if cross_compile::disabled() {
return;
p.process(&p.target_bin(&target, "foo")).run();
}
-#[test]
+#[cargo_test]
fn plugin_deps() {
if cross_compile::disabled() {
return;
foo.process(&foo.target_bin(&target, "foo")).run();
}
-#[test]
+#[cargo_test]
fn plugin_to_the_max() {
if cross_compile::disabled() {
return;
foo.process(&foo.target_bin(&target, "foo")).run();
}
-#[test]
+#[cargo_test]
fn linker_and_ar() {
if cross_compile::disabled() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn plugin_with_extra_dylib_dep() {
if cross_compile::disabled() {
return;
foo.cargo("build --target").arg(&target).run();
}
-#[test]
+#[cargo_test]
fn cross_tests() {
if cross_compile::disabled() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn no_cross_doctests() {
if cross_compile::disabled() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn simple_cargo_run() {
if cross_compile::disabled() {
return;
p.cargo("run --target").arg(&target).run();
}
-#[test]
+#[cargo_test]
fn cross_with_a_build_script() {
if cross_compile::disabled() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn build_script_needed_for_host_and_target() {
if cross_compile::disabled() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn build_deps_for_the_right_arch() {
if cross_compile::disabled() {
return;
p.cargo("build -v --target").arg(&target).run();
}
-#[test]
+#[cargo_test]
fn build_script_only_host() {
if cross_compile::disabled() {
return;
p.cargo("build -v --target").arg(&target).run();
}
-#[test]
+#[cargo_test]
fn plugin_build_script_right_arch() {
if cross_compile::disabled() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn build_script_with_platform_specific_dependencies() {
if cross_compile::disabled() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn platform_specific_dependencies_do_not_leak() {
if cross_compile::disabled() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn platform_specific_variables_reflected_in_build_scripts() {
if cross_compile::disabled() {
return;
p.cargo("build -v --target").arg(&target).run();
}
-#[test]
+#[cargo_test]
fn cross_test_dylib() {
if cross_compile::disabled() {
return;
use crate::support::{cross_compile, project, publish, registry};
-#[test]
+#[cargo_test]
fn simple_cross_package() {
if cross_compile::disabled() {
return;
);
}
-#[test]
+#[cargo_test]
fn publish_with_target() {
if cross_compile::disabled() {
return;
use crate::support::is_nightly;
use crate::support::{basic_manifest, project};
-#[test]
+#[cargo_test]
fn custom_target_minimal() {
if !is_nightly() {
// Requires features no_core, lang_items
.run();
}
-#[test]
+#[cargo_test]
fn custom_target_dependency() {
if !is_nightly() {
// Requires features no_core, lang_items, optin_builtin_traits
}
}
-#[test]
+#[cargo_test]
fn ctrl_c_kills_everyone() {
if !enabled() {
return;
use crate::support::{basic_bin_manifest, main_file, project};
use filetime::FileTime;
-#[test]
+#[cargo_test]
fn build_dep_info() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
assert!(depinfo_bin_path.is_file());
}
-#[test]
+#[cargo_test]
fn build_dep_info_lib() {
let p = project()
.file(
assert!(p.example_lib("ex", "lib").with_extension("d").is_file());
}
-#[test]
+#[cargo_test]
fn build_dep_info_rlib() {
let p = project()
.file(
assert!(p.example_lib("ex", "rlib").with_extension("d").is_file());
}
-#[test]
+#[cargo_test]
fn build_dep_info_dylib() {
let p = project()
.file(
assert!(p.example_lib("ex", "dylib").with_extension("d").is_file());
}
-#[test]
+#[cargo_test]
fn no_rewrite_if_no_change() {
let p = project().file("src/lib.rs", "").build();
}
}
-#[test]
+#[cargo_test]
fn simple() {
setup();
.run();
}
-#[test]
+#[cargo_test]
fn simple_install() {
setup();
.run();
}
-#[test]
+#[cargo_test]
fn simple_install_fail() {
setup();
.run();
}
-#[test]
+#[cargo_test]
fn install_without_feature_dep() {
setup();
.run();
}
-#[test]
+#[cargo_test]
fn not_there() {
setup();
.run();
}
-#[test]
+#[cargo_test]
fn multiple() {
setup();
.run();
}
-#[test]
+#[cargo_test]
fn crates_io_then_directory() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn crates_io_then_bad_checksum() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn bad_file_checksum() {
setup();
.run();
}
-#[test]
+#[cargo_test]
fn only_dot_files_ok() {
setup();
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn random_files_ok() {
setup();
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn git_lock_file_doesnt_change() {
let git = git::new("git", |p| {
p.file("Cargo.toml", &basic_manifest("git", "0.5.0"))
assert_eq!(lock1, lock2, "lock files changed");
}
-#[test]
+#[cargo_test]
fn git_override_requires_lockfile() {
VendorPackage::new("git")
.file("Cargo.toml", &basic_manifest("git", "0.5.0"))
.run();
}
-#[test]
+#[cargo_test]
fn workspace_different_locations() {
let p = project()
.no_manifest()
.run();
}
-#[test]
+#[cargo_test]
fn version_missing() {
setup();
use crate::support::{basic_lib_manifest, basic_manifest, git, project};
use crate::support::{is_nightly, rustc_host};
-#[test]
+#[cargo_test]
fn simple() {
let p = project()
.file(
assert!(p.root().join("target/doc/foo/index.html").is_file());
}
-#[test]
+#[cargo_test]
fn doc_no_libs() {
let p = project()
.file(
p.cargo("doc").run();
}
-#[test]
+#[cargo_test]
fn doc_twice() {
let p = project().file("src/lib.rs", "pub fn foo() {}").build();
p.cargo("doc").with_stdout("").run();
}
-#[test]
+#[cargo_test]
fn doc_deps() {
let p = project()
.file(
assert!(p.root().join("target/doc/bar/index.html").is_file());
}
-#[test]
+#[cargo_test]
fn doc_no_deps() {
let p = project()
.file(
assert!(!p.root().join("target/doc/bar/index.html").is_file());
}
-#[test]
+#[cargo_test]
fn doc_only_bin() {
let p = project()
.file(
assert!(p.root().join("target/doc/foo/index.html").is_file());
}
-#[test]
+#[cargo_test]
fn doc_multiple_targets_same_name_lib() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn doc_multiple_targets_same_name() {
let p = project()
.file(
assert!(doc_file.is_file());
}
-#[test]
+#[cargo_test]
fn doc_multiple_targets_same_name_bin() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn doc_multiple_targets_same_name_undoced() {
let p = project()
.file(
p.cargo("doc --all").run();
}
-#[test]
+#[cargo_test]
fn doc_lib_bin_same_name_documents_lib() {
let p = project()
.file(
assert!(!doc_html.contains("Binary"));
}
-#[test]
+#[cargo_test]
fn doc_lib_bin_same_name_documents_lib_when_requested() {
let p = project()
.file(
assert!(!doc_html.contains("Binary"));
}
-#[test]
+#[cargo_test]
fn doc_lib_bin_same_name_documents_named_bin_when_requested() {
let p = project()
.file(
assert!(doc_html.contains("Binary"));
}
-#[test]
+#[cargo_test]
fn doc_lib_bin_same_name_documents_bins_when_requested() {
let p = project()
.file(
assert!(doc_html.contains("Binary"));
}
-#[test]
+#[cargo_test]
fn doc_dash_p() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn doc_same_name() {
let p = project()
.file("src/lib.rs", "")
p.cargo("doc").run();
}
-#[test]
+#[cargo_test]
fn doc_target() {
const TARGET: &str = "arm-unknown-linux-gnueabihf";
.is_file());
}
-#[test]
+#[cargo_test]
fn target_specific_not_documented() {
let p = project()
.file(
p.cargo("doc").run();
}
-#[test]
+#[cargo_test]
fn output_not_captured() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn target_specific_documented() {
let p = project()
.file(
p.cargo("doc").run();
}
-#[test]
+#[cargo_test]
fn no_document_build_deps() {
let p = project()
.file(
p.cargo("doc").run();
}
-#[test]
+#[cargo_test]
fn doc_release() {
let p = project().file("src/lib.rs", "").build();
.run();
}
-#[test]
+#[cargo_test]
fn doc_multiple_deps() {
let p = project()
.file(
assert!(p.root().join("target/doc/baz/index.html").is_file());
}
-#[test]
+#[cargo_test]
fn features() {
let p = project()
.file(
assert!(p.root().join("target/doc/bar/fn.bar.html").is_file());
}
-#[test]
+#[cargo_test]
fn rerun_when_dir_removed() {
let p = project()
.file(
assert!(p.root().join("target/doc/foo/index.html").is_file());
}
-#[test]
+#[cargo_test]
fn document_only_lib() {
let p = project()
.file(
assert!(p.root().join("target/doc/foo/index.html").is_file());
}
-#[test]
+#[cargo_test]
fn plugins_no_use_target() {
let p = project()
.file(
p.cargo("doc --target=x86_64-unknown-openbsd -v").run();
}
-#[test]
+#[cargo_test]
fn doc_all_workspace() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn doc_all_virtual_manifest() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn doc_virtual_manifest_all_implied() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn doc_all_member_dependency_same_name() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
#[cfg(not(any(target_os = "windows", target_os = "macos")))]
fn doc_workspace_open_help_message() {
let p = project()
.run();
}
-#[test]
+#[cargo_test]
#[cfg(not(any(target_os = "windows", target_os = "macos")))]
fn doc_workspace_open_different_library_and_package_names() {
let p = project()
.run();
}
-#[test]
+#[cargo_test]
#[cfg(not(any(target_os = "windows", target_os = "macos")))]
fn doc_workspace_open_binary() {
let p = project()
.run();
}
-#[test]
+#[cargo_test]
#[cfg(not(any(target_os = "windows", target_os = "macos")))]
fn doc_workspace_open_binary_and_library() {
let p = project()
.run();
}
-#[test]
+#[cargo_test]
fn doc_edition() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn doc_target_edition() {
let p = project()
.file(
// Tests an issue where depending on different versions of the same crate depending on `cfg`s
// caused `cargo doc` to fail.
-#[test]
+#[cargo_test]
fn issue_5345() {
let foo = project()
.file(
foo.cargo("doc").run();
}
-#[test]
+#[cargo_test]
fn doc_private_items() {
let foo = project()
.file("src/lib.rs", "mod private { fn private_item() {} }")
.is_file());
}
-#[test]
+#[cargo_test]
fn doc_private_ws() {
let p = project()
.file(
pub fn foo() {}
"#;
-#[test]
+#[cargo_test]
fn doc_cap_lints() {
if !is_nightly() {
// This can be removed once intra_doc_link_resolution_failure fails on stable.
.run();
}
-#[test]
+#[cargo_test]
fn doc_message_format() {
if !is_nightly() {
// This can be removed once intra_doc_link_resolution_failure fails on stable.
.run();
}
-#[test]
+#[cargo_test]
fn short_message_format() {
if !is_nightly() {
// This can be removed once intra_doc_link_resolution_failure fails on stable.
use crate::support::{basic_lib_manifest, project};
-#[test]
+#[cargo_test]
fn edition_works_for_build_script() {
let p = project()
.file(
use crate::support::registry::Package;
use crate::support::{basic_manifest, project};
-#[test]
+#[cargo_test]
fn invalid1() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn invalid2() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn invalid3() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn invalid4() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn invalid5() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn invalid6() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn invalid7() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn invalid8() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn invalid9() {
let p = project()
.file(
).with_status(101).run();
}
-#[test]
+#[cargo_test]
fn invalid10() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn no_transitive_dep_feature_requirement() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn no_feature_doesnt_build() {
let p = project()
.file(
p.process(&p.bin("foo")).with_stdout("bar\n").run();
}
-#[test]
+#[cargo_test]
fn default_feature_pulled_in() {
let p = project()
.file(
p.process(&p.bin("foo")).with_stdout("").run();
}
-#[test]
+#[cargo_test]
fn cyclic_feature() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn cyclic_feature2() {
let p = project()
.file(
p.cargo("build").with_stdout("").run();
}
-#[test]
+#[cargo_test]
fn groups_on_groups_on_groups() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn many_cli_features() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn union_features() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn many_features_no_rebuilds() {
let p = project()
.file(
}
// Tests that all cmd lines work with `--features ""`
-#[test]
+#[cargo_test]
fn empty_features() {
let p = project().file("src/main.rs", "fn main() {}").build();
}
// Tests that all cmd lines work with `--features ""`
-#[test]
+#[cargo_test]
fn transitive_features() {
let p = project()
.file(
p.cargo("build --features foo").run();
}
-#[test]
+#[cargo_test]
fn everything_in_the_lockfile() {
let p = project()
.file(
);
}
-#[test]
+#[cargo_test]
fn no_rebuild_when_frobbing_default_feature() {
let p = project()
.file(
p.cargo("build").with_stdout("").run();
}
-#[test]
+#[cargo_test]
fn unions_work_with_no_default_features() {
let p = project()
.file(
p.cargo("build").with_stdout("").run();
}
-#[test]
+#[cargo_test]
fn optional_and_dev_dep() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn activating_feature_activates_dep() {
let p = project()
.file(
p.cargo("build --features a -v").run();
}
-#[test]
+#[cargo_test]
fn dep_feature_in_cmd_line() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn all_features_flag_enables_all_features() {
let p = project()
.file(
p.cargo("build --all-features").run();
}
-#[test]
+#[cargo_test]
fn many_cli_features_comma_delimited() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn many_cli_features_comma_and_space_delimited() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn combining_features_and_package() {
Package::new("dep", "1.0.0").publish();
.run();
}
-#[test]
+#[cargo_test]
fn namespaced_invalid_feature() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn namespaced_invalid_dependency() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn namespaced_non_optional_dependency() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn namespaced_implicit_feature() {
let p = project()
.file(
p.cargo("build").masquerade_as_nightly_cargo().run();
}
-#[test]
+#[cargo_test]
fn namespaced_shadowed_dep() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn namespaced_shadowed_non_optional() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn namespaced_implicit_non_optional() {
let p = project()
.file(
);
}
-#[test]
+#[cargo_test]
fn namespaced_same_name() {
let p = project()
.file(
p.cargo("build").masquerade_as_nightly_cargo().run();
}
-#[test]
+#[cargo_test]
fn only_dep_is_optional() {
Package::new("bar", "0.1.0").publish();
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn all_features_all_crates() {
Package::new("bar", "0.1.0").publish();
p.cargo("build --all-features --all").run();
}
-#[test]
+#[cargo_test]
fn feature_off_dylib() {
let p = project()
.file(
p.cargo("run -p bar").run();
}
-#[test]
+#[cargo_test]
fn warn_if_default_features() {
let p = project()
.file(
).run();
}
-#[test]
+#[cargo_test]
fn no_feature_for_non_optional_dep() {
let p = project()
.file(
use crate::support::rustc_host;
use crate::support::{basic_manifest, cross_compile, project};
-#[test]
+#[cargo_test]
fn no_deps() {
let p = project()
.file("src/main.rs", "mod a; fn main() {}")
p.cargo("fetch").with_stdout("").run();
}
-#[test]
+#[cargo_test]
fn fetch_all_platform_dependencies_when_no_target_is_given() {
if cross_compile::disabled() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn fetch_platform_specific_dependencies() {
if cross_compile::disabled() {
return;
use std::io::Write;
-#[test]
+#[cargo_test]
fn do_not_fix_broken_builds() {
let p = project()
.file(
assert!(p.read_file("src/lib.rs").contains("let mut x = 3;"));
}
-#[test]
+#[cargo_test]
fn fix_broken_if_requested() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn broken_fixes_backed_out() {
// This works as follows:
// - Create a `rustc` shim (the "foo" project) which will pretend that the
assert!(p.read_file("bar/src/lib.rs").contains("let mut x = 3;"));
}
-#[test]
+#[cargo_test]
fn fix_path_deps() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn do_not_fix_non_relevant_deps() {
let p = project()
.no_manifest()
assert!(p.read_file("bar/src/lib.rs").contains("mut"));
}
-#[test]
+#[cargo_test]
fn prepare_for_2018() {
let p = project()
.file(
.contains("let x = crate::foo::FOO;"));
}
-#[test]
+#[cargo_test]
fn local_paths() {
let p = project()
.file(
assert!(p.read_file("src/lib.rs").contains("use crate::test::foo;"));
}
-#[test]
+#[cargo_test]
fn upgrade_extern_crate() {
let p = project()
.file(
assert!(!p.read_file("src/lib.rs").contains("extern crate"));
}
-#[test]
+#[cargo_test]
fn specify_rustflags() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn no_changes_necessary() {
let p = project().file("src/lib.rs", "").build();
.run();
}
-#[test]
+#[cargo_test]
fn fixes_extra_mut() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn fixes_two_missing_ampersands() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn tricky() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn preserve_line_endings() {
let p = project()
.file(
assert!(p.read_file("src/lib.rs").contains("\r\n"));
}
-#[test]
+#[cargo_test]
fn fix_deny_warnings() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn fix_deny_warnings_but_not_others() {
let p = project()
.file(
assert!(p.read_file("src/lib.rs").contains("fn bar() {}"));
}
-#[test]
+#[cargo_test]
fn fix_two_files() {
let p = project()
.file(
assert!(!p.read_file("src/bar.rs").contains("let mut x = 3;"));
}
-#[test]
+#[cargo_test]
fn fixes_missing_ampersand() {
let p = project()
.file("src/main.rs", "fn main() { let mut x = 3; drop(x); }")
p.cargo("test").run();
}
-#[test]
+#[cargo_test]
fn fix_features() {
let p = project()
.file(
p.cargo("build --features bar").run();
}
-#[test]
+#[cargo_test]
fn shows_warnings() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn warns_if_no_vcs_detected() {
let p = project().file("src/lib.rs", "pub fn foo() {}").build();
p.cargo("fix --allow-no-vcs").run();
}
-#[test]
+#[cargo_test]
fn warns_about_dirty_working_directory() {
let p = project().file("src/lib.rs", "pub fn foo() {}").build();
p.cargo("fix --allow-dirty").run();
}
-#[test]
+#[cargo_test]
fn warns_about_staged_working_directory() {
let p = project().file("src/lib.rs", "pub fn foo() {}").build();
p.cargo("fix --allow-staged").run();
}
-#[test]
+#[cargo_test]
fn does_not_warn_about_clean_working_directory() {
let p = project().file("src/lib.rs", "pub fn foo() {}").build();
p.cargo("fix").run();
}
-#[test]
+#[cargo_test]
fn does_not_warn_about_dirty_ignored_files() {
let p = project()
.file("src/lib.rs", "pub fn foo() {}")
p.cargo("fix").run();
}
-#[test]
+#[cargo_test]
fn fix_all_targets_by_default() {
let p = project()
.file("src/lib.rs", "pub fn foo() { let mut x = 3; drop(x); }")
assert!(!p.read_file("tests/foo.rs").contains("let mut x"));
}
-#[test]
+#[cargo_test]
fn prepare_for_and_enable() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn fix_overlapping() {
let p = project()
.file(
assert!(contents.contains("crate::foo::<crate::A>()"));
}
-#[test]
+#[cargo_test]
fn fix_idioms() {
let p = project()
.file(
assert!(p.read_file("src/lib.rs").contains("Box<dyn Any>"));
}
-#[test]
+#[cargo_test]
fn idioms_2015_ok() {
let p = project().file("src/lib.rs", "").build();
p.cargo("fix --edition-idioms --allow-no-vcs").run();
}
-#[test]
+#[cargo_test]
fn both_edition_migrate_flags() {
let p = project().file("src/lib.rs", "").build();
.run();
}
-#[test]
+#[cargo_test]
fn shows_warnings_on_second_run_without_changes() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn shows_warnings_on_second_run_without_changes_on_multiple_targets() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn doesnt_rebuild_dependencies() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn does_not_crash_with_rustc_wrapper() {
// We don't have /usr/bin/env on Windows.
if cfg!(windows) {
.run();
}
-#[test]
+#[cargo_test]
fn only_warn_for_relevant_crates() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn fix_to_broken_code() {
let p = project()
.file(
);
}
-#[test]
+#[cargo_test]
fn fix_with_common() {
let p = project()
.file("src/lib.rs", "")
assert_eq!(p.read_file("tests/common/mod.rs"), "pub fn r#try() {}");
}
-#[test]
+#[cargo_test]
fn fix_in_existing_repo_weird_ignore() {
// Check that ignore doesn't ignore the repo itself.
let p = git::new("foo", |project| {
use crate::support::sleep_ms;
use crate::support::{basic_manifest, is_coarse_mtime, project};
-#[test]
+#[cargo_test]
fn modifying_and_moving() {
let p = project()
.file("src/main.rs", "mod a; fn main() {}")
.run();
}
-#[test]
+#[cargo_test]
fn modify_only_some_files() {
let p = project()
.file("src/lib.rs", "mod a;")
assert!(p.bin("foo").is_file());
}
-#[test]
+#[cargo_test]
fn rebuild_sub_package_then_while_package() {
let p = project()
.file(
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn changing_lib_features_caches_targets() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn changing_profiles_caches_targets() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn changing_bin_paths_common_target_features_caches_targets() {
// Make sure dep_cache crate is built once per feature
let p = project()
.run();
}
-#[test]
+#[cargo_test]
fn changing_bin_features_caches_targets() {
let p = project()
.file(
p.rename_run("foo", "on2").with_stdout("feature on").run();
}
-#[test]
+#[cargo_test]
fn rebuild_tests_if_lib_changes() {
let p = project()
.file("src/lib.rs", "pub fn foo() {}")
.run();
}
-#[test]
+#[cargo_test]
fn no_rebuild_transitive_target_deps() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn rerun_if_changed_in_dep() {
let p = project()
.file(
p.cargo("build").with_stdout("").run();
}
-#[test]
+#[cargo_test]
fn same_build_dir_cached_packages() {
let p = project()
.no_manifest()
.run();
}
-#[test]
+#[cargo_test]
fn no_rebuild_if_build_artifacts_move_backwards_in_time() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn rebuild_if_build_artifacts_move_forward_in_time() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn rebuild_if_environment_changes() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn no_rebuild_when_rename_dir() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn unused_optional_dep() {
Package::new("registry1", "0.1.0").publish();
Package::new("registry2", "0.1.0").publish();
p.cargo("build").with_stderr("[FINISHED] [..]").run();
}
-#[test]
+#[cargo_test]
fn path_dev_dep_registry_updates() {
Package::new("registry1", "0.1.0").publish();
Package::new("registry2", "0.1.0").publish();
p.cargo("build").with_stderr("[FINISHED] [..]").run();
}
-#[test]
+#[cargo_test]
fn change_panic_mode() {
let p = project()
.file(
p.cargo("build -p baz").run();
}
-#[test]
+#[cargo_test]
fn dont_rebuild_based_on_plugins() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn reuse_workspace_lib() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn reuse_shared_build_dep() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn changing_rustflags_is_cached() {
let p = project().file("src/lib.rs", "").build();
);
}
-#[test]
+#[cargo_test]
fn simple_deps_cleaner_does_not_rebuild() {
let p = project()
.file(
);
}
-#[test]
+#[cargo_test]
fn fingerprint_cleaner_does_not_rebuild() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn reuse_panic_build_dep_test() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn reuse_panic_pm() {
// foo(panic) -> bar(panic)
// somepm(nopanic) -> bar(nopanic)
.run();
}
-#[test]
+#[cargo_test]
fn bust_patched_dep() {
Package::new("registry1", "0.1.0").publish();
Package::new("registry2", "0.1.0")
.run();
}
-#[test]
+#[cargo_test]
fn rebuild_on_mid_build_file_modification() {
let server = TcpListener::bind("127.0.0.1:0").unwrap();
let addr = server.local_addr().unwrap();
t.join().ok().unwrap();
}
-#[test]
+#[cargo_test]
fn dirty_both_lib_and_test() {
// This tests that all artifacts that depend on the results of a build
// script will get rebuilt when the build script reruns, even for separate
p.cargo("test --lib").run();
}
-#[test]
+#[cargo_test]
fn script_fails_stay_dirty() {
// Check if a script is aborted (such as hitting Ctrl-C) that it will re-run.
// Steps:
.run();
}
-#[test]
+#[cargo_test]
fn simulated_docker_deps_stay_cached() {
// Test what happens in docker where the nanoseconds are zeroed out.
Package::new("regdep", "1.0.0").publish();
}
}
-#[test]
+#[cargo_test]
fn metadata_change_invalidates() {
let p = project()
.file(
assert_eq!(p.glob("target/debug/deps/libfoo-*.rlib").count(), 1);
}
-#[test]
+#[cargo_test]
fn edition_change_invalidates() {
const MANIFEST: &str = r#"
[package]
assert_eq!(p.glob("target/debug/deps/libfoo-*.rlib").count(), 1);
}
-#[test]
+#[cargo_test]
fn rename_with_path_deps() {
let p = project()
.file(
use crate::support::registry::Package;
use crate::support::{basic_manifest, paths, project, ProjectBuilder};
-#[test]
+#[cargo_test]
fn adding_and_removing_packages() {
let p = project()
.file("src/main.rs", "fn main() {}")
assert_eq!(lock1, lock4);
}
-#[test]
+#[cargo_test]
fn no_index_update() {
Package::new("serde", "1.0.0").publish();
.run();
}
-#[test]
+#[cargo_test]
fn preserve_metadata() {
let p = project()
.file("src/main.rs", "fn main() {}")
assert!(lock.contains(metadata.trim()), "{}", lock);
}
-#[test]
+#[cargo_test]
fn preserve_line_endings_issue_2076() {
let p = project()
.file("src/main.rs", "fn main() {}")
assert_eq!(lock1, lock2);
}
-#[test]
+#[cargo_test]
fn cargo_update_generate_lockfile() {
let p = project().file("src/main.rs", "fn main() {}").build();
assert!(lockfile.is_file());
}
-#[test]
+#[cargo_test]
fn duplicate_entries_in_lockfile() {
let _a = ProjectBuilder::new(paths::root().join("a"))
.file(
env::var("CARGO_TEST_DISABLE_GIT_CLI") == Ok("1".to_string())
}
-#[test]
+#[cargo_test]
fn cargo_compile_simple_git_dep() {
let project = project();
let git_project = git::new("dep1", |project| {
.run();
}
-#[test]
+#[cargo_test]
fn cargo_compile_git_dep_branch() {
let project = project();
let git_project = git::new("dep1", |project| {
.run();
}
-#[test]
+#[cargo_test]
fn cargo_compile_git_dep_tag() {
let project = project();
let git_project = git::new("dep1", |project| {
project.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn cargo_compile_with_nested_paths() {
let git_project = git::new("dep1", |project| {
project
p.process(&p.bin("foo")).with_stdout("hello world\n").run();
}
-#[test]
+#[cargo_test]
fn cargo_compile_with_malformed_nested_paths() {
let git_project = git::new("dep1", |project| {
project
p.process(&p.bin("foo")).with_stdout("hello world\n").run();
}
-#[test]
+#[cargo_test]
fn cargo_compile_with_meta_package() {
let git_project = git::new("meta-dep", |project| {
project
.run();
}
-#[test]
+#[cargo_test]
fn cargo_compile_with_short_ssh_git() {
let url = "git@github.com:a/dep";
.run();
}
-#[test]
+#[cargo_test]
fn two_revs_same_deps() {
let bar = git::new("meta-dep", |project| {
project
foo.process(&foo.bin("foo")).run();
}
-#[test]
+#[cargo_test]
fn recompilation() {
let git_project = git::new("bar", |project| {
project
.run();
}
-#[test]
+#[cargo_test]
fn update_with_shared_deps() {
let git_project = git::new("bar", |project| {
project
.run();
}
-#[test]
+#[cargo_test]
fn dep_with_submodule() {
let project = project();
let git_project = git::new("dep1", |project| {
.run();
}
-#[test]
+#[cargo_test]
fn dep_with_bad_submodule() {
let project = project();
let git_project = git::new("dep1", |project| {
.run();
}
-#[test]
+#[cargo_test]
fn two_deps_only_update_one() {
let project = project();
let git1 = git::new("dep1", |project| {
.run();
}
-#[test]
+#[cargo_test]
fn stale_cached_version() {
let bar = git::new("meta-dep", |project| {
project
foo.process(&foo.bin("foo")).run();
}
-#[test]
+#[cargo_test]
fn dep_with_changed_submodule() {
let project = project();
let git_project = git::new("dep1", |project| {
.run();
}
-#[test]
+#[cargo_test]
fn dev_deps_with_testing() {
let p2 = git::new("bar", |project| {
project
.run();
}
-#[test]
+#[cargo_test]
fn git_build_cmd_freshness() {
let foo = git::new("foo", |project| {
project
foo.cargo("build").with_stdout("").run();
}
-#[test]
+#[cargo_test]
fn git_name_not_always_needed() {
let p2 = git::new("bar", |project| {
project
.run();
}
-#[test]
+#[cargo_test]
fn git_repo_changing_no_rebuild() {
let bar = git::new("bar", |project| {
project
p1.cargo("build").with_stdout("").run();
}
-#[test]
+#[cargo_test]
fn git_dep_build_cmd() {
let p = git::new("foo", |project| {
project
p.process(&p.bin("foo")).with_stdout("1\n").run();
}
-#[test]
+#[cargo_test]
fn fetch_downloads() {
let bar = git::new("bar", |project| {
project
p.cargo("fetch").with_stdout("").run();
}
-#[test]
+#[cargo_test]
fn warnings_in_git_dep() {
let bar = git::new("bar", |project| {
project
.run();
}
-#[test]
+#[cargo_test]
fn update_ambiguous() {
let bar1 = git::new("bar1", |project| {
project
.run();
}
-#[test]
+#[cargo_test]
fn update_one_dep_in_repo_with_many_deps() {
let bar = git::new("bar", |project| {
project
.run();
}
-#[test]
+#[cargo_test]
fn switch_deps_does_not_update_transitive() {
let transitive = git::new("transitive", |project| {
project
.run();
}
-#[test]
+#[cargo_test]
fn update_one_source_updates_all_packages_in_that_git_source() {
let dep = git::new("dep", |project| {
project
);
}
-#[test]
+#[cargo_test]
fn switch_sources() {
let a1 = git::new("a1", |project| {
project
.run();
}
-#[test]
+#[cargo_test]
fn dont_require_submodules_are_checked_out() {
let p = project().build();
let git1 = git::new("dep1", |p| {
git1.cargo("build -v").cwd(&dst).run();
}
-#[test]
+#[cargo_test]
fn doctest_same_name() {
let a2 = git::new("a2", |p| {
p.file("Cargo.toml", &basic_manifest("a", "0.5.0"))
p.cargo("test -v").run();
}
-#[test]
+#[cargo_test]
fn lints_are_suppressed() {
let a = git::new("a", |p| {
p.file("Cargo.toml", &basic_manifest("a", "0.5.0")).file(
.run();
}
-#[test]
+#[cargo_test]
fn denied_lints_are_allowed() {
let a = git::new("a", |p| {
p.file("Cargo.toml", &basic_manifest("a", "0.5.0")).file(
.run();
}
-#[test]
+#[cargo_test]
fn add_a_git_dep() {
let git = git::new("git", |p| {
p.file("Cargo.toml", &basic_manifest("git", "0.5.0"))
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn two_at_rev_instead_of_tag() {
let git = git::new("git", |p| {
p.file("Cargo.toml", &basic_manifest("git1", "0.5.0"))
p.cargo("build -v").run();
}
-#[test]
+#[cargo_test]
fn include_overrides_gitignore() {
// Make sure that `package.include` takes precedence over .gitignore.
let p = git::new("foo", |repo| {
.run();
}
-#[test]
+#[cargo_test]
fn invalid_git_dependency_manifest() {
let project = project();
let git_project = git::new("dep1", |project| {
.run();
}
-#[test]
+#[cargo_test]
fn failed_submodule_checkout() {
let project = project();
let git_project = git::new("dep1", |project| {
t.join().unwrap();
}
-#[test]
+#[cargo_test]
fn use_the_cli() {
if disable_git_cli() {
return;
project.cargo("build -v").with_stderr(stderr).run();
}
-#[test]
+#[cargo_test]
fn templatedir_doesnt_cause_problems() {
let git_project2 = git::new("dep2", |project| {
project
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn git_with_cli_force() {
if disable_git_cli() {
return;
result
}
-#[test]
+#[cargo_test]
fn simple_lib() {
cargo_process("init --lib --vcs none --edition 2015")
.env("USER", "foo")
cargo_process("build").run();
}
-#[test]
+#[cargo_test]
fn simple_bin() {
let path = paths::root().join("foo");
fs::create_dir(&path).unwrap();
.is_file());
}
-#[test]
+#[cargo_test]
fn simple_git_ignore_exists() {
// write a .gitignore file with one entry
fs::create_dir_all(paths::root().join("foo")).unwrap();
cargo_process("build").cwd(&paths::root().join("foo")).run();
}
-#[test]
+#[cargo_test]
fn both_lib_and_bin() {
cargo_process("init --lib --bin")
.env("USER", "foo")
assert_eq!(Vec::from(content as &[u8]), new_content);
}
-#[test]
+#[cargo_test]
fn bin_already_exists_explicit() {
bin_already_exists(true, "src/main.rs")
}
-#[test]
+#[cargo_test]
fn bin_already_exists_implicit() {
bin_already_exists(false, "src/main.rs")
}
-#[test]
+#[cargo_test]
fn bin_already_exists_explicit_nosrc() {
bin_already_exists(true, "main.rs")
}
-#[test]
+#[cargo_test]
fn bin_already_exists_implicit_nosrc() {
bin_already_exists(false, "main.rs")
}
-#[test]
+#[cargo_test]
fn bin_already_exists_implicit_namenosrc() {
bin_already_exists(false, "foo.rs")
}
-#[test]
+#[cargo_test]
fn bin_already_exists_implicit_namesrc() {
bin_already_exists(false, "src/foo.rs")
}
-#[test]
+#[cargo_test]
fn confused_by_multiple_lib_files() {
let path = paths::root().join("foo");
fs::create_dir_all(&path.join("src")).unwrap();
assert!(!paths::root().join("foo/Cargo.toml").is_file());
}
-#[test]
+#[cargo_test]
fn multibin_project_name_clash() {
let path = paths::root().join("foo");
fs::create_dir(&path).unwrap();
assert_eq!(Vec::from(content as &[u8]), new_content);
}
-#[test]
+#[cargo_test]
fn lib_already_exists_src() {
lib_already_exists("src/lib.rs");
}
-#[test]
+#[cargo_test]
fn lib_already_exists_nosrc() {
lib_already_exists("lib.rs");
}
-#[test]
+#[cargo_test]
fn simple_git() {
cargo_process("init --lib --vcs git")
.env("USER", "foo")
assert!(paths::root().join(".gitignore").is_file());
}
-#[test]
+#[cargo_test]
fn auto_git() {
cargo_process("init --lib").env("USER", "foo").run();
assert!(paths::root().join(".gitignore").is_file());
}
-#[test]
+#[cargo_test]
fn invalid_dir_name() {
let foo = &paths::root().join("foo.bar");
fs::create_dir_all(&foo).unwrap();
assert!(!foo.join("Cargo.toml").is_file());
}
-#[test]
+#[cargo_test]
fn reserved_name() {
let test = &paths::root().join("test");
fs::create_dir_all(&test).unwrap();
assert!(!test.join("Cargo.toml").is_file());
}
-#[test]
+#[cargo_test]
fn git_autodetect() {
fs::create_dir(&paths::root().join(".git")).unwrap();
assert!(paths::root().join(".gitignore").is_file());
}
-#[test]
+#[cargo_test]
fn mercurial_autodetect() {
fs::create_dir(&paths::root().join(".hg")).unwrap();
assert!(paths::root().join(".hgignore").is_file());
}
-#[test]
+#[cargo_test]
fn gitignore_appended_not_replaced() {
fs::create_dir(&paths::root().join(".git")).unwrap();
assert!(contents.contains(r#"qqqqqq"#));
}
-#[test]
+#[cargo_test]
fn gitignore_added_newline_in_existing() {
fs::create_dir(&paths::root().join(".git")).unwrap();
assert!(contents.starts_with("first\n"));
}
-#[test]
+#[cargo_test]
fn gitignore_no_newline_in_new() {
fs::create_dir(&paths::root().join(".git")).unwrap();
assert!(!contents.starts_with('\n'));
}
-#[test]
+#[cargo_test]
fn mercurial_added_newline_in_existing() {
fs::create_dir(&paths::root().join(".hg")).unwrap();
assert!(contents.starts_with("first\n"));
}
-#[test]
+#[cargo_test]
fn mercurial_no_newline_in_new() {
fs::create_dir(&paths::root().join(".hg")).unwrap();
assert!(!contents.starts_with('\n'));
}
-#[test]
+#[cargo_test]
fn terminating_newline_in_new_git_ignore() {
cargo_process("init --vcs git --lib")
.env("USER", "foo")
assert_ne!(last_chars.next(), Some('\n'));
}
-#[test]
+#[cargo_test]
fn terminating_newline_in_new_mercurial_ignore() {
if !mercurial_available() {
return;
assert_ne!(last_chars.next(), Some('\n'));
}
-#[test]
+#[cargo_test]
fn terminating_newline_in_existing_git_ignore() {
fs::create_dir(&paths::root().join(".git")).unwrap();
fs::write(&paths::root().join(".gitignore"), b"first").unwrap();
assert_ne!(last_chars.next(), Some('\n'));
}
-#[test]
+#[cargo_test]
fn terminating_newline_in_existing_mercurial_ignore() {
fs::create_dir(&paths::root().join(".hg")).unwrap();
fs::write(&paths::root().join(".hgignore"), b"first").unwrap();
assert_ne!(last_chars.next(), Some('\n'));
}
-#[test]
+#[cargo_test]
fn cargo_lock_gitignored_if_lib1() {
fs::create_dir(&paths::root().join(".git")).unwrap();
assert!(contents.contains(r#"Cargo.lock"#));
}
-#[test]
+#[cargo_test]
fn cargo_lock_gitignored_if_lib2() {
fs::create_dir(&paths::root().join(".git")).unwrap();
assert!(contents.contains(r#"Cargo.lock"#));
}
-#[test]
+#[cargo_test]
fn cargo_lock_not_gitignored_if_bin1() {
fs::create_dir(&paths::root().join(".git")).unwrap();
assert!(!contents.contains(r#"Cargo.lock"#));
}
-#[test]
+#[cargo_test]
fn cargo_lock_not_gitignored_if_bin2() {
fs::create_dir(&paths::root().join(".git")).unwrap();
assert!(!contents.contains(r#"Cargo.lock"#));
}
-#[test]
+#[cargo_test]
fn with_argument() {
cargo_process("init foo --vcs none")
.env("USER", "foo")
assert!(paths::root().join("foo/Cargo.toml").is_file());
}
-#[test]
+#[cargo_test]
fn unknown_flags() {
cargo_process("init foo --flag")
.with_status(1)
}
#[cfg(not(windows))]
-#[test]
+#[cargo_test]
fn no_filename() {
cargo_process("init /")
.with_status(101)
.publish();
}
-#[test]
+#[cargo_test]
fn simple() {
pkg("foo", "0.0.1");
assert_has_not_installed_exe(cargo_home(), "foo");
}
-#[test]
+#[cargo_test]
fn multiple_pkgs() {
pkg("foo", "0.0.1");
pkg("bar", "0.0.2");
assert_has_not_installed_exe(cargo_home(), "bar");
}
-#[test]
+#[cargo_test]
fn pick_max_version() {
pkg("foo", "0.1.0");
pkg("foo", "0.2.0");
assert_has_installed_exe(cargo_home(), "foo");
}
-#[test]
+#[cargo_test]
fn installs_beta_version_by_explicit_name_from_git() {
let p = git::repo(&paths::root().join("foo"))
.file("Cargo.toml", &basic_manifest("foo", "0.3.0-beta.1"))
assert_has_installed_exe(cargo_home(), "foo");
}
-#[test]
+#[cargo_test]
fn missing() {
pkg("foo", "0.0.1");
cargo_process("install bar")
.run();
}
-#[test]
+#[cargo_test]
fn bad_version() {
pkg("foo", "0.0.1");
cargo_process("install foo --vers=0.2.0")
.run();
}
-#[test]
+#[cargo_test]
fn bad_paths() {
cargo_process("install")
.with_status(101)
.run();
}
-#[test]
+#[cargo_test]
fn install_location_precedence() {
pkg("foo", "0.0.1");
assert_has_installed_exe(&t4, "foo");
}
-#[test]
+#[cargo_test]
fn install_path() {
let p = project().file("src/main.rs", "fn main() {}").build();
.run();
}
-#[test]
+#[cargo_test]
fn multiple_crates_error() {
let p = git::repo(&paths::root().join("foo"))
.file("Cargo.toml", &basic_manifest("foo", "0.1.0"))
.run();
}
-#[test]
+#[cargo_test]
fn multiple_crates_select() {
let p = git::repo(&paths::root().join("foo"))
.file("Cargo.toml", &basic_manifest("foo", "0.1.0"))
assert_has_installed_exe(cargo_home(), "bar");
}
-#[test]
+#[cargo_test]
fn multiple_crates_git_all() {
let p = git::repo(&paths::root().join("foo"))
.file(
cargo_process(&format!("install --git {} bin1 bin2", p.url().to_string())).run();
}
-#[test]
+#[cargo_test]
fn multiple_crates_auto_binaries() {
let p = project()
.file(
assert_has_installed_exe(cargo_home(), "foo");
}
-#[test]
+#[cargo_test]
fn multiple_crates_auto_examples() {
let p = project()
.file(
assert_has_installed_exe(cargo_home(), "foo");
}
-#[test]
+#[cargo_test]
fn no_binaries_or_examples() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn no_binaries() {
let p = project()
.file("src/lib.rs", "")
.run();
}
-#[test]
+#[cargo_test]
fn examples() {
let p = project()
.file("src/lib.rs", "")
assert_has_installed_exe(cargo_home(), "foo");
}
-#[test]
+#[cargo_test]
fn install_twice() {
let p = project()
.file("src/bin/foo-bin1.rs", "fn main() {}")
.run();
}
-#[test]
+#[cargo_test]
fn install_force() {
let p = project().file("src/main.rs", "fn main() {}").build();
.run();
}
-#[test]
+#[cargo_test]
fn install_force_partial_overlap() {
let p = project()
.file("src/bin/foo-bin1.rs", "fn main() {}")
.run();
}
-#[test]
+#[cargo_test]
fn install_force_bin() {
let p = project()
.file("src/bin/foo-bin1.rs", "fn main() {}")
.run();
}
-#[test]
+#[cargo_test]
fn compile_failure() {
let p = project().file("src/main.rs", "").build();
.run();
}
-#[test]
+#[cargo_test]
fn git_repo() {
let p = git::repo(&paths::root().join("foo"))
.file("Cargo.toml", &basic_manifest("foo", "0.1.0"))
assert_has_installed_exe(cargo_home(), "foo");
}
-#[test]
+#[cargo_test]
fn list() {
pkg("foo", "0.0.1");
pkg("bar", "0.2.1");
.run();
}
-#[test]
+#[cargo_test]
fn list_error() {
pkg("foo", "0.0.1");
cargo_process("install foo").run();
.run();
}
-#[test]
+#[cargo_test]
fn uninstall_pkg_does_not_exist() {
cargo_process("uninstall foo")
.with_status(101)
.run();
}
-#[test]
+#[cargo_test]
fn uninstall_bin_does_not_exist() {
pkg("foo", "0.0.1");
.run();
}
-#[test]
+#[cargo_test]
fn uninstall_piecemeal() {
let p = project()
.file("src/bin/foo.rs", "fn main() {}")
.run();
}
-#[test]
+#[cargo_test]
fn subcommand_works_out_of_the_box() {
Package::new("cargo-foo", "1.0.0")
.file("src/main.rs", r#"fn main() { println!("bar"); }"#)
.run();
}
-#[test]
+#[cargo_test]
fn installs_from_cwd_by_default() {
let p = project().file("src/main.rs", "fn main() {}").build();
assert_has_installed_exe(cargo_home(), "foo");
}
-#[test]
+#[cargo_test]
fn installs_from_cwd_with_2018_warnings() {
let p = project()
.file(
assert_has_not_installed_exe(cargo_home(), "foo");
}
-#[test]
+#[cargo_test]
fn uninstall_cwd() {
let p = project().file("src/main.rs", "fn main() {}").build();
p.cargo("install --path .")
assert_has_not_installed_exe(cargo_home(), "foo");
}
-#[test]
+#[cargo_test]
fn uninstall_cwd_not_installed() {
let p = project().file("src/main.rs", "fn main() {}").build();
p.cargo("uninstall")
.run();
}
-#[test]
+#[cargo_test]
fn uninstall_cwd_no_project() {
let err_msg = if cfg!(windows) {
"The system cannot find the file specified."
.run();
}
-#[test]
+#[cargo_test]
fn do_not_rebuilds_on_local_install() {
let p = project().file("src/main.rs", "fn main() {}").build();
assert_has_installed_exe(cargo_home(), "foo");
}
-#[test]
+#[cargo_test]
fn reports_unsuccessful_subcommand_result() {
Package::new("cargo-fail", "1.0.0")
.file("src/main.rs", "fn main() { panic!(); }")
.run();
}
-#[test]
+#[cargo_test]
fn git_with_lockfile() {
let p = git::repo(&paths::root().join("foo"))
.file(
.run();
}
-#[test]
+#[cargo_test]
fn q_silences_warnings() {
let p = project().file("src/main.rs", "fn main() {}").build();
.run();
}
-#[test]
+#[cargo_test]
fn readonly_dir() {
pkg("foo", "0.0.1");
assert_has_installed_exe(cargo_home(), "foo");
}
-#[test]
+#[cargo_test]
fn use_path_workspace() {
Package::new("foo", "1.0.0").publish();
let p = project()
assert_eq!(lock, lock2, "different lockfiles");
}
-#[test]
+#[cargo_test]
fn dev_dependencies_no_check() {
Package::new("foo", "1.0.0").publish();
let p = project()
p.cargo("install").run();
}
-#[test]
+#[cargo_test]
fn dev_dependencies_lock_file_untouched() {
Package::new("foo", "1.0.0").publish();
let p = project()
assert!(lock == lock2, "different lockfiles");
}
-#[test]
+#[cargo_test]
fn install_target_native() {
pkg("foo", "0.1.0");
assert_has_installed_exe(cargo_home(), "foo");
}
-#[test]
+#[cargo_test]
fn install_target_foreign() {
if cross_compile::disabled() {
return;
assert_has_installed_exe(cargo_home(), "foo");
}
-#[test]
+#[cargo_test]
fn vers_precise() {
pkg("foo", "0.1.1");
pkg("foo", "0.1.2");
.run();
}
-#[test]
+#[cargo_test]
fn version_too() {
pkg("foo", "0.1.1");
pkg("foo", "0.1.2");
.run();
}
-#[test]
+#[cargo_test]
fn not_both_vers_and_version() {
pkg("foo", "0.1.1");
pkg("foo", "0.1.2");
.run();
}
-#[test]
+#[cargo_test]
fn legacy_version_requirement() {
pkg("foo", "0.1.1");
.run();
}
-#[test]
+#[cargo_test]
fn test_install_git_cannot_be_a_base_url() {
cargo_process("install --git github.com:rust-lang-nursery/rustfmt.git").with_status(101).with_stderr("error: invalid url `github.com:rust-lang-nursery/rustfmt.git`: cannot-be-a-base-URLs are not supported").run();
}
-#[test]
+#[cargo_test]
fn uninstall_multiple_and_specifying_bin() {
cargo_process("uninstall foo bar --bin baz").with_status(101).with_stderr("error: A binary can only be associated with a single installed package, specifying multiple specs with --bin is redundant.").run();
}
-#[test]
+#[cargo_test]
fn uninstall_multiple_and_some_pkg_does_not_exist() {
pkg("foo", "0.0.1");
assert_has_not_installed_exe(cargo_home(), "bar");
}
-#[test]
+#[cargo_test]
fn custom_target_dir_for_git_source() {
let p = git::repo(&paths::root().join("foo"))
.file("Cargo.toml", &basic_manifest("foo", "0.1.0"))
assert!(paths::root().join("target/release").is_dir());
}
-#[test]
+#[cargo_test]
fn install_respects_lock_file() {
// `cargo install` now requires --locked to use a Cargo.lock.
Package::new("bar", "0.1.0").publish();
cargo_process("install --locked foo").run();
}
-#[test]
+#[cargo_test]
fn install_path_respects_lock_file() {
// --path version of install_path_respects_lock_file, --locked is required
// to use Cargo.lock.
p.cargo("install --path . --locked").run();
}
-#[test]
+#[cargo_test]
fn lock_file_path_deps_ok() {
Package::new("bar", "0.1.0").publish();
cargo_process("install foo").run();
}
-#[test]
+#[cargo_test]
fn install_empty_argument() {
// Bug 5229
cargo_process("install")
.run();
}
-#[test]
+#[cargo_test]
fn git_repo_replace() {
let p = git::repo(&paths::root().join("foo"))
.file("Cargo.toml", &basic_manifest("foo", "0.1.0"))
.contains(&format!("{}", new_rev)));
}
-#[test]
+#[cargo_test]
fn workspace_uses_workspace_target_dir() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn install_ignores_local_cargo_config() {
pkg("bar", "0.0.1");
assert_has_installed_exe(cargo_home(), "bar");
}
-#[test]
+#[cargo_test]
fn install_global_cargo_config() {
pkg("bar", "0.0.1");
.run();
}
-#[test]
+#[cargo_test]
fn install_path_config() {
project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn install_version_req() {
// Try using a few versionreq styles.
pkg("foo", "0.0.3");
}
}
-#[test]
+#[cargo_test]
fn registry_upgrade() {
// Installing and upgrading from a registry.
pkg("foo", "1.0.0");
.run();
}
-#[test]
+#[cargo_test]
fn uninstall() {
// Basic uninstall test.
pkg("foo", "1.0.0");
assert_eq!(v1_table.get("v1").unwrap().as_table().unwrap().len(), 0);
}
-#[test]
+#[cargo_test]
fn upgrade_force() {
pkg("foo", "1.0.0");
cargo_process("install foo -Z install-upgrade")
validate_trackers("foo", "1.0.0", &["foo"]);
}
-#[test]
+#[cargo_test]
fn ambiguous_version_no_longer_allowed() {
// Non-semver-requirement is not allowed for `--version`.
pkg("foo", "1.0.0");
.run();
}
-#[test]
+#[cargo_test]
fn path_is_always_dirty() {
// --path should always reinstall.
let p = project().file("src/main.rs", "fn main() {}").build();
.run();
}
-#[test]
+#[cargo_test]
fn fails_for_conflicts_unknown() {
// If an untracked file is in the way, it should fail.
pkg("foo", "1.0.0");
.run();
}
-#[test]
+#[cargo_test]
fn fails_for_conflicts_known() {
// If the same binary exists in another package, it should fail.
pkg("foo", "1.0.0");
.run();
}
-#[test]
+#[cargo_test]
fn supports_multiple_binary_names() {
// Can individually install with --bin or --example
Package::new("foo", "1.0.0")
assert!(!installed_exe("a").exists());
}
-#[test]
+#[cargo_test]
fn v1_already_installed_fresh() {
// Install with v1, then try to install again with v2.
pkg("foo", "1.0.0");
.run();
}
-#[test]
+#[cargo_test]
fn v1_already_installed_dirty() {
// Install with v1, then install a new version with v2.
pkg("foo", "1.0.0");
validate_trackers("foo", "1.0.1", &["foo"]);
}
-#[test]
+#[cargo_test]
fn change_features_rebuilds() {
Package::new("foo", "1.0.0")
.file(
installed_process("foo").with_stdout("f1").run();
}
-#[test]
+#[cargo_test]
fn change_profile_rebuilds() {
pkg("foo", "1.0.0");
cargo_process("install foo -Z install-upgrade")
.run();
}
-#[test]
+#[cargo_test]
fn change_target_rebuilds() {
if cross_compile::disabled() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn change_bin_sets_rebuilds() {
// Changing which bins in a multi-bin project should reinstall.
Package::new("foo", "1.0.0")
validate_trackers("foo", "1.0.0", &["foo", "x", "y"]);
}
-#[test]
+#[cargo_test]
fn forwards_compatible() {
// Unknown fields should be preserved.
pkg("foo", "1.0.0");
);
}
-#[test]
+#[cargo_test]
fn v2_syncs() {
// V2 inherits the installs from V1.
pkg("one", "1.0.0");
.run();
}
-#[test]
+#[cargo_test]
fn upgrade_git() {
let git_project =
git::new("foo", |project| project.file("src/main.rs", "fn main() {}")).unwrap();
.run();
}
-#[test]
+#[cargo_test]
fn switch_sources() {
// Installing what appears to be the same thing, but from different
// sources should reinstall.
installed_process("foo").with_stdout("git").run();
}
-#[test]
+#[cargo_test]
fn multiple_report() {
// Testing the full output that indicates installed/ignored/replaced/summary.
pkg("one", "1.0.0");
.run();
}
-#[test]
+#[cargo_test]
fn no_track_gated() {
cargo_process("install --no-track foo")
.masquerade_as_nightly_cargo()
.run();
}
-#[test]
+#[cargo_test]
fn no_track() {
pkg("foo", "1.0.0");
cargo_process("install --no-track foo -Z install-upgrade")
use crate::support::{cargo_exe, project};
-#[test]
+#[cargo_test]
fn jobserver_exists() {
let p = project()
.file(
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn makes_jobserver_used() {
let make = if cfg!(windows) {
"mingw32-make"
child.join().unwrap();
}
-#[test]
+#[cargo_test]
fn jobserver_and_j() {
let make = if cfg!(windows) {
"mingw32-make"
}
}
-#[test]
+#[cargo_test]
fn build_list_targets() {
list_targets_test("build", EXAMPLE | BIN | TEST | BENCH);
}
-#[test]
+#[cargo_test]
fn check_list_targets() {
list_targets_test("check", EXAMPLE | BIN | TEST | BENCH);
}
-#[test]
+#[cargo_test]
fn doc_list_targets() {
list_targets_test("doc", BIN);
}
-#[test]
+#[cargo_test]
fn fix_list_targets() {
list_targets_test("fix", EXAMPLE | BIN | TEST | BENCH);
}
-#[test]
+#[cargo_test]
fn run_list_targets() {
list_targets_test("run", EXAMPLE | BIN);
}
-#[test]
+#[cargo_test]
fn test_list_targets() {
list_targets_test("test", EXAMPLE | BIN | TEST | BENCH);
}
-#[test]
+#[cargo_test]
fn bench_list_targets() {
list_targets_test("bench", EXAMPLE | BIN | TEST | BENCH);
}
-#[test]
+#[cargo_test]
fn install_list_targets() {
list_targets_test("install", EXAMPLE | BIN);
}
-#[test]
+#[cargo_test]
fn rustdoc_list_targets() {
list_targets_test("rustdoc", EXAMPLE | BIN | TEST | BENCH);
}
-#[test]
+#[cargo_test]
fn rustc_list_targets() {
list_targets_test("rustc", EXAMPLE | BIN | TEST | BENCH);
}
));
}
-#[test]
+#[cargo_test]
fn simple() {
setup();
Package::new("bar", "0.0.1")
p.cargo("test").run();
}
-#[test]
+#[cargo_test]
fn depend_on_yanked() {
setup();
Package::new("bar", "0.0.1").local(true).publish();
.run();
}
-#[test]
+#[cargo_test]
fn multiple_versions() {
setup();
Package::new("bar", "0.0.1").local(true).publish();
.run();
}
-#[test]
+#[cargo_test]
fn multiple_names() {
setup();
Package::new("bar", "0.0.1")
.run();
}
-#[test]
+#[cargo_test]
fn interdependent() {
setup();
Package::new("bar", "0.0.1")
.run();
}
-#[test]
+#[cargo_test]
fn path_dep_rewritten() {
setup();
Package::new("bar", "0.0.1")
.run();
}
-#[test]
+#[cargo_test]
fn invalid_dir_bad() {
setup();
let p = project()
.run();
}
-#[test]
+#[cargo_test]
fn different_directory_replacing_the_registry_is_bad() {
setup();
.run();
}
-#[test]
+#[cargo_test]
fn crates_io_registry_url_is_optional() {
let root = paths::root();
t!(fs::create_dir(&root.join(".cargo")));
use crate::support::registry::Package;
use crate::support::{basic_manifest, lines_match, project};
-#[test]
+#[cargo_test]
fn oldest_lockfile_still_works() {
let cargo_commands = vec!["build", "update"];
for cargo_command in cargo_commands {
assert_eq!(lock.lines().count(), expected_lockfile.lines().count());
}
-#[test]
+#[cargo_test]
fn frozen_flag_preserves_old_lockfile() {
let cksum = Package::new("bar", "0.1.0").publish();
assert_eq!(lock.lines().count(), old_lockfile.lines().count());
}
-#[test]
+#[cargo_test]
fn totally_wild_checksums_works() {
Package::new("bar", "0.1.0").publish();
));
}
-#[test]
+#[cargo_test]
fn wrong_checksum_is_an_error() {
Package::new("bar", "0.1.0").publish();
// If the checksum is unlisted in the lock file (e.g., <none>) yet we can
// calculate it (e.g., it's a registry dep), then we should in theory just fill
// it in.
-#[test]
+#[cargo_test]
fn unlisted_checksum_is_bad_if_we_calculate() {
Package::new("bar", "0.1.0").publish();
// If the checksum is listed in the lock file yet we cannot calculate it (e.g.,
// Git dependencies as of today), then make sure we choke.
-#[test]
+#[cargo_test]
fn listed_checksum_bad_if_we_cannot_compute() {
let git = git::new("bar", |p| {
p.file("Cargo.toml", &basic_manifest("bar", "0.1.0"))
.run();
}
-#[test]
+#[cargo_test]
fn current_lockfile_format() {
Package::new("bar", "0.1.0").publish();
assert_eq!(actual.lines().count(), expected.lines().count());
}
-#[test]
+#[cargo_test]
fn lockfile_without_root() {
Package::new("bar", "0.1.0").publish();
assert!(lock.starts_with(lockfile.trim()));
}
-#[test]
+#[cargo_test]
fn locked_correct_error() {
Package::new("bar", "0.1.0").publish();
}
}
-#[test]
+#[cargo_test]
fn login_with_old_credentials() {
registry::init();
assert!(check_token(TOKEN, None));
}
-#[test]
+#[cargo_test]
fn login_with_new_credentials() {
registry::init();
setup_new_credentials();
assert!(check_token(TOKEN, None));
}
-#[test]
+#[cargo_test]
fn login_with_old_and_new_credentials() {
setup_new_credentials();
login_with_old_credentials();
}
-#[test]
+#[cargo_test]
fn login_without_credentials() {
registry::init();
cargo_process("login --host")
assert!(check_token(TOKEN, None));
}
-#[test]
+#[cargo_test]
fn new_credentials_is_used_instead_old() {
registry::init();
setup_new_credentials();
assert_eq!(token.unwrap(), TOKEN);
}
-#[test]
+#[cargo_test]
fn registry_credentials() {
registry::init();
setup_new_credentials();
mod warn_on_failure;
mod workspaces;
-#[test]
+#[cargo_test]
fn aaa_trigger_cross_compile_disabled_check() {
// This triggers the cross compile disabled check to run ASAP, see #5141
support::cross_compile::disabled();
/// Tests inclusion of a `ManifestError` pointing to a member manifest
/// when that manifest fails to deserialize.
-#[test]
+#[cargo_test]
fn toml_deserialize_manifest_error() {
let p = project()
.file(
/// Tests inclusion of a `ManifestError` pointing to a member manifest
/// when that manifest has an invalid dependency path.
-#[test]
+#[cargo_test]
fn member_manifest_path_io_error() {
let p = project()
.file(
}
/// Tests dependency version errors provide which package failed via a `ResolveError`.
-#[test]
+#[cargo_test]
fn member_manifest_version_error() {
let p = project()
.file(
use serde_json;
use std::str;
-#[test]
+#[cargo_test]
fn metabuild_gated() {
let p = project()
.file(
.build()
}
-#[test]
+#[cargo_test]
fn metabuild_basic() {
let p = basic_project();
p.cargo("build -vv")
.run();
}
-#[test]
+#[cargo_test]
fn metabuild_error_both() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn metabuild_missing_dep() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn metabuild_optional_dep() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn metabuild_lib_name() {
// Test when setting `name` on [lib].
let p = project()
.run();
}
-#[test]
+#[cargo_test]
fn metabuild_fresh() {
if is_coarse_mtime() {
// This test doesn't work on coarse mtimes very well. Because the
.run();
}
-#[test]
+#[cargo_test]
fn metabuild_links() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn metabuild_override() {
let p = project()
.file(
p.cargo("build -vv").masquerade_as_nightly_cargo().run();
}
-#[test]
+#[cargo_test]
fn metabuild_workspace() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn metabuild_metadata() {
// The metabuild Target is filtered out of the `metadata` results.
let p = basic_project();
assert_eq!(mb_info, ["mb", "mb-other"]);
}
-#[test]
+#[cargo_test]
fn metabuild_build_plan() {
let p = basic_project();
assert_eq!(p.glob("target/.metabuild/metabuild-foo-*.rs").count(), 1);
}
-#[test]
+#[cargo_test]
fn metabuild_two_versions() {
// Two versions of a metabuild dep with the same name.
let p = project()
);
}
-#[test]
+#[cargo_test]
fn metabuild_external_dependency() {
Package::new("mb", "1.0.0")
.file("Cargo.toml", &basic_manifest("mb", "1.0.0"))
assert_eq!(p.glob("target/.metabuild/metabuild-dep-*.rs").count(), 1);
}
-#[test]
+#[cargo_test]
fn metabuild_json_artifact() {
let p = basic_project();
p.cargo("build --message-format=json")
.run();
}
-#[test]
+#[cargo_test]
fn metabuild_failed_build_json() {
let p = basic_project();
// Modify the metabuild dep so that it fails to compile.
use crate::support::registry::Package;
use crate::support::{basic_bin_manifest, basic_lib_manifest, main_file, project};
-#[test]
+#[cargo_test]
fn cargo_metadata_simple() {
let p = project()
.file("src/foo.rs", "")
.run();
}
-#[test]
+#[cargo_test]
fn cargo_metadata_warns_on_implicit_version() {
let p = project()
.file("src/foo.rs", "")
p.cargo("metadata --format-version 1").with_stderr("").run();
}
-#[test]
+#[cargo_test]
fn library_with_several_crate_types() {
let p = project()
.file("src/lib.rs", "")
.run();
}
-#[test]
+#[cargo_test]
fn library_with_features() {
let p = project()
.file("src/lib.rs", "")
.run();
}
-#[test]
+#[cargo_test]
fn cargo_metadata_with_deps_and_version() {
let p = project()
.file("src/foo.rs", "")
.run();
}
-#[test]
+#[cargo_test]
fn example() {
let p = project()
.file("src/lib.rs", "")
.run();
}
-#[test]
+#[cargo_test]
fn example_lib() {
let p = project()
.file("src/lib.rs", "")
.run();
}
-#[test]
+#[cargo_test]
fn workspace_metadata() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn workspace_metadata_no_deps() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn cargo_metadata_with_invalid_manifest() {
let p = project().file("Cargo.toml", "").build();
"workspace_root": "[..]/foo"
}"#;
-#[test]
+#[cargo_test]
fn cargo_metadata_no_deps_path_to_cargo_toml_relative() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn cargo_metadata_no_deps_path_to_cargo_toml_absolute() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn cargo_metadata_no_deps_path_to_cargo_toml_parent_relative() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn cargo_metadata_no_deps_path_to_cargo_toml_parent_absolute() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn cargo_metadata_no_deps_cwd() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn cargo_metadata_bad_version() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn multiple_features() {
let p = project()
.file(
p.cargo("metadata --features").arg("a b").run();
}
-#[test]
+#[cargo_test]
fn package_metadata() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn cargo_metadata_path_to_cargo_toml_project() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn package_edition_2018() {
let p = project()
.file("src/lib.rs", "")
.run();
}
-#[test]
+#[cargo_test]
fn target_edition_2018() {
let p = project()
.file("src/lib.rs", "")
.run();
}
-#[test]
+#[cargo_test]
fn rename_dependency() {
Package::new("bar", "0.1.0").publish();
Package::new("bar", "0.2.0").publish();
.run();
}
-#[test]
+#[cargo_test]
fn metadata_links() {
let p = project()
.file(
.run()
}
-#[test]
+#[cargo_test]
fn deps_with_bin_only() {
let p = project()
.file(
use crate::support::project;
-#[test]
+#[cargo_test]
fn net_retry_loads_from_config() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn net_retry_git_outputs_warning() {
let p = project()
.file(
File::create(gitconfig).unwrap();
}
-#[test]
+#[cargo_test]
fn simple_lib() {
cargo_process("new --lib foo --vcs none --edition 2015")
.env("USER", "foo")
cargo_process("build").cwd(&paths::root().join("foo")).run();
}
-#[test]
+#[cargo_test]
fn simple_bin() {
cargo_process("new --bin foo --edition 2015")
.env("USER", "foo")
.is_file());
}
-#[test]
+#[cargo_test]
fn both_lib_and_bin() {
cargo_process("new --lib --bin foo")
.env("USER", "foo")
.run();
}
-#[test]
+#[cargo_test]
fn simple_git() {
cargo_process("new --lib foo --edition 2015")
.env("USER", "foo")
cargo_process("build").cwd(&paths::root().join("foo")).run();
}
-#[test]
+#[cargo_test]
fn no_argument() {
cargo_process("new")
.with_status(1)
.run();
}
-#[test]
+#[cargo_test]
fn existing() {
let dst = paths::root().join("foo");
fs::create_dir(&dst).unwrap();
.run();
}
-#[test]
+#[cargo_test]
fn invalid_characters() {
cargo_process("new foo.rs")
.with_status(101)
.run();
}
-#[test]
+#[cargo_test]
fn reserved_name() {
cargo_process("new test")
.with_status(101)
.run();
}
-#[test]
+#[cargo_test]
fn reserved_binary_name() {
cargo_process("new --bin incremental")
.with_status(101)
.run();
}
-#[test]
+#[cargo_test]
fn keyword_name() {
cargo_process("new pub")
.with_status(101)
.run();
}
-#[test]
+#[cargo_test]
fn finds_author_user() {
create_empty_gitconfig();
cargo_process("new foo").env("USER", "foo").run();
assert!(contents.contains(r#"authors = ["foo"]"#));
}
-#[test]
+#[cargo_test]
fn finds_author_user_escaped() {
create_empty_gitconfig();
cargo_process("new foo").env("USER", "foo \"bar\"").run();
assert!(contents.contains(r#"authors = ["foo \"bar\""]"#));
}
-#[test]
+#[cargo_test]
fn finds_author_username() {
create_empty_gitconfig();
cargo_process("new foo")
assert!(contents.contains(r#"authors = ["foo"]"#));
}
-#[test]
+#[cargo_test]
fn finds_author_priority() {
cargo_process("new foo")
.env("USER", "bar2")
assert!(contents.contains(r#"authors = ["bar <baz>"]"#));
}
-#[test]
+#[cargo_test]
fn finds_author_email() {
create_empty_gitconfig();
cargo_process("new foo")
assert!(contents.contains(r#"authors = ["bar <baz>"]"#));
}
-#[test]
+#[cargo_test]
fn finds_author_git() {
git_process("config --global user.name bar").exec().unwrap();
git_process("config --global user.email baz")
assert!(contents.contains(r#"authors = ["bar <baz>"]"#));
}
-#[test]
+#[cargo_test]
fn finds_local_author_git() {
git_process("init").exec().unwrap();
git_process("config --global user.name foo").exec().unwrap();
assert!(contents.contains(r#"authors = ["bar <baz>"]"#));
}
-#[test]
+#[cargo_test]
fn finds_git_email() {
cargo_process("new foo")
.env("GIT_AUTHOR_NAME", "foo")
assert!(contents.contains(r#"authors = ["foo <gitfoo>"]"#), contents);
}
-#[test]
+#[cargo_test]
fn finds_git_author() {
create_empty_gitconfig();
cargo_process("new foo")
assert!(contents.contains(r#"authors = ["gitfoo"]"#));
}
-#[test]
+#[cargo_test]
fn author_prefers_cargo() {
git_process("config --global user.name foo").exec().unwrap();
git_process("config --global user.email bar")
assert!(!root.join("foo/.gitignore").exists());
}
-#[test]
+#[cargo_test]
fn strip_angle_bracket_author_email() {
create_empty_gitconfig();
cargo_process("new foo")
assert!(contents.contains(r#"authors = ["bar <baz>"]"#));
}
-#[test]
+#[cargo_test]
fn git_prefers_command_line() {
let root = paths::root();
fs::create_dir(&root.join(".cargo")).unwrap();
assert!(paths::root().join("foo/.gitignore").exists());
}
-#[test]
+#[cargo_test]
fn subpackage_no_git() {
cargo_process("new foo").env("USER", "foo").run();
.is_file());
}
-#[test]
+#[cargo_test]
fn subpackage_git_with_gitignore() {
cargo_process("new foo").env("USER", "foo").run();
.is_file());
}
-#[test]
+#[cargo_test]
fn subpackage_git_with_vcs_arg() {
cargo_process("new foo").env("USER", "foo").run();
.is_file());
}
-#[test]
+#[cargo_test]
fn unknown_flags() {
cargo_process("new foo --flag")
.with_status(1)
.run();
}
-#[test]
+#[cargo_test]
fn explicit_invalid_name_not_suggested() {
cargo_process("new --name 10-invalid a")
.with_status(101)
.run();
}
-#[test]
+#[cargo_test]
fn explicit_project_name() {
cargo_process("new --lib foo --name bar")
.env("USER", "foo")
.run();
}
-#[test]
+#[cargo_test]
fn new_with_edition_2015() {
cargo_process("new --edition 2015 foo")
.env("USER", "foo")
assert!(manifest.contains("edition = \"2015\""));
}
-#[test]
+#[cargo_test]
fn new_with_edition_2018() {
cargo_process("new --edition 2018 foo")
.env("USER", "foo")
assert!(manifest.contains("edition = \"2018\""));
}
-#[test]
+#[cargo_test]
fn new_default_edition() {
cargo_process("new foo").env("USER", "foo").run();
let manifest = fs::read_to_string(paths::root().join("foo/Cargo.toml")).unwrap();
assert!(manifest.contains("edition = \"2018\""));
}
-#[test]
+#[cargo_test]
fn new_with_bad_edition() {
cargo_process("new --edition something_else foo")
.env("USER", "foo")
.run();
}
-#[test]
+#[cargo_test]
fn new_with_blank_email() {
cargo_process("new foo")
.env("CARGO_NAME", "Sen")
assert!(contents.contains(r#"authors = ["Sen"]"#), contents);
}
-#[test]
+#[cargo_test]
fn new_with_reference_link() {
cargo_process("new foo").env("USER", "foo").run();
use crate::support::{basic_manifest, git, main_file, path2url, project, registry::Package};
use std::fs;
-#[test]
+#[cargo_test]
fn offline_unused_target_dep() {
// --offline with a target dependency that is not used and not downloaded.
Package::new("unused_dep", "1.0.0").publish();
p.cargo("build --offline").run();
}
-#[test]
+#[cargo_test]
fn offline_missing_optional() {
Package::new("opt_dep", "1.0.0").publish();
let p = project()
.run();
}
-#[test]
+#[cargo_test]
fn cargo_compile_path_with_offline() {
let p = project()
.file(
p.cargo("build --offline").run();
}
-#[test]
+#[cargo_test]
fn cargo_compile_with_downloaded_dependency_with_offline() {
Package::new("present_dep", "1.2.3")
.file("Cargo.toml", &basic_manifest("present_dep", "1.2.3"))
.run();
}
-#[test]
+#[cargo_test]
fn cargo_compile_offline_not_try_update() {
let p = project()
.at("bar")
.run();
}
-#[test]
+#[cargo_test]
fn compile_offline_without_maxvers_cached() {
Package::new("present_dep", "1.2.1").publish();
Package::new("present_dep", "1.2.2").publish();
.run();
}
-#[test]
+#[cargo_test]
fn cargo_compile_forbird_git_httpsrepo_offline() {
let p = project()
.file(
can't checkout from 'https://github.com/some_user/dep1.git': you are in the offline mode (--offline)").run();
}
-#[test]
+#[cargo_test]
fn compile_offline_while_transitive_dep_not_cached() {
let baz = Package::new("baz", "1.0.0");
let baz_path = baz.archive_dst();
.run();
}
-#[test]
+#[cargo_test]
fn update_offline() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn cargo_compile_offline_with_cached_git_dep() {
let git_project = git::new("dep1", |project| {
project
.run();
}
-#[test]
+#[cargo_test]
fn offline_resolve_optional_fail() {
// Example where resolve fails offline.
//
use crate::support::sleep_ms;
use crate::support::{basic_manifest, project};
-#[test]
+#[cargo_test]
fn binary_with_debug() {
let p = project()
.file("src/main.rs", r#"fn main() { println!("Hello, World!") }"#)
);
}
-#[test]
+#[cargo_test]
fn static_library_with_debug() {
let p = project()
.file(
);
}
-#[test]
+#[cargo_test]
fn dynamic_library_with_debug() {
let p = project()
.file(
);
}
-#[test]
+#[cargo_test]
fn rlib_with_debug() {
let p = project()
.file(
);
}
-#[test]
+#[cargo_test]
fn include_only_the_binary_from_the_current_package() {
let p = project()
.file(
);
}
-#[test]
+#[cargo_test]
fn out_dir_is_a_file() {
let p = project()
.file("src/main.rs", r#"fn main() { println!("Hello, World!") }"#)
.run();
}
-#[test]
+#[cargo_test]
fn replaces_artifacts() {
let p = project()
.file("src/main.rs", r#"fn main() { println!("foo") }"#)
.run();
}
-#[test]
+#[cargo_test]
fn avoid_build_scripts() {
let p = project()
.file(
use crate::support::registry::Package;
use crate::support::{basic_manifest, project};
-#[test]
+#[cargo_test]
fn override_simple() {
Package::new("bar", "0.1.0").publish();
.run();
}
-#[test]
+#[cargo_test]
fn missing_version() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn invalid_semver_version() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn different_version() {
Package::new("bar", "0.2.0").publish();
Package::new("bar", "0.1.0").publish();
.run();
}
-#[test]
+#[cargo_test]
fn transitive() {
Package::new("bar", "0.1.0").publish();
Package::new("baz", "0.2.0")
p.cargo("build").with_stdout("").run();
}
-#[test]
+#[cargo_test]
fn persists_across_rebuilds() {
Package::new("bar", "0.1.0").publish();
p.cargo("build").with_stdout("").run();
}
-#[test]
+#[cargo_test]
fn replace_registry_with_path() {
Package::new("bar", "0.1.0").publish();
.run();
}
-#[test]
+#[cargo_test]
fn use_a_spec_to_select() {
Package::new("baz", "0.1.1")
.file("src/lib.rs", "pub fn baz1() {}")
.run();
}
-#[test]
+#[cargo_test]
fn override_adds_some_deps() {
Package::new("baz", "0.1.1").publish();
Package::new("bar", "0.1.0").publish();
p.cargo("build").with_stdout("").run();
}
-#[test]
+#[cargo_test]
fn locked_means_locked_yes_no_seriously_i_mean_locked() {
// this in theory exercises #2041
Package::new("baz", "0.1.0").publish();
p.cargo("build").with_stdout("").run();
}
-#[test]
+#[cargo_test]
fn override_wrong_name() {
Package::new("baz", "0.1.0").publish();
.run();
}
-#[test]
+#[cargo_test]
fn override_with_nothing() {
Package::new("bar", "0.1.0").publish();
.run();
}
-#[test]
+#[cargo_test]
fn override_wrong_version() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn multiple_specs() {
Package::new("bar", "0.1.0").publish();
.run();
}
-#[test]
+#[cargo_test]
fn test_override_dep() {
Package::new("bar", "0.1.0").publish();
.run();
}
-#[test]
+#[cargo_test]
fn update() {
Package::new("bar", "0.1.0").publish();
// foo -> near -> far
// near is overridden with itself
-#[test]
+#[cargo_test]
fn no_override_self() {
let deps = git::repo(&paths::root().join("override"))
.file("far/Cargo.toml", &basic_manifest("far", "0.1.0"))
p.cargo("build --verbose").run();
}
-#[test]
+#[cargo_test]
fn broken_path_override_warns() {
Package::new("bar", "0.1.0").publish();
Package::new("bar", "0.2.0").publish();
.run();
}
-#[test]
+#[cargo_test]
fn override_an_override() {
Package::new("chrono", "0.2.0")
.dep("serde", "< 0.9")
p.cargo("build -v").run();
}
-#[test]
+#[cargo_test]
fn overriding_nonexistent_no_spurious() {
Package::new("bar", "0.1.0").dep("baz", "0.1").publish();
Package::new("baz", "0.1.0").publish();
.run();
}
-#[test]
+#[cargo_test]
fn no_warnings_when_replace_is_used_in_another_workspace_member() {
Package::new("bar", "0.1.0").publish();
Package::new("baz", "0.1.0").publish();
.run();
}
-#[test]
+#[cargo_test]
fn override_to_path_dep() {
Package::new("bar", "0.1.0").dep("baz", "0.1").publish();
Package::new("baz", "0.1.0").publish();
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn replace_to_path_dep() {
Package::new("bar", "0.1.0").dep("baz", "0.1").publish();
Package::new("baz", "0.1.0").publish();
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn paths_ok_with_optional() {
Package::new("baz", "0.1.0").publish();
.run();
}
-#[test]
+#[cargo_test]
fn paths_add_optional_bad() {
Package::new("baz", "0.1.0").publish();
.run();
}
-#[test]
+#[cargo_test]
fn override_with_default_feature() {
Package::new("another", "0.1.0").publish();
Package::new("another", "0.1.1").dep("bar", "0.1").publish();
p.cargo("run").run();
}
-#[test]
+#[cargo_test]
fn override_plus_dep() {
Package::new("bar", "0.1.0").publish();
};
use git2;
-#[test]
+#[cargo_test]
fn simple() {
let p = project()
.file(
);
}
-#[test]
+#[cargo_test]
fn metadata_warning() {
let p = project().file("src/main.rs", "fn main() {}").build();
p.cargo("package")
.run();
}
-#[test]
+#[cargo_test]
fn package_verbose() {
let root = paths::root().join("all");
let repo = git::repo(&root)
.run();
}
-#[test]
+#[cargo_test]
fn package_verification() {
let p = project().file("src/main.rs", "fn main() {}").build();
p.cargo("build").run();
.run();
}
-#[test]
+#[cargo_test]
fn vcs_file_collision() {
let p = project().build();
let _ = git::repo(&paths::root().join("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn path_dependency_no_version() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn exclude() {
let root = paths::root().join("exclude");
let repo = git::repo(&root)
.run();
}
-#[test]
+#[cargo_test]
fn include() {
let root = paths::root().join("include");
let repo = git::repo(&root)
.run();
}
-#[test]
+#[cargo_test]
fn package_lib_with_bin() {
let p = project()
.file("src/main.rs", "extern crate foo; fn main() {}")
p.cargo("package -v").run();
}
-#[test]
+#[cargo_test]
fn package_git_submodule() {
let project = git::new("foo", |project| {
project
.run();
}
-#[test]
+#[cargo_test]
fn no_duplicates_from_modified_tracked_files() {
let root = paths::root().join("all");
let p = git::repo(&root)
.run();
}
-#[test]
+#[cargo_test]
fn ignore_nested() {
let cargo_toml = r#"
[project]
// Windows doesn't allow these characters in filenames.
#[cfg(unix)]
-#[test]
+#[cargo_test]
fn package_weird_characters() {
let p = project()
.file("src/main.rs", r#"fn main() { println!("hello"); }"#)
.run();
}
-#[test]
+#[cargo_test]
fn repackage_on_source_change() {
let p = project()
.file("src/main.rs", r#"fn main() { println!("hello"); }"#)
);
}
-#[test]
+#[cargo_test]
#[cfg(unix)]
fn broken_symlink() {
use std::os::unix::fs;
.run();
}
-#[test]
+#[cargo_test]
fn do_not_package_if_repository_is_dirty() {
let p = project().build();
.run();
}
-#[test]
+#[cargo_test]
fn generated_manifest() {
Package::new("abc", "1.0.0").publish();
Package::new("def", "1.0.0").alternative(true).publish();
);
}
-#[test]
+#[cargo_test]
fn ignore_workspace_specifier() {
let p = project()
.file(
);
}
-#[test]
+#[cargo_test]
fn package_two_kinds_of_deps() {
Package::new("other", "1.0.0").publish();
Package::new("other1", "1.0.0").publish();
p.cargo("package --no-verify").run();
}
-#[test]
+#[cargo_test]
fn test_edition() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn edition_with_metadata() {
let p = project()
.file(
p.cargo("package").run();
}
-#[test]
+#[cargo_test]
fn test_edition_malformed() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn do_not_package_if_src_was_modified() {
let p = project()
.file("src/main.rs", r#"fn main() { println!("hello"); }"#)
p.cargo("package --no-verify").run();
}
-#[test]
+#[cargo_test]
fn package_with_select_features() {
let p = project()
.file(
p.cargo("package --features required").run();
}
-#[test]
+#[cargo_test]
fn package_with_all_features() {
let p = project()
.file(
p.cargo("package --all-features").run();
}
-#[test]
+#[cargo_test]
fn package_no_default_features() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn include_cargo_toml_implicit() {
let p = project()
.file(
p.root().rm_rf();
}
-#[test]
+#[cargo_test]
fn package_include_ignore_only() {
// Test with a gitignore pattern that fails to parse with glob.
// This is a somewhat nonsense pattern, but is an example of something git
)
}
-#[test]
+#[cargo_test]
fn gitignore_patterns() {
include_exclude_test(
r#"["Cargo.toml", "foo"]"#, // include
);
}
-#[test]
+#[cargo_test]
fn gitignore_negate() {
include_exclude_test(
r#"["Cargo.toml", "*.rs", "!foo.rs", "\\!important"]"#, // include
use crate::support::{basic_manifest, project};
use toml;
-#[test]
+#[cargo_test]
fn replace() {
Package::new("bar", "0.1.0").publish();
Package::new("baz", "0.1.0")
p.cargo("build").with_stderr("[FINISHED] [..]").run();
}
-#[test]
+#[cargo_test]
fn nonexistent() {
Package::new("baz", "0.1.0").publish();
p.cargo("build").with_stderr("[FINISHED] [..]").run();
}
-#[test]
+#[cargo_test]
fn patch_git() {
let bar = git::repo(&paths::root().join("override"))
.file("Cargo.toml", &basic_manifest("bar", "0.1.0"))
p.cargo("build").with_stderr("[FINISHED] [..]").run();
}
-#[test]
+#[cargo_test]
fn patch_to_git() {
let bar = git::repo(&paths::root().join("override"))
.file("Cargo.toml", &basic_manifest("bar", "0.1.0"))
p.cargo("build").with_stderr("[FINISHED] [..]").run();
}
-#[test]
+#[cargo_test]
fn unused() {
Package::new("bar", "0.1.0").publish();
);
}
-#[test]
+#[cargo_test]
fn unused_git() {
Package::new("bar", "0.1.0").publish();
.run();
}
-#[test]
+#[cargo_test]
fn add_patch() {
Package::new("bar", "0.1.0").publish();
p.cargo("build").with_stderr("[FINISHED] [..]").run();
}
-#[test]
+#[cargo_test]
fn add_ignored_patch() {
Package::new("bar", "0.1.0").publish();
.run();
}
-#[test]
+#[cargo_test]
fn no_warn_ws_patch() {
Package::new("c", "0.1.0").publish();
.run();
}
-#[test]
+#[cargo_test]
fn new_minor() {
Package::new("bar", "0.1.0").publish();
.run();
}
-#[test]
+#[cargo_test]
fn transitive_new_minor() {
Package::new("baz", "0.1.0").publish();
.run();
}
-#[test]
+#[cargo_test]
fn new_major() {
Package::new("bar", "0.1.0").publish();
.run();
}
-#[test]
+#[cargo_test]
fn transitive_new_major() {
Package::new("baz", "0.1.0").publish();
.run();
}
-#[test]
+#[cargo_test]
fn remove_patch() {
Package::new("foo", "0.1.0").publish();
Package::new("bar", "0.1.0").publish();
assert_ne!(lock_file1, lock_file2);
}
-#[test]
+#[cargo_test]
fn non_crates_io() {
Package::new("bar", "0.1.0").publish();
.run();
}
-#[test]
+#[cargo_test]
fn replace_with_crates_io() {
Package::new("bar", "0.1.0").publish();
.run();
}
-#[test]
+#[cargo_test]
fn patch_in_virtual() {
Package::new("bar", "0.1.0").publish();
p.cargo("build").with_stderr("[FINISHED] [..]").run();
}
-#[test]
+#[cargo_test]
fn patch_depends_on_another_patch() {
Package::new("bar", "0.1.0")
.file("src/lib.rs", "broken code")
p.cargo("build").with_stderr("[FINISHED] [..]").run();
}
-#[test]
+#[cargo_test]
fn replace_prerelease() {
Package::new("baz", "1.1.0-pre.1").publish();
let p = project()
use crate::support::sleep_ms;
use crate::support::{basic_lib_manifest, basic_manifest, main_file, project};
-#[test]
+#[cargo_test]
// I have no idea why this is failing spuriously on Windows;
// for more info, see #3466.
#[cfg(not(windows))]
.run();
}
-#[test]
+#[cargo_test]
fn cargo_compile_with_root_dev_deps() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn cargo_compile_with_root_dev_deps_with_testing() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn cargo_compile_with_transitive_dev_deps() {
let p = project()
.file(
p.process(&p.bin("foo")).with_stdout("zoidberg\n").run();
}
-#[test]
+#[cargo_test]
fn no_rebuild_dependency() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn deep_dependencies_trigger_rebuild() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn no_rebuild_two_deps() {
let p = project()
.file(
assert!(p.bin("foo").is_file());
}
-#[test]
+#[cargo_test]
fn nested_deps_recompile() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn error_message_for_missing_manifest() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn override_relative() {
let bar = project()
.at("bar")
p.cargo("build -v").run();
}
-#[test]
+#[cargo_test]
fn override_self() {
let bar = project()
.at("bar")
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn override_path_dep() {
let bar = project()
.at("bar")
p.cargo("build -v").run();
}
-#[test]
+#[cargo_test]
fn path_dep_build_cmd() {
let p = project()
.file(
p.process(&p.bin("foo")).with_stdout("1\n").run();
}
-#[test]
+#[cargo_test]
fn dev_deps_no_rebuild_lib() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn custom_target_no_rebuild() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn override_and_depend() {
let p = project()
.no_manifest()
.run();
}
-#[test]
+#[cargo_test]
fn missing_path_dependency() {
let p = project()
.file("Cargo.toml", &basic_manifest("a", "0.5.0"))
.run();
}
-#[test]
+#[cargo_test]
fn invalid_path_dep_in_workspace_with_lockfile() {
Package::new("bar", "1.0.0").publish();
.run();
}
-#[test]
+#[cargo_test]
fn workspace_produces_rlib() {
let p = project()
.file(
assert!(!p.root().join("target/debug/libfoo.rlib").is_file());
}
-#[test]
+#[cargo_test]
fn thin_lto_works() {
let p = project()
.file(
use crate::support::{basic_manifest, project};
use crate::support::{is_nightly, rustc_host};
-#[test]
+#[cargo_test]
fn plugin_to_the_max() {
if !is_nightly() {
// plugins are unstable
foo.cargo("doc").run();
}
-#[test]
+#[cargo_test]
fn plugin_with_dynamic_native_dependency() {
if !is_nightly() {
// plugins are unstable
foo.cargo("build -v").env("BUILDER_ROOT", root).run();
}
-#[test]
+#[cargo_test]
fn plugin_integration() {
let p = project()
.file(
p.cargo("test -v").run();
}
-#[test]
+#[cargo_test]
fn doctest_a_plugin() {
let p = project()
.file(
}
// See #1515
-#[test]
+#[cargo_test]
fn native_plugin_dependency_with_custom_ar_linker() {
let target = rustc_host();
.run();
}
-#[test]
+#[cargo_test]
fn panic_abort_plugins() {
if !is_nightly() {
// requires rustc_private
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn shared_panic_abort_plugins() {
if !is_nightly() {
// requires rustc_private
use crate::support::is_nightly;
use crate::support::project;
-#[test]
+#[cargo_test]
fn probe_cfg_before_crate_type_discovery() {
let p = project()
.file(
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn noop() {
let p = project()
.file(
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn impl_and_derive() {
let p = project()
.file(
p.cargo("run").with_stdout("X { success: true }").run();
}
-#[test]
+#[cargo_test]
fn plugin_and_proc_macro() {
if !is_nightly() {
// plugins are unstable
.run();
}
-#[test]
+#[cargo_test]
fn proc_macro_doctest() {
let foo = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn proc_macro_crate_type() {
// Verify that `crate-type = ["proc-macro"]` is the same as `proc-macro = true`
// and that everything, including rustdoc, works correctly.
.run();
}
-#[test]
+#[cargo_test]
fn proc_macro_crate_type_warning() {
let foo = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn proc_macro_crate_type_warning_plugin() {
let foo = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn proc_macro_crate_type_multiple() {
let foo = project()
.file(
use crate::support::{basic_lib_manifest, is_nightly, paths, project};
-#[test]
+#[cargo_test]
fn profile_config_gated() {
let p = project()
.file("Cargo.toml", &basic_lib_manifest("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn profile_config_validate_warnings() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn profile_config_error_paths() {
let p = project()
.file("Cargo.toml", &basic_lib_manifest("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn profile_config_validate_errors() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn profile_config_syntax_errors() {
let p = project()
.file("Cargo.toml", &basic_lib_manifest("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn profile_config_override_spec_multiple() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn profile_config_all_options() {
if !is_nightly() {
// May be removed once 1.34 is stable (added support for incremental-LTO).
.run();
}
-#[test]
+#[cargo_test]
fn profile_config_override_precedence() {
// Config values take precedence over manifest values.
let p = project()
.run();
}
-#[test]
+#[cargo_test]
fn profile_config_no_warn_unknown_override() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn profile_config_mixed_types() {
let p = project()
.file("Cargo.toml", &basic_lib_manifest("foo"))
use crate::support::registry::Package;
use crate::support::{basic_lib_manifest, basic_manifest, project};
-#[test]
+#[cargo_test]
fn profile_override_gated() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn profile_override_basic() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn profile_override_warnings() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn profile_override_dev_release_only() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn profile_override_bad_settings() {
let bad_values = [
(
}
}
-#[test]
+#[cargo_test]
fn profile_override_hierarchy() {
// Test that the precedence rules are correct for different types.
let p = project()
.run();
}
-#[test]
+#[cargo_test]
fn profile_override_spec_multiple() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn profile_override_spec() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn override_proc_macro() {
Package::new("shared", "1.0.0").publish();
let p = project()
.build()
}
-#[test]
+#[cargo_test]
fn profile_selection_build() {
let p = all_target_project();
.run();
}
-#[test]
+#[cargo_test]
fn profile_selection_build_release() {
let p = all_target_project();
.run();
}
-#[test]
+#[cargo_test]
fn profile_selection_build_all_targets() {
let p = all_target_project();
// `build`
.run();
}
-#[test]
+#[cargo_test]
fn profile_selection_build_all_targets_release() {
let p = all_target_project();
// `build --all-targets --release`
.run();
}
-#[test]
+#[cargo_test]
fn profile_selection_test() {
let p = all_target_project();
// `test`
.run();
}
-#[test]
+#[cargo_test]
fn profile_selection_test_release() {
let p = all_target_project();
// `test --release`
.run();
}
-#[test]
+#[cargo_test]
fn profile_selection_bench() {
let p = all_target_project();
.run();
}
-#[test]
+#[cargo_test]
fn profile_selection_check_all_targets() {
let p = all_target_project();
// `check`
.run();
}
-#[test]
+#[cargo_test]
fn profile_selection_check_all_targets_release() {
let p = all_target_project();
// `check --release`
.run();
}
-#[test]
+#[cargo_test]
fn profile_selection_check_all_targets_test() {
let p = all_target_project();
// `check --profile=test`
.run();
}
-#[test]
+#[cargo_test]
fn profile_selection_doc() {
let p = all_target_project();
// `doc`
use crate::support::project;
-#[test]
+#[cargo_test]
fn profile_overrides() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn opt_level_override_0() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn debug_override_1() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn opt_level_overrides() {
for &(profile_level, rustc_level) in &[
("1", "1"),
}
}
-#[test]
+#[cargo_test]
fn top_level_overrides_deps() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn profile_in_non_root_manifest_triggers_a_warning() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn profile_in_virtual_manifest_works() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn profile_panic_test_bench() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn profile_doc_deprecated() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn panic_unwind_does_not_build_twice() {
// Check for a bug where `lib` was built twice, once with panic set and
// once without. Since "unwind" is the default, they are the same and
.run();
}
-#[test]
+#[cargo_test]
fn debug_0_report() {
// The finished line handles 0 correctly.
let p = project()
use crate::support::registry::Package;
use crate::support::{is_nightly, project};
-#[test]
+#[cargo_test]
fn exported_priv_warning() {
if !is_nightly() {
return;
.run()
}
-#[test]
+#[cargo_test]
fn exported_pub_dep() {
if !is_nightly() {
return;
.run()
}
-#[test]
+#[cargo_test]
pub fn requires_nightly_cargo() {
let p = project()
.file(
.run()
}
-#[test]
+#[cargo_test]
fn requires_feature() {
Package::new("pub_dep", "0.1.0")
.file("src/lib.rs", "")
.run()
}
-#[test]
+#[cargo_test]
fn pub_dev_dependency() {
Package::new("pub_dep", "0.1.0")
.file("src/lib.rs", "pub struct FromPub;")
);
}
-#[test]
+#[cargo_test]
fn simple() {
registry::init();
validate_upload_foo();
}
-#[test]
+#[cargo_test]
fn old_token_location() {
// Check that the `token` key works at the root instead of under a
// `[registry]` table.
// TODO: Deprecated
// remove once it has been decided --host can be removed
-#[test]
+#[cargo_test]
fn simple_with_host() {
registry::init();
// TODO: Deprecated
// remove once it has been decided --host can be removed
-#[test]
+#[cargo_test]
fn simple_with_index_and_host() {
registry::init();
validate_upload_foo();
}
-#[test]
+#[cargo_test]
fn git_deps() {
registry::init();
.run();
}
-#[test]
+#[cargo_test]
fn path_dependency_no_version() {
registry::init();
.run();
}
-#[test]
+#[cargo_test]
fn unpublishable_crate() {
registry::init();
.run();
}
-#[test]
+#[cargo_test]
fn dont_publish_dirty() {
registry::init();
let p = project().file("bar", "").build();
.run();
}
-#[test]
+#[cargo_test]
fn publish_clean() {
registry::init();
validate_upload_foo_clean();
}
-#[test]
+#[cargo_test]
fn publish_in_sub_repo() {
registry::init();
validate_upload_foo_clean();
}
-#[test]
+#[cargo_test]
fn publish_when_ignored() {
registry::init();
);
}
-#[test]
+#[cargo_test]
fn ignore_when_crate_ignored() {
registry::init();
);
}
-#[test]
+#[cargo_test]
fn new_crate_rejected() {
registry::init();
.run();
}
-#[test]
+#[cargo_test]
fn dry_run() {
registry::init();
assert!(!registry::api_path().join("api/v1/crates/new").exists());
}
-#[test]
+#[cargo_test]
fn registry_not_in_publish_list() {
registry::init();
.run();
}
-#[test]
+#[cargo_test]
fn publish_empty_list() {
registry::init();
.run();
}
-#[test]
+#[cargo_test]
fn publish_allowed_registry() {
registry::init();
);
}
-#[test]
+#[cargo_test]
fn block_publish_no_registry() {
registry::init();
.run();
}
-#[test]
+#[cargo_test]
fn publish_with_crates_io_explicit() {
// Explicitly setting `crates-io` in the publish list.
registry::init();
p.cargo("publish").run();
}
-#[test]
+#[cargo_test]
fn publish_with_select_features() {
registry::init();
.run();
}
-#[test]
+#[cargo_test]
fn publish_with_all_features() {
registry::init();
.run();
}
-#[test]
+#[cargo_test]
fn publish_with_no_default_features() {
registry::init();
.run();
}
-#[test]
+#[cargo_test]
fn publish_with_patch() {
Package::new("bar", "1.0.0").publish();
);
}
-#[test]
+#[cargo_test]
fn publish_checks_for_token_before_verify() {
registry::init();
)
}
-#[test]
+#[cargo_test]
fn package_lockfile() {
let p = project()
.file("Cargo.toml", &pl_manifest("foo", "0.0.1", ""))
);
}
-#[test]
+#[cargo_test]
fn package_lockfile_git_repo() {
// Create a Git repository containing a minimal Rust project.
let g = git::repo(&paths::root().join("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn no_lock_file_with_library() {
let p = project()
.file("Cargo.toml", &pl_manifest("foo", "0.0.1", ""))
);
}
-#[test]
+#[cargo_test]
fn lock_file_and_workspace() {
let p = project()
.file(
);
}
-#[test]
+#[cargo_test]
fn note_resolve_changes() {
// `multi` has multiple sources (path and registry).
Package::new("mutli", "0.1.0").publish();
.run();
}
-#[test]
+#[cargo_test]
fn outdated_lock_version_change_does_not_warn() {
// If the version of the package being packaged changes, but Cargo.lock is
// not updated, don't bother warning about it.
.run();
}
-#[test]
+#[cargo_test]
fn no_warn_workspace_extras() {
// Other entries in workspace lock file should be ignored.
Package::new("dep1", "1.0.0").publish();
.run();
}
-#[test]
+#[cargo_test]
fn warn_package_with_yanked() {
Package::new("bar", "0.1.0").publish();
let p = project()
.run();
}
-#[test]
+#[cargo_test]
fn warn_install_with_yanked() {
Package::new("bar", "0.1.0").yanked(true).publish();
Package::new("bar", "0.1.1").publish();
.run();
}
-#[test]
+#[cargo_test]
fn publish_lockfile_default() {
let p = project()
.file(
"metadata": null
}"#;
-#[test]
+#[cargo_test]
fn cargo_read_manifest_path_to_cargo_toml_relative() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn cargo_read_manifest_path_to_cargo_toml_absolute() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn cargo_read_manifest_path_to_cargo_toml_parent_relative() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn cargo_read_manifest_path_to_cargo_toml_parent_absolute() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn cargo_read_manifest_cwd() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
use crate::support::{basic_manifest, project};
use cargo::util::paths::remove_dir_all;
-#[test]
+#[cargo_test]
fn simple() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn deps() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn nonexistent() {
Package::new("init", "0.0.1").publish();
.run();
}
-#[test]
+#[cargo_test]
fn wrong_case() {
Package::new("init", "0.0.1").publish();
.run();
}
-#[test]
+#[cargo_test]
fn mis_hyphenated() {
Package::new("mis-hyphenated", "0.0.1").publish();
.run();
}
-#[test]
+#[cargo_test]
fn wrong_version() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn bad_cksum() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn update_registry() {
Package::new("init", "0.0.1").publish();
.run();
}
-#[test]
+#[cargo_test]
fn package_with_path_deps() {
Package::new("init", "0.0.1").publish();
.run();
}
-#[test]
+#[cargo_test]
fn lockfile_locks() {
let p = project()
.file(
p.cargo("build").with_stdout("").run();
}
-#[test]
+#[cargo_test]
fn lockfile_locks_transitively() {
let p = project()
.file(
p.cargo("build").with_stdout("").run();
}
-#[test]
+#[cargo_test]
fn yanks_are_not_used() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn relying_on_a_yank_is_bad() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn yanks_in_lockfiles_are_ok() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn yanks_in_lockfiles_are_ok_for_other_update() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn yanks_in_lockfiles_are_ok_with_new_dep() {
let p = project()
.file(
p.cargo("build").with_stdout("").run();
}
-#[test]
+#[cargo_test]
fn update_with_lockfile_if_packages_missing() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn update_lockfile() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn dev_dependency_not_used() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn login_with_no_cargo_dir() {
// Create a config in the root directory because `login` requires the
// index to be updated, and we don't want to hit crates.io.
assert_eq!(credentials, "[registry]\ntoken = \"foo\"\n");
}
-#[test]
+#[cargo_test]
fn login_with_differently_sized_token() {
// Verify that the configuration file gets properly truncated.
registry::init();
assert_eq!(credentials, "[registry]\ntoken = \"lmaolmaolmao\"\n");
}
-#[test]
+#[cargo_test]
fn bad_license_file() {
Package::new("foo", "1.0.0").publish();
let p = project()
.run();
}
-#[test]
+#[cargo_test]
fn updating_a_dep() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn git_and_registry_dep() {
let b = git::repo(&paths::root().join("b"))
.file(
p.cargo("build").with_stdout("").run();
}
-#[test]
+#[cargo_test]
fn update_publish_then_update() {
// First generate a Cargo.lock and a clone of the registry index at the
// "head" of the current registry.
.run();
}
-#[test]
+#[cargo_test]
fn fetch_downloads() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn update_transitive_dependency() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn update_backtracking_ok() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn update_multiple_packages() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn bundled_crate_in_registry() {
let p = project()
.file(
p.cargo("run").run();
}
-#[test]
+#[cargo_test]
fn update_same_prefix_oh_my_how_was_this_a_bug() {
let p = project()
.file(
p.cargo("update -pfoobar --precise=0.2.0").run();
}
-#[test]
+#[cargo_test]
fn use_semver() {
let p = project()
.file(
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn only_download_relevant() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn resolve_and_backtracking() {
let p = project()
.file(
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn upstream_warnings_on_extra_verbose() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn disallow_network() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn add_dep_dont_update_registry() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn bump_version_dont_update_registry() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn old_version_req() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn old_version_req_upstream() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn toml_lies_but_index_is_truth() {
Package::new("foo", "0.2.0").publish();
Package::new("bar", "0.3.0")
p.cargo("build -v").run();
}
-#[test]
+#[cargo_test]
fn vv_prints_warnings() {
Package::new("foo", "0.2.0")
.file(
p.cargo("build -vv").run();
}
-#[test]
+#[cargo_test]
fn bad_and_or_malicious_packages_rejected() {
Package::new("foo", "0.2.0")
.extra_file("foo-0.1.0/src/lib.rs", "")
.run();
}
-#[test]
+#[cargo_test]
fn git_init_templatedir_missing() {
Package::new("foo", "0.2.0").dep("bar", "*").publish();
Package::new("bar", "0.2.0").publish();
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn rename_deps_and_features() {
Package::new("foo", "0.1.0")
.file("src/lib.rs", "pub fn f1() {}")
p.cargo("build --features bar/another").run();
}
-#[test]
+#[cargo_test]
fn ignore_invalid_json_lines() {
Package::new("foo", "0.1.0").publish();
Package::new("foo", "0.1.1").invalid_json(true).publish();
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn readonly_registry_still_works() {
Package::new("foo", "0.1.0").publish();
use crate::support::registry::Package;
use crate::support::{basic_manifest, project};
-#[test]
+#[cargo_test]
fn rename_dependency() {
Package::new("bar", "0.1.0").publish();
Package::new("bar", "0.2.0").publish();
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn rename_with_different_names() {
let p = project()
.file(
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn lots_of_names() {
Package::new("foo", "0.1.0")
.file("src/lib.rs", "pub fn foo1() {}")
p.cargo("build -v").run();
}
-#[test]
+#[cargo_test]
fn rename_and_patch() {
Package::new("foo", "0.1.0").publish();
p.cargo("build -v").run();
}
-#[test]
+#[cargo_test]
fn rename_twice() {
Package::new("foo", "0.1.0").publish();
.run();
}
-#[test]
+#[cargo_test]
fn rename_affects_fingerprint() {
Package::new("foo", "0.1.0").publish();
.run();
}
-#[test]
+#[cargo_test]
fn can_run_doc_tests() {
Package::new("bar", "0.1.0").publish();
Package::new("bar", "0.2.0").publish();
.run();
}
-#[test]
+#[cargo_test]
fn features_still_work() {
Package::new("foo", "0.1.0").publish();
Package::new("bar", "0.1.0").publish();
p.cargo("build -v").run();
}
-#[test]
+#[cargo_test]
fn features_not_working() {
Package::new("foo", "0.1.0").publish();
Package::new("bar", "0.1.0").publish();
.run();
}
-#[test]
+#[cargo_test]
fn rename_with_dash() {
let p = project()
.file(
use crate::support::is_nightly;
use crate::support::project;
-#[test]
+#[cargo_test]
fn build_bin_default_features() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn build_bin_arg_features() {
let p = project()
.file(
assert!(p.bin("foo").is_file());
}
-#[test]
+#[cargo_test]
fn build_bin_multiple_required_features() {
let p = project()
.file(
p.cargo("build --no-default-features").run();
}
-#[test]
+#[cargo_test]
fn build_example_default_features() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn build_example_arg_features() {
let p = project()
.file(
assert!(p.bin("examples/foo").is_file());
}
-#[test]
+#[cargo_test]
fn build_example_multiple_required_features() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn test_default_features() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn test_arg_features() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn test_multiple_required_features() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn bench_default_features() {
if !is_nightly() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn bench_arg_features() {
if !is_nightly() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn bench_multiple_required_features() {
if !is_nightly() {
return;
.run();
}
-#[test]
+#[cargo_test]
fn install_default_features() {
let p = project()
.file(
assert_has_not_installed_exe(cargo_home(), "foo");
}
-#[test]
+#[cargo_test]
fn install_arg_features() {
let p = project()
.file(
p.cargo("uninstall foo").run();
}
-#[test]
+#[cargo_test]
fn install_multiple_required_features() {
let p = project()
.file(
assert_has_not_installed_exe(cargo_home(), "foo_2");
}
-#[test]
+#[cargo_test]
fn dep_feature_in_toml() {
let p = project()
.file(
p.cargo("uninstall foo").run();
}
-#[test]
+#[cargo_test]
fn dep_feature_in_cmd_line() {
let p = project()
.file(
p.cargo("uninstall foo").run();
}
-#[test]
+#[cargo_test]
fn test_skips_compiling_bin_with_missing_required_features() {
let p = project()
.file(
}
}
-#[test]
+#[cargo_test]
fn run_default() {
let p = project()
.file(
p.cargo("run --features a").run();
}
-#[test]
+#[cargo_test]
fn run_default_multiple_required_features() {
let p = project()
.file(
}
}
-#[test]
+#[cargo_test]
fn pub_fail() {
let input = vec![
pkg!(("a", "0.0.4")),
assert!(resolve_and_validated(pkg_id("root"), vec![dep("kB")], ®, None).is_err());
}
-#[test]
+#[cargo_test]
fn basic_public_dependency() {
let reg = registry(vec![
pkg!(("A", "0.1.0")),
);
}
-#[test]
+#[cargo_test]
fn public_dependency_filling_in() {
// The resolver has an optimization where if a candidate to resolve a dependency
// has already bean activated then we skip looking at the candidates dependencies.
);
}
-#[test]
+#[cargo_test]
fn public_dependency_filling_in_and_update() {
// The resolver has an optimization where if a candidate to resolve a dependency
// has already bean activated then we skip looking at the candidates dependencies.
);
}
-#[test]
+#[cargo_test]
fn public_dependency_skipping() {
// When backtracking due to a failed dependency, if Cargo is
// trying to be clever and skip irrelevant dependencies, care must
resolve_and_validated(pkg_id("root"), vec![dep("c")], ®, None).unwrap();
}
-#[test]
+#[cargo_test]
fn public_dependency_skipping_in_backtracking() {
// When backtracking due to a failed dependency, if Cargo is
// trying to be clever and skip irrelevant dependencies, care must
resolve_and_validated(pkg_id("root"), vec![dep("C")], ®, None).unwrap();
}
-#[test]
+#[cargo_test]
fn public_sat_topological_order() {
let input = vec![
pkg!(("a", "0.0.1")),
assert!(resolve_and_validated(pkg_id("root"), vec![dep("A")], ®, None).is_err());
}
-#[test]
+#[cargo_test]
fn public_sat_unused_makes_things_pub() {
let input = vec![
pkg!(("a", "0.0.1")),
resolve_and_validated(pkg_id("root"), vec![dep("c")], ®, None).unwrap();
}
-#[test]
+#[cargo_test]
fn public_sat_unused_makes_things_pub_2() {
let input = vec![
pkg!(("c", "0.0.2")),
resolve_and_validated(pkg_id("root"), vec![dep("A")], ®, None).unwrap();
}
-#[test]
+#[cargo_test]
#[should_panic(expected = "assertion failed: !name.is_empty()")]
fn test_dependency_with_empty_name() {
// Bug 5229, dependency-names must not be empty
"".to_dep();
}
-#[test]
+#[cargo_test]
fn test_resolving_empty_dependency_list() {
let res = resolve(pkg_id("root"), Vec::new(), ®istry(vec![])).unwrap();
assert_eq!(res, names(&["root"]));
}
-#[test]
+#[cargo_test]
fn test_resolving_only_package() {
let reg = registry(vec![pkg!("foo")]);
let res = resolve(pkg_id("root"), vec![dep("foo")], ®).unwrap();
assert_same(&res, &names(&["root", "foo"]));
}
-#[test]
+#[cargo_test]
fn test_resolving_one_dep() {
let reg = registry(vec![pkg!("foo"), pkg!("bar")]);
let res = resolve(pkg_id("root"), vec![dep("foo")], ®).unwrap();
assert_same(&res, &names(&["root", "foo"]));
}
-#[test]
+#[cargo_test]
fn test_resolving_multiple_deps() {
let reg = registry(vec![pkg!("foo"), pkg!("bar"), pkg!("baz")]);
let res = resolve(pkg_id("root"), vec![dep("foo"), dep("baz")], ®).unwrap();
assert_same(&res, &names(&["root", "foo", "baz"]));
}
-#[test]
+#[cargo_test]
fn test_resolving_transitive_deps() {
let reg = registry(vec![pkg!("foo"), pkg!("bar" => ["foo"])]);
let res = resolve(pkg_id("root"), vec![dep("bar")], ®).unwrap();
assert_same(&res, &names(&["root", "foo", "bar"]));
}
-#[test]
+#[cargo_test]
fn test_resolving_common_transitive_deps() {
let reg = registry(vec![pkg!("foo" => ["bar"]), pkg!("bar")]);
let res = resolve(pkg_id("root"), vec![dep("foo"), dep("bar")], ®).unwrap();
assert_same(&res, &names(&["root", "foo", "bar"]));
}
-#[test]
+#[cargo_test]
fn test_resolving_with_same_name() {
let list = vec![
pkg_loc("foo", "https://first.example.com"),
assert_same(&res, &names);
}
-#[test]
+#[cargo_test]
fn test_resolving_with_dev_deps() {
let reg = registry(vec![
pkg!("foo" => ["bar", dep_kind("baz", Kind::Development)]),
assert_same(&res, &names(&["root", "foo", "bar", "baz", "bat"]));
}
-#[test]
+#[cargo_test]
fn resolving_with_many_versions() {
let reg = registry(vec![pkg!(("foo", "1.0.1")), pkg!(("foo", "1.0.2"))]);
assert_same(&res, &names(&[("root", "1.0.0"), ("foo", "1.0.2")]));
}
-#[test]
+#[cargo_test]
fn resolving_with_specific_version() {
let reg = registry(vec![pkg!(("foo", "1.0.1")), pkg!(("foo", "1.0.2"))]);
assert_same(&res, &names(&[("root", "1.0.0"), ("foo", "1.0.1")]));
}
-#[test]
+#[cargo_test]
fn test_resolving_maximum_version_with_transitive_deps() {
let reg = registry(vec![
pkg!(("util", "1.2.2")),
assert!(!res.contains(&("util", "1.1.1").to_pkgid()));
}
-#[test]
+#[cargo_test]
fn test_resolving_minimum_version_with_transitive_deps() {
enable_nightly_features(); // -Z minimal-versions
// When the minimal-versions config option is specified then the lowest
// Ensure that the "-Z minimal-versions" CLI option works and the minimal
// version of a dependency ends up in the lock file.
-#[test]
+#[cargo_test]
fn minimal_version_cli() {
Package::new("dep", "1.0.0").publish();
Package::new("dep", "1.1.0").publish();
assert!(lock.contains("dep 1.0.0"));
}
-#[test]
+#[cargo_test]
fn resolving_incompat_versions() {
let reg = registry(vec![
pkg!(("foo", "1.0.1")),
.is_err());
}
-#[test]
+#[cargo_test]
fn resolving_wrong_case_from_registry() {
// In the future we may #5678 allow this to happen.
// For back compatibility reasons, we probably won't.
assert!(resolve(pkg_id("root"), vec![dep("bar")], ®).is_err());
}
-#[test]
+#[cargo_test]
fn resolving_mis_hyphenated_from_registry() {
// In the future we may #2775 allow this to happen.
// For back compatibility reasons, we probably won't.
assert!(resolve(pkg_id("root"), vec![dep("bar")], ®).is_err());
}
-#[test]
+#[cargo_test]
fn resolving_backtrack() {
let reg = registry(vec![
pkg!(("foo", "1.0.2") => [dep("bar")]),
);
}
-#[test]
+#[cargo_test]
fn resolving_backtrack_features() {
// test for cargo/issues/4347
let mut bad = dep("bar");
);
}
-#[test]
+#[cargo_test]
fn resolving_allows_multiple_compatible_versions() {
let reg = registry(vec![
pkg!(("foo", "1.0.0")),
);
}
-#[test]
+#[cargo_test]
fn resolving_with_deep_backtracking() {
let reg = registry(vec![
pkg!(("foo", "1.0.1") => [dep_req("bar", "1")]),
);
}
-#[test]
+#[cargo_test]
fn resolving_with_sys_crates() {
// This is based on issues/4902
// With `l` a normal library we get 2copies so everyone gets the newest compatible.
);
}
-#[test]
+#[cargo_test]
fn resolving_with_constrained_sibling_backtrack_parent() {
// There is no point in considering all of the backtrack_trap{1,2}
// candidates since they can't change the result of failing to
);
}
-#[test]
+#[cargo_test]
fn resolving_with_many_equivalent_backtracking() {
let mut reglist = Vec::new();
assert!(res.is_err());
}
-#[test]
+#[cargo_test]
fn resolving_with_deep_traps() {
let mut reglist = Vec::new();
assert!(res.is_err());
}
-#[test]
+#[cargo_test]
fn resolving_with_constrained_cousins_backtrack() {
let mut reglist = Vec::new();
);
}
-#[test]
+#[cargo_test]
fn resolving_with_constrained_sibling_backtrack_activation() {
// It makes sense to resolve most-constrained deps first, but
// with that logic the backtrack traps here come between the two
);
}
-#[test]
+#[cargo_test]
fn resolving_with_constrained_sibling_transitive_dep_effects() {
// When backtracking due to a failed dependency, if Cargo is
// trying to be clever and skip irrelevant dependencies, care must
);
}
-#[test]
+#[cargo_test]
fn incomplete_information_skipping() {
// When backtracking due to a failed dependency, if Cargo is
// trying to be clever and skip irrelevant dependencies, care must
assert!(resolve(pkg_id("root"), vec![dep("g")], &new_reg).is_ok());
}
-#[test]
+#[cargo_test]
fn incomplete_information_skipping_2() {
// When backtracking due to a failed dependency, if Cargo is
// trying to be clever and skip irrelevant dependencies, care must
assert!(resolve(pkg_id("root"), vec![dep("i")], &new_reg).is_ok());
}
-#[test]
+#[cargo_test]
fn incomplete_information_skipping_3() {
// When backtracking due to a failed dependency, if Cargo is
// trying to be clever and skip irrelevant dependencies, care must
assert!(resolve(pkg_id("root"), vec![dep("b")], &new_reg).is_ok());
}
-#[test]
+#[cargo_test]
fn resolving_but_no_exists() {
let reg = registry(vec![]);
);
}
-#[test]
+#[cargo_test]
fn resolving_cycle() {
let reg = registry(vec![pkg!("foo" => ["foo"])]);
let _ = resolve(pkg_id("root"), vec![dep_req("foo", "1")], ®);
}
-#[test]
+#[cargo_test]
fn hard_equality() {
let reg = registry(vec![
pkg!(("foo", "1.0.1")),
);
}
-#[test]
+#[cargo_test]
fn large_conflict_cache() {
let mut input = vec![
pkg!(("last", "0.0.0") => [dep("bad")]), // just to make sure last is less constrained
let _ = resolve(pkg_id("root"), root_deps, ®);
}
-#[test]
+#[cargo_test]
fn conflict_store_bug() {
let input = vec![
pkg!(("A", "0.0.3")),
let _ = resolve_and_validated(pkg_id("root"), vec![dep("j")], ®, None);
}
-#[test]
+#[cargo_test]
fn conflict_store_more_then_one_match() {
let input = vec![
pkg!(("A", "0.0.0")),
use crate::support::{basic_bin_manifest, basic_lib_manifest, project, Project};
use cargo::util::paths::dylib_path_envvar;
-#[test]
+#[cargo_test]
fn simple() {
let p = project()
.file("src/main.rs", r#"fn main() { println!("hello"); }"#)
assert!(p.bin("foo").is_file());
}
-#[test]
+#[cargo_test]
fn simple_quiet() {
let p = project()
.file("src/main.rs", r#"fn main() { println!("hello"); }"#)
p.cargo("run --quiet").with_stdout("hello").run();
}
-#[test]
+#[cargo_test]
fn simple_quiet_and_verbose() {
let p = project()
.file("src/main.rs", r#"fn main() { println!("hello"); }"#)
.run();
}
-#[test]
+#[cargo_test]
fn quiet_and_verbose_config() {
let p = project()
.file(
p.cargo("run -q").run();
}
-#[test]
+#[cargo_test]
fn simple_with_args() {
let p = project()
.file(
}
#[cfg(unix)]
-#[test]
+#[cargo_test]
fn simple_with_non_utf8_args() {
use std::os::unix::ffi::OsStrExt;
.run();
}
-#[test]
+#[cargo_test]
fn exit_code() {
let p = project()
.file("src/main.rs", "fn main() { std::process::exit(2); }")
p.cargo("run").with_status(2).with_stderr(output).run();
}
-#[test]
+#[cargo_test]
fn exit_code_verbose() {
let p = project()
.file("src/main.rs", "fn main() { std::process::exit(2); }")
p.cargo("run -v").with_status(2).with_stderr(output).run();
}
-#[test]
+#[cargo_test]
fn no_main_file() {
let p = project().file("src/lib.rs", "").build();
.run();
}
-#[test]
+#[cargo_test]
fn too_many_bins() {
let p = project()
.file("src/lib.rs", "")
.run();
}
-#[test]
+#[cargo_test]
fn specify_name() {
let p = project()
.file("src/lib.rs", "")
.run();
}
-#[test]
+#[cargo_test]
fn specify_default_run() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn bogus_default_run() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn default_run_unstable() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn run_example() {
let p = project()
.file("src/lib.rs", "")
.run();
}
-#[test]
+#[cargo_test]
fn run_library_example() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn run_bin_example() {
let p = project()
.file(
.build()
}
-#[test]
+#[cargo_test]
fn run_example_autodiscover_2015() {
let p = autodiscover_examples_project("2015", None);
p.cargo("run --example a")
.run();
}
-#[test]
+#[cargo_test]
fn run_example_autodiscover_2015_with_autoexamples_enabled() {
let p = autodiscover_examples_project("2015", Some(true));
p.cargo("run --example a")
.run();
}
-#[test]
+#[cargo_test]
fn run_example_autodiscover_2015_with_autoexamples_disabled() {
let p = autodiscover_examples_project("2015", Some(false));
p.cargo("run --example a")
.run();
}
-#[test]
+#[cargo_test]
fn run_example_autodiscover_2018() {
let p = autodiscover_examples_project("2018", None);
p.cargo("run --example a")
.run();
}
-#[test]
+#[cargo_test]
fn autobins_disables() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn run_bins() {
let p = project()
.file("src/lib.rs", "")
.run();
}
-#[test]
+#[cargo_test]
fn run_with_filename() {
let p = project()
.file("src/lib.rs", "")
.run();
}
-#[test]
+#[cargo_test]
fn either_name_or_example() {
let p = project()
.file("src/bin/a.rs", r#"fn main() { println!("hello a.rs"); }"#)
.run();
}
-#[test]
+#[cargo_test]
fn one_bin_multiple_examples() {
let p = project()
.file("src/lib.rs", "")
.run();
}
-#[test]
+#[cargo_test]
fn example_with_release_flag() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn run_dylib_dep() {
let p = project()
.file(
p.cargo("run hello world").run();
}
-#[test]
+#[cargo_test]
fn release_works() {
let p = project()
.file(
assert!(p.release_bin("foo").is_file());
}
-#[test]
+#[cargo_test]
fn run_bin_different_name() {
let p = project()
.file(
p.cargo("run").run();
}
-#[test]
+#[cargo_test]
fn dashes_are_forwarded() {
let p = project()
.file(
p.cargo("run -- -- a -- b").run();
}
-#[test]
+#[cargo_test]
fn run_from_executable_folder() {
let p = project()
.file("src/main.rs", r#"fn main() { println!("hello"); }"#)
.run();
}
-#[test]
+#[cargo_test]
fn run_with_library_paths() {
let p = project();
p.cargo("run").run();
}
-#[test]
+#[cargo_test]
fn library_paths_sorted_alphabetically() {
let p = project();
p.cargo("run").run();
}
-#[test]
+#[cargo_test]
fn fail_no_extra_verbose() {
let p = project()
.file("src/main.rs", "fn main() { std::process::exit(1); }")
.run();
}
-#[test]
+#[cargo_test]
fn run_multiple_packages() {
let p = project()
.no_manifest()
.run();
}
-#[test]
+#[cargo_test]
fn explicit_bin_with_args() {
let p = project()
.file(
p.cargo("run --bin foo hello world").run();
}
-#[test]
+#[cargo_test]
fn run_workspace() {
let p = project()
.file(
p.cargo("run --bin a").with_stdout("run-a").run();
}
-#[test]
+#[cargo_test]
fn default_run_workspace() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
#[cfg(target_os = "macos")]
fn run_link_system_path_macos() {
use crate::support::paths::{self, CargoPathExt};
"[ERROR] extra arguments to `rustc` can only be passed to one target, consider filtering
the package by passing, e.g., `--lib` or `--bin NAME` to specify a single target";
-#[test]
+#[cargo_test]
fn build_lib_for_foo() {
let p = project()
.file("src/main.rs", "fn main() {}")
.run();
}
-#[test]
+#[cargo_test]
fn lib() {
let p = project()
.file("src/main.rs", "fn main() {}")
.run();
}
-#[test]
+#[cargo_test]
fn build_main_and_allow_unstable_options() {
let p = project()
.file("src/main.rs", "fn main() {}")
.run();
}
-#[test]
+#[cargo_test]
fn fails_when_trying_to_build_main_and_lib_with_args() {
let p = project()
.file("src/main.rs", "fn main() {}")
.run();
}
-#[test]
+#[cargo_test]
fn build_with_args_to_one_of_multiple_binaries() {
let p = project()
.file("src/bin/foo.rs", "fn main() {}")
.run();
}
-#[test]
+#[cargo_test]
fn fails_with_args_to_all_binaries() {
let p = project()
.file("src/bin/foo.rs", "fn main() {}")
.run();
}
-#[test]
+#[cargo_test]
fn build_with_args_to_one_of_multiple_tests() {
let p = project()
.file("tests/foo.rs", r#" "#)
.run();
}
-#[test]
+#[cargo_test]
fn build_foo_with_bar_dependency() {
let foo = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn build_only_bar_dependency() {
let foo = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn targets_selected_default() {
let p = project().file("src/main.rs", "fn main() {}").build();
p.cargo("rustc -v")
.run();
}
-#[test]
+#[cargo_test]
fn targets_selected_all() {
let p = project().file("src/main.rs", "fn main() {}").build();
p.cargo("rustc -v --all-targets")
.run();
}
-#[test]
+#[cargo_test]
fn fail_with_multiple_packages() {
let foo = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn rustc_with_other_profile() {
let p = project()
.file(
p.cargo("rustc --profile test").run();
}
-#[test]
+#[cargo_test]
fn rustc_fingerprint() {
// Verify that the fingerprint includes the rustc args.
let p = project()
.run();
}
-#[test]
+#[cargo_test]
fn rustc_test_with_implicit_bin() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
use crate::support::{basic_manifest, project};
use std::env;
-#[test]
+#[cargo_test]
fn rustc_info_cache() {
let p = project()
.file("src/main.rs", r#"fn main() { println!("hello"); }"#)
use crate::support::{basic_manifest, project};
-#[test]
+#[cargo_test]
fn rustdoc_simple() {
let p = project().file("src/lib.rs", "").build();
.run();
}
-#[test]
+#[cargo_test]
fn rustdoc_args() {
let p = project().file("src/lib.rs", "").build();
.run();
}
-#[test]
+#[cargo_test]
fn rustdoc_foo_with_bar_dependency() {
let foo = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn rustdoc_only_bar_dependency() {
let foo = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn rustdoc_same_name_documents_lib() {
let p = project()
.file("src/main.rs", "fn main() {}")
.run();
}
-#[test]
+#[cargo_test]
fn features() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
#[cfg(all(target_arch = "x86_64", target_os = "linux", target_env = "gnu"))]
fn rustdoc_target() {
let p = project().file("src/lib.rs", "").build();
use crate::support::project;
-#[test]
+#[cargo_test]
fn parses_env() {
let p = project().file("src/lib.rs", "").build();
.run();
}
-#[test]
+#[cargo_test]
fn parses_config() {
let p = project()
.file("src/lib.rs", "")
.run();
}
-#[test]
+#[cargo_test]
fn bad_flags() {
let p = project().file("src/lib.rs", "").build();
.run();
}
-#[test]
+#[cargo_test]
fn rerun() {
let p = project().file("src/lib.rs", "").build();
.run();
}
-#[test]
+#[cargo_test]
fn rustdocflags_passed_to_rustdoc_through_cargo_test() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn rustdocflags_passed_to_rustdoc_through_cargo_test_only_once() {
let p = project().file("src/lib.rs", "").build();
.run();
}
-#[test]
+#[cargo_test]
fn rustdocflags_misspelled() {
let p = project().file("src/main.rs", "fn main() { }").build();
use crate::support::rustc_host;
use crate::support::{basic_lib_manifest, basic_manifest, paths, project, project_in_home};
-#[test]
+#[cargo_test]
fn env_rustflags_normal_source() {
let p = project()
.file("src/lib.rs", "")
.run();
}
-#[test]
+#[cargo_test]
fn env_rustflags_build_script() {
// RUSTFLAGS should be passed to rustc for build scripts
// when --target is not specified.
p.cargo("build").env("RUSTFLAGS", "--cfg foo").run();
}
-#[test]
+#[cargo_test]
fn env_rustflags_build_script_dep() {
// RUSTFLAGS should be passed to rustc for build scripts
// when --target is not specified.
foo.cargo("build").env("RUSTFLAGS", "--cfg foo").run();
}
-#[test]
+#[cargo_test]
fn env_rustflags_plugin() {
// RUSTFLAGS should be passed to rustc for plugins
// when --target is not specified.
p.cargo("build").env("RUSTFLAGS", "--cfg foo").run();
}
-#[test]
+#[cargo_test]
fn env_rustflags_plugin_dep() {
// RUSTFLAGS should be passed to rustc for plugins
// when --target is not specified.
foo.cargo("build").env("RUSTFLAGS", "--cfg foo").run();
}
-#[test]
+#[cargo_test]
fn env_rustflags_normal_source_with_target() {
let p = project()
.file("src/lib.rs", "")
.run();
}
-#[test]
+#[cargo_test]
fn env_rustflags_build_script_with_target() {
// RUSTFLAGS should not be passed to rustc for build scripts
// when --target is specified.
.run();
}
-#[test]
+#[cargo_test]
fn env_rustflags_build_script_dep_with_target() {
// RUSTFLAGS should not be passed to rustc for build scripts
// when --target is specified.
.run();
}
-#[test]
+#[cargo_test]
fn env_rustflags_plugin_with_target() {
// RUSTFLAGS should not be passed to rustc for plugins
// when --target is specified.
.run();
}
-#[test]
+#[cargo_test]
fn env_rustflags_plugin_dep_with_target() {
// RUSTFLAGS should not be passed to rustc for plugins
// when --target is specified.
.run();
}
-#[test]
+#[cargo_test]
fn env_rustflags_recompile() {
let p = project().file("src/lib.rs", "").build();
.run();
}
-#[test]
+#[cargo_test]
fn env_rustflags_recompile2() {
let p = project().file("src/lib.rs", "").build();
.run();
}
-#[test]
+#[cargo_test]
fn env_rustflags_no_recompile() {
let p = project().file("src/lib.rs", "").build();
.run();
}
-#[test]
+#[cargo_test]
fn build_rustflags_normal_source() {
let p = project()
.file("src/lib.rs", "")
.run();
}
-#[test]
+#[cargo_test]
fn build_rustflags_build_script() {
// RUSTFLAGS should be passed to rustc for build scripts
// when --target is not specified.
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn build_rustflags_build_script_dep() {
// RUSTFLAGS should be passed to rustc for build scripts
// when --target is not specified.
foo.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn build_rustflags_plugin() {
// RUSTFLAGS should be passed to rustc for plugins
// when --target is not specified.
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn build_rustflags_plugin_dep() {
// RUSTFLAGS should be passed to rustc for plugins
// when --target is not specified.
foo.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn build_rustflags_normal_source_with_target() {
let p = project()
.file("src/lib.rs", "")
.run();
}
-#[test]
+#[cargo_test]
fn build_rustflags_build_script_with_target() {
// RUSTFLAGS should not be passed to rustc for build scripts
// when --target is specified.
p.cargo("build --target").arg(host).run();
}
-#[test]
+#[cargo_test]
fn build_rustflags_build_script_dep_with_target() {
// RUSTFLAGS should not be passed to rustc for build scripts
// when --target is specified.
foo.cargo("build --target").arg(host).run();
}
-#[test]
+#[cargo_test]
fn build_rustflags_plugin_with_target() {
// RUSTFLAGS should not be passed to rustc for plugins
// when --target is specified.
p.cargo("build --target").arg(host).run();
}
-#[test]
+#[cargo_test]
fn build_rustflags_plugin_dep_with_target() {
// RUSTFLAGS should not be passed to rustc for plugins
// when --target is specified.
foo.cargo("build --target").arg(host).run();
}
-#[test]
+#[cargo_test]
fn build_rustflags_recompile() {
let p = project().file("src/lib.rs", "").build();
.run();
}
-#[test]
+#[cargo_test]
fn build_rustflags_recompile2() {
let p = project().file("src/lib.rs", "").build();
.run();
}
-#[test]
+#[cargo_test]
fn build_rustflags_no_recompile() {
let p = project()
.file("src/lib.rs", "")
.run();
}
-#[test]
+#[cargo_test]
fn build_rustflags_with_home_config() {
// We need a config file inside the home directory
let home = paths::home();
p.cargo("build -v").run();
}
-#[test]
+#[cargo_test]
fn target_rustflags_normal_source() {
let p = project()
.file("src/lib.rs", "")
}
// target.{}.rustflags takes precedence over build.rustflags
-#[test]
+#[cargo_test]
fn target_rustflags_precedence() {
let p = project()
.file("src/lib.rs", "")
.run();
}
-#[test]
+#[cargo_test]
fn cfg_rustflags_normal_source() {
let p = project()
.file("src/lib.rs", "pub fn t() {}")
}
// target.'cfg(...)'.rustflags takes precedence over build.rustflags
-#[test]
+#[cargo_test]
fn cfg_rustflags_precedence() {
let p = project()
.file("src/lib.rs", "pub fn t() {}")
.run();
}
-#[test]
+#[cargo_test]
fn target_rustflags_string_and_array_form1() {
let p1 = project()
.file("src/lib.rs", "")
.run();
}
-#[test]
+#[cargo_test]
fn target_rustflags_string_and_array_form2() {
let p1 = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn two_matching_in_config() {
let p1 = project()
.file(
p1.cargo("build").with_stderr("[FINISHED] [..]").run();
}
-#[test]
+#[cargo_test]
fn env_rustflags_misspelled() {
let p = project().file("src/main.rs", "fn main() { }").build();
}
}
-#[test]
+#[cargo_test]
fn env_rustflags_misspelled_build_script() {
let p = project()
.file(
.unwrap();
}
-#[test]
+#[cargo_test]
fn not_update() {
setup();
set_cargo_config();
.run();
}
-#[test]
+#[cargo_test]
fn replace_default() {
setup();
set_cargo_config();
.run();
}
-#[test]
+#[cargo_test]
fn simple() {
setup();
// TODO: Deprecated
// remove once it has been decided '--host' can be safely removed
-#[test]
+#[cargo_test]
fn simple_with_host() {
setup();
// TODO: Deprecated
// remove once it has been decided '--host' can be safely removed
-#[test]
+#[cargo_test]
fn simple_with_index_and_host() {
setup();
.run();
}
-#[test]
+#[cargo_test]
fn multiple_query_params() {
setup();
.run();
}
-#[test]
+#[cargo_test]
fn help() {
cargo_process("search -h").run();
cargo_process("help search").run();
use crate::support::project;
-#[test]
+#[cargo_test]
fn features_are_quoted() {
let p = project()
.file(
);
}
-#[test]
+#[cargo_test]
fn use_git_gc() {
if Command::new("git").arg("--version").output().is_err() {
return;
run_test(None);
}
-#[test]
+#[cargo_test]
// it looks like this test passes on some windows machines but not others,
// notably not on AppVeyor's machines. Sounds like another but for another day.
#[cfg_attr(windows, ignore)]
actual.is_empty() || expected.ends_with("[..]")
}
-#[test]
+#[cargo_test]
fn lines_match_works() {
assert!(lines_match("a b", "a b"));
assert!(lines_match("a[..]b", "a b"));
}
}
-#[test]
+#[cargo_test]
fn meta_test_deep_pretty_print_registry() {
assert_eq!(
&format!(
/// This test is to test the generator to ensure
/// that it makes registries with large dependency trees
-#[test]
+#[cargo_test]
fn meta_test_deep_trees_from_strategy() {
let mut dis = [0; 21];
/// This test is to test the generator to ensure
/// that it makes registries that include multiple versions of the same library
-#[test]
+#[cargo_test]
fn meta_test_multiple_versions_strategy() {
let mut dis = [0; 10];
use crate::support::{basic_bin_manifest, basic_lib_manifest, basic_manifest, cargo_exe, project};
use crate::support::{rustc_host, sleep_ms};
-#[test]
+#[cargo_test]
fn cargo_test_simple() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn cargo_test_release() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn cargo_test_overflow_checks() {
let p = project()
.file(
p.process(&p.release_bin("foo")).with_stdout("").run();
}
-#[test]
+#[cargo_test]
fn cargo_test_quiet_with_harness() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn cargo_test_quiet_no_harness() {
let p = project()
.file(
p.cargo("test -q").with_stdout("").with_stderr("").run();
}
-#[test]
+#[cargo_test]
fn cargo_test_verbose() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn many_similar_names() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn cargo_test_failing_test_in_bin() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn cargo_test_failing_test_in_test() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn cargo_test_failing_test_in_lib() {
let p = project()
.file("Cargo.toml", &basic_lib_manifest("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn test_with_lib_dep() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn test_with_deep_lib_dep() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn external_test_explicit() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn external_test_named_test() {
let p = project()
.file(
p.cargo("test").run();
}
-#[test]
+#[cargo_test]
fn external_test_implicit() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn dont_run_examples() {
let p = project()
.file("src/lib.rs", "")
p.cargo("test").run();
}
-#[test]
+#[cargo_test]
fn pass_through_command_line() {
let p = project()
.file(
// Regression test for running cargo-test twice with
// tests in an rlib
-#[test]
+#[cargo_test]
fn cargo_test_twice() {
let p = project()
.file("Cargo.toml", &basic_lib_manifest("foo"))
}
}
-#[test]
+#[cargo_test]
fn lib_bin_same_name() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn lib_with_standard_name() {
let p = project()
.file("Cargo.toml", &basic_manifest("syntax", "0.0.1"))
.run();
}
-#[test]
+#[cargo_test]
fn lib_with_standard_name2() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn lib_without_name() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn bin_without_name() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn bench_without_name() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn test_without_name() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn example_without_name() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn bin_there_for_integration() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn test_dylib() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn test_twice_with_build_cmd() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn test_then_build() {
let p = project().file("src/lib.rs", "#[test] fn foo() {}").build();
p.cargo("build").with_stdout("").run();
}
-#[test]
+#[cargo_test]
fn test_no_run() {
let p = project()
.file("src/lib.rs", "#[test] fn foo() { panic!() }")
.run();
}
-#[test]
+#[cargo_test]
fn test_run_specific_bin_target() {
let prj = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn test_run_implicit_bin_target() {
let prj = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn test_run_specific_test_target() {
let prj = project()
.file("src/bin/a.rs", "fn main() { }")
.run();
}
-#[test]
+#[cargo_test]
fn test_run_implicit_test_target() {
let prj = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn test_run_implicit_bench_target() {
let prj = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn test_run_implicit_example_target() {
let prj = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn test_filtered_excludes_compiling_examples() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn test_no_harness() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn selective_testing() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn almost_cyclic_but_not_quite() {
let p = project()
.file(
p.cargo("test").run();
}
-#[test]
+#[cargo_test]
fn build_then_selective_test() {
let p = project()
.file(
p.cargo("test -p b").run();
}
-#[test]
+#[cargo_test]
fn example_dev_dep() {
let p = project()
.file(
p.cargo("run --example e1 --release -v").run();
}
-#[test]
+#[cargo_test]
fn selective_testing_with_docs() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn example_bin_same_name() {
let p = project()
.file("src/bin/foo.rs", r#"fn main() { println!("bin"); }"#)
assert!(p.bin("foo").is_file());
}
-#[test]
+#[cargo_test]
fn test_with_example_twice() {
let p = project()
.file("src/bin/foo.rs", r#"fn main() { println!("bin"); }"#)
assert!(p.bin("examples/foo").is_file());
}
-#[test]
+#[cargo_test]
fn example_with_dev_dep() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn bin_is_preserved() {
let p = project()
.file("src/lib.rs", "")
assert!(p.bin("foo").is_file());
}
-#[test]
+#[cargo_test]
fn bad_example() {
let p = project().file("src/lib.rs", "");
let p = p.build();
.run();
}
-#[test]
+#[cargo_test]
fn doctest_feature() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn dashes_to_underscores() {
let p = project()
.file("Cargo.toml", &basic_manifest("foo-bar", "0.0.1"))
p.cargo("test -v").run();
}
-#[test]
+#[cargo_test]
fn doctest_dev_dep() {
let p = project()
.file(
p.cargo("test -v").run();
}
-#[test]
+#[cargo_test]
fn filter_no_doc_tests() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn dylib_doctest() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn dylib_doctest2() {
// Can't doc-test dylibs, as they're statically linked together.
let p = project()
p.cargo("test").with_stdout("").run();
}
-#[test]
+#[cargo_test]
fn cyclic_dev_dep_doc_test() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn dev_dep_with_build_script() {
let p = project()
.file(
p.cargo("test").run();
}
-#[test]
+#[cargo_test]
fn no_fail_fast() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn test_multiple_packages() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn bin_does_not_rebuild_tests() {
let p = project()
.file("src/lib.rs", "")
.run();
}
-#[test]
+#[cargo_test]
fn selective_test_wonky_profile() {
let p = project()
.file(
p.cargo("test -v --no-run --release -p foo -p a").run();
}
-#[test]
+#[cargo_test]
fn selective_test_optional_dep() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn only_test_docs() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn test_panic_abort_with_dep() {
let p = project()
.file(
p.cargo("test -v").run();
}
-#[test]
+#[cargo_test]
fn cfg_test_even_with_no_harness() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn panic_abort_multiple() {
let p = project()
.file(
p.cargo("test --release -v -p foo -p a").run();
}
-#[test]
+#[cargo_test]
fn pass_correct_cfgs_flags_to_rustdoc() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn test_release_ignore_panic() {
let p = project()
.file(
p.cargo("bench -v").run();
}
-#[test]
+#[cargo_test]
fn test_many_with_features() {
let p = project()
.file(
p.cargo("test -v -p a -p foo --features foo").run();
}
-#[test]
+#[cargo_test]
fn test_all_workspace() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn test_all_exclude() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn test_all_virtual_manifest() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn test_virtual_manifest_all_implied() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn test_all_member_dependency_same_name() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn doctest_only_with_dev_dep() {
let p = project()
.file(
p.cargo("test --doc -v").run();
}
-#[test]
+#[cargo_test]
fn test_many_targets() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn doctest_and_registry() {
let p = project()
.file(
p.cargo("test --all -v").run();
}
-#[test]
+#[cargo_test]
fn cargo_test_env() {
let src = format!(
r#"
.run();
}
-#[test]
+#[cargo_test]
fn test_order() {
let p = project()
.file("src/lib.rs", "#[test] fn test_lib() {}")
.run();
}
-#[test]
+#[cargo_test]
fn cyclic_dev() {
let p = project()
.file(
p.cargo("test --all").run();
}
-#[test]
+#[cargo_test]
fn publish_a_crate_without_tests() {
Package::new("testless", "0.1.0")
.file(
p.cargo("test --package testless").run();
}
-#[test]
+#[cargo_test]
fn find_dependency_of_proc_macro_dependency_with_target() {
let p = project()
.file(
p.cargo("test --all --target").arg(rustc_host()).run();
}
-#[test]
+#[cargo_test]
fn test_hint_not_masked_by_doctest() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn test_hint_workspace_virtual() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn test_hint_workspace_nonvirtual() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn json_artifact_includes_test_flag() {
// Verify that the JSON artifact output includes `test` flag.
let p = project()
.run();
}
-#[test]
+#[cargo_test]
fn json_artifact_includes_executable_for_library_tests() {
let p = project()
.file("src/main.rs", "fn main() { }")
.run();
}
-#[test]
+#[cargo_test]
fn json_artifact_includes_executable_for_integration_tests() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn test_build_script_links() {
let p = project()
.file(
p.cargo("test --no-run").run();
}
-#[test]
+#[cargo_test]
fn doctest_skip_staticlib() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn can_not_mix_doc_tests_and_regular_tests() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn can_not_no_run_doc_tests() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn test_all_targets_lib() {
let p = project().file("src/lib.rs", "").build();
.run();
}
-#[test]
+#[cargo_test]
fn test_dep_with_dev() {
Package::new("devdep", "0.1.0").publish();
let p = project()
use crate::support::rustc_host;
use crate::support::{basic_lib_manifest, project};
-#[test]
+#[cargo_test]
fn pathless_tools() {
let target = rustc_host();
.run();
}
-#[test]
+#[cargo_test]
fn absolute_tools() {
let target = rustc_host();
").run();
}
-#[test]
+#[cargo_test]
fn relative_tools() {
let target = rustc_host();
)).run();
}
-#[test]
+#[cargo_test]
fn custom_runner() {
let target = rustc_host();
}
// can set a custom runner via `target.'cfg(..)'.runner`
-#[test]
+#[cargo_test]
fn custom_runner_cfg() {
let p = project()
.file("src/main.rs", "fn main() {}")
}
// custom runner set via `target.$triple.runner` have precende over `target.'cfg(..)'.runner`
-#[test]
+#[cargo_test]
fn custom_runner_cfg_precedence() {
let target = rustc_host();
.run();
}
-#[test]
+#[cargo_test]
fn custom_runner_cfg_collision() {
let p = project()
.file("src/main.rs", "fn main() {}")
use crate::support::registry::Package;
use crate::support::{basic_manifest, project};
-#[test]
+#[cargo_test]
fn minor_update_two_places() {
Package::new("log", "0.1.0").publish();
let p = project()
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn transitive_minor_update() {
Package::new("log", "0.1.0").publish();
Package::new("serde", "0.1.0").dep("log", "0.1").publish();
.run();
}
-#[test]
+#[cargo_test]
fn conservative() {
Package::new("log", "0.1.0").publish();
Package::new("serde", "0.1.0").dep("log", "0.1").publish();
.run();
}
-#[test]
+#[cargo_test]
fn update_via_new_dep() {
Package::new("log", "0.1.0").publish();
let p = project()
p.cargo("build").env("CARGO_LOG", "cargo=trace").run();
}
-#[test]
+#[cargo_test]
fn update_via_new_member() {
Package::new("log", "0.1.0").publish();
let p = project()
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn add_dep_deep_new_requirement() {
Package::new("log", "0.1.0").publish();
let p = project()
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn everything_real_deep() {
Package::new("log", "0.1.0").publish();
Package::new("foo", "0.1.0").dep("log", "0.1").publish();
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn change_package_version() {
let p = project()
.file(
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn update_precise() {
Package::new("log", "0.1.0").publish();
Package::new("serde", "0.1.0").publish();
// cargo update should respect its arguments even without a lockfile.
// See issue "Running cargo update without a Cargo.lock ignores arguments"
// at <https://github.com/rust-lang/cargo/issues/6872>.
-#[test]
+#[cargo_test]
fn update_precise_first_run() {
Package::new("serde", "0.1.0").publish();
Package::new("serde", "0.2.0").publish();
.run();
}
-#[test]
+#[cargo_test]
fn preserve_top_comment() {
let p = project().file("src/lib.rs", "").build();
assert_eq!(lockfile, lockfile2);
}
-#[test]
+#[cargo_test]
fn dry_run_update() {
Package::new("log", "0.1.0").publish();
Package::new("serde", "0.1.0").dep("log", "0.1").publish();
use crate::support::registry::Package;
use crate::support::{basic_lib_manifest, project, Project};
-#[test]
+#[cargo_test]
fn vendor_simple() {
let p = project()
.file(
);
}
-#[test]
+#[cargo_test]
fn two_versions() {
let p = project()
.file(
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn help() {
let p = project().build();
p.cargo("vendor -h").run();
}
-#[test]
+#[cargo_test]
fn update_versions() {
let p = project()
.file(
assert!(lock.contains("version = \"0.8.0\""));
}
-#[test]
+#[cargo_test]
fn two_lockfiles() {
let p = project()
.no_manifest()
p.cargo("build").cwd("bar").run();
}
-#[test]
+#[cargo_test]
fn delete_old_crates() {
let p = project()
.file(
assert!(!p.root().join("vendor/bitflags/Cargo.toml").exists());
}
-#[test]
+#[cargo_test]
fn ignore_files() {
let p = project()
.file(
assert!(!csum.contains("foo.rej"));
}
-#[test]
+#[cargo_test]
fn included_files_only() {
let git = git::new("a", |p| {
p.file("Cargo.toml", &basic_lib_manifest("a"))
assert!(!csum.contains("a/b.md"));
}
-#[test]
+#[cargo_test]
fn dependent_crates_in_crates() {
let git = git::new("a", |p| {
p.file(
p.read_file("vendor/b/.cargo-checksum.json");
}
-#[test]
+#[cargo_test]
fn vendoring_git_crates() {
let git = git::new("git", |p| {
p.file("Cargo.toml", &basic_lib_manifest("serde_derive"))
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn git_simple() {
let git = git::new("git", |p| {
p.file("Cargo.toml", &basic_lib_manifest("a"))
assert!(csum.contains("\"package\":null"));
}
-#[test]
+#[cargo_test]
fn git_duplicate() {
let git = git::new("a", |p| {
p.file(
.run();
}
-#[test]
+#[cargo_test]
fn depend_on_vendor_dir_not_deleted() {
let p = project()
.file(
r#"{"success":"true"}"#.into()
}
-#[test]
+#[cargo_test]
fn cargo_verify_project_path_to_cargo_toml_relative() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn cargo_verify_project_path_to_cargo_toml_absolute() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn cargo_verify_project_cwd() {
let p = project()
.file("Cargo.toml", &basic_bin_manifest("foo"))
.run();
}
-#[test]
+#[cargo_test]
fn cargo_verify_project_honours_unstable_features() {
let p = project()
.file(
use crate::support::project;
use cargo;
-#[test]
+#[cargo_test]
fn simple() {
let p = project().build();
.run();
}
-#[test]
+#[cargo_test]
#[cfg_attr(target_os = "windows", ignore)]
fn version_works_without_rustc() {
let p = project().build();
p.cargo("version").env("PATH", "").run();
}
-#[test]
+#[cargo_test]
fn version_works_with_bad_config() {
let p = project().file(".cargo/config", "this is not toml").build();
p.cargo("version").run();
}
-#[test]
+#[cargo_test]
fn version_works_with_bad_target_dir() {
let p = project()
.file(
.build()
}
-#[test]
+#[cargo_test]
fn no_warning_on_success() {
make_lib("");
let upstream = make_upstream("");
.run();
}
-#[test]
+#[cargo_test]
fn no_warning_on_bin_failure() {
make_lib("");
let upstream = make_upstream("hi()");
.run();
}
-#[test]
+#[cargo_test]
fn warning_on_lib_failure() {
make_lib("err()");
let upstream = make_upstream("");
use crate::support::sleep_ms;
use crate::support::{basic_lib_manifest, basic_manifest, git, project};
-#[test]
+#[cargo_test]
fn simple_explicit() {
let p = project()
.file(
assert!(!p.root().join("bar/Cargo.lock").is_file());
}
-#[test]
+#[cargo_test]
fn simple_explicit_default_members() {
let p = project()
.file(
assert!(!p.bin("foo").is_file());
}
-#[test]
+#[cargo_test]
fn inferred_root() {
let p = project()
.file(
assert!(!p.root().join("bar/Cargo.lock").is_file());
}
-#[test]
+#[cargo_test]
fn inferred_path_dep() {
let p = project()
.file(
assert!(!p.root().join("bar/Cargo.lock").is_file());
}
-#[test]
+#[cargo_test]
fn transitive_path_dep() {
let p = project()
.file(
assert!(!p.root().join("baz/Cargo.lock").is_file());
}
-#[test]
+#[cargo_test]
fn parent_pointer_works() {
let p = project()
.file(
assert!(!p.root().join("bar/Cargo.lock").is_file());
}
-#[test]
+#[cargo_test]
fn same_names_in_workspace() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn parent_doesnt_point_to_child() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn invalid_parent_pointer() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn invalid_members() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn bare_workspace_ok() {
let p = project()
.file(
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn two_roots() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn workspace_isnt_root() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn dangling_member() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn cycle() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn share_dependencies() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn fetch_fetches_all() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn lock_works_for_everyone() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn virtual_works() {
let p = project()
.file(
assert!(!p.root().join("bar/Cargo.lock").is_file());
}
-#[test]
+#[cargo_test]
fn explicit_package_argument_works_with_virtual_manifest() {
let p = project()
.file(
assert!(!p.root().join("bar/Cargo.lock").is_file());
}
-#[test]
+#[cargo_test]
fn virtual_misconfigure() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn virtual_build_all_implied() {
let p = project()
.file(
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn virtual_default_members() {
let p = project()
.file(
assert!(!p.bin("baz").is_file());
}
-#[test]
+#[cargo_test]
fn virtual_default_member_is_not_a_member() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn virtual_build_no_members() {
let p = project().file(
"Cargo.toml",
.run();
}
-#[test]
+#[cargo_test]
fn include_virtual() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn members_include_path_deps() {
let p = project()
.file(
assert!(!p.root().join("p3/target").is_dir());
}
-#[test]
+#[cargo_test]
fn new_warns_you_this_will_not_work() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn new_warning_with_corrupt_ws() {
let p = project().file("Cargo.toml", "asdf").build();
p.cargo("new bar")
.run();
}
-#[test]
+#[cargo_test]
fn lock_doesnt_change_depending_on_crate() {
let p = project()
.file(
assert_eq!(lockfile, lockfile2);
}
-#[test]
+#[cargo_test]
fn rebuild_please() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn workspace_in_git() {
let git_project = git::new("dep1", |project| {
project
p.cargo("build").run();
}
-#[test]
+#[cargo_test]
fn lockfile_can_specify_nonexistant_members() {
let p = project()
.file(
p.cargo("build").cwd("a").run();
}
-#[test]
+#[cargo_test]
fn you_cannot_generate_lockfile_for_empty_workspaces() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn workspace_with_transitive_dev_deps() {
let p = project()
.file(
p.cargo("test -p bar").run();
}
-#[test]
+#[cargo_test]
fn error_if_parent_cargo_toml_is_invalid() {
let p = project()
.file("Cargo.toml", "Totally not a TOML file")
.run();
}
-#[test]
+#[cargo_test]
fn relative_path_for_member_works() {
let p = project()
.file(
p.cargo("build").cwd("bar").run();
}
-#[test]
+#[cargo_test]
fn relative_path_for_root_works() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn path_dep_outside_workspace_is_not_member() {
let p = project()
.no_manifest()
p.cargo("build").cwd("ws").run();
}
-#[test]
+#[cargo_test]
fn test_in_and_out_of_workspace() {
let p = project()
.no_manifest()
assert!(!p.root().join("bar/target").is_dir());
}
-#[test]
+#[cargo_test]
fn test_path_dependency_under_member() {
let p = project()
.file(
assert!(!p.root().join("foo/bar/target").is_dir());
}
-#[test]
+#[cargo_test]
fn excluded_simple() {
let p = project()
.file(
assert!(p.root().join("foo/target").is_dir());
}
-#[test]
+#[cargo_test]
fn exclude_members_preferred() {
let p = project()
.file(
assert!(!p.root().join("foo/bar/target").is_dir());
}
-#[test]
+#[cargo_test]
fn exclude_but_also_depend() {
let p = project()
.file(
assert!(p.root().join("foo/bar/target").is_dir());
}
-#[test]
+#[cargo_test]
fn glob_syntax() {
let p = project()
.file(
}
/*FIXME: This fails because of how workspace.exclude and workspace.members are working.
-#[test]
+#[cargo_test]
fn glob_syntax_2() {
let p = project()
.file("Cargo.toml", r#"
}
*/
-#[test]
+#[cargo_test]
fn glob_syntax_invalid_members() {
let p = project()
.file(
///
/// Ideally, once we solve rust-lang/cargo#3620, then a single Cargo build at the top level
/// will be enough.
-#[test]
+#[cargo_test]
fn dep_used_with_separate_features() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn dont_recurse_out_of_cargo_home() {
let git_project = git::new("dep", |project| {
project
// FIXME: this fails because of how workspace.exclude and workspace.members are working.
/*
-#[test]
+#[cargo_test]
fn include_and_exclude() {
let p = project()
.file("Cargo.toml", r#"
}
*/
-#[test]
+#[cargo_test]
fn cargo_home_at_root_works() {
let p = project()
.file(
p.cargo("build --frozen").env("CARGO_HOME", p.root()).run();
}
-#[test]
+#[cargo_test]
fn relative_rustc() {
let p = project()
.file(
p.cargo("build").env("RUSTC", &file).run();
}
-#[test]
+#[cargo_test]
fn ws_rustc_err() {
let p = project()
.file(
.run();
}
-#[test]
+#[cargo_test]
fn ws_err_unused() {
for key in &[
"[lib]",
}
}
-#[test]
+#[cargo_test]
fn ws_warn_unused() {
for (key, name) in &[
("[profile.dev]\nopt-level = 1", "profiles"),
}
}
-#[test]
+#[cargo_test]
fn ws_warn_path() {
// Warnings include path to manifest.
let p = project()