Commit graph

35 commits

Author SHA1 Message Date
Ed Page
594c96ad51 refactor(metadata): Switch opaque ID from PackageID to PackageIDSpec 2023-12-06 08:58:56 -06:00
flip1995
390af27128
Add rust_metadata to SerializedPackage
After the rust_version field was stabilized in #9732 this adds the
rust_version as output to the `cargo metadata` command, so tools like
Clippy can read and use it as well.
2021-10-12 14:07:19 +02:00
hi-rustin
f9a5625733 add default_run to SerializedPackage
Delete "default_run": null,
2021-06-07 14:59:57 +08:00
ayazhafiz
e831dd12a8 Publish target's "doc" setting when emitting metadata
Prior to this commit `cargo metadata` would not emit the value of a
target's "doc" setting, used by `cargo doc` to determine whether
documentation should be generated. However, this information is useful
for machine programs interested in such targets, and the information is
already made available on the internal representation of a target, so
this commit just exposes that during target serialization for emit.

cf https://github.com/deadlinks/cargo-deadlinks/issues/99
2020-11-17 19:54:17 -06:00
roblabla
72694e8015 Fix tests 2020-10-01 09:40:32 +00:00
Eric Huss
6f8c7d5a87 Normalize raw string indentation. 2020-09-26 17:59:58 -07:00
Oliver Scherer
95b22d2874 Emit the test field in cargo metadata 2020-07-30 09:50:46 +02:00
Eric Huss
7a5f0369cb Fix failure with missing readme. 2020-06-11 14:55:33 -07:00
Tarun Verghis
b0a3cc6b7a Assume README.md if readme=true 2020-06-09 00:03:15 -07:00
Tarun Verghis
77c52c2b4f Move constructor fn for manifest with readme to test file 2020-05-30 14:14:50 -07:00
Tarun Verghis
05cfcb6b8e Update tests 2020-05-28 22:07:12 -07:00
Tarun Verghis
dcae5fcf2d Rustfmt 2020-05-25 00:09:12 -07:00
Tarun Verghis
d1fe89e160 Add tests 2020-05-25 00:07:16 -07:00
Eric Huss
83571aee56 Minor testsuite organization. 2019-11-24 18:42:45 -08:00
Alex Crichton
9115b2c326 Extract support directory to its own crate
Extract out all our test support code to its own standalone crate so it
can be shared between multiple test suites if necessary.
2019-09-16 11:47:09 -07:00
Steven Fackler
7d41d454d8 Include the publish field in cargo-metadata output 2019-09-11 14:46:12 -04:00
Eric Huss
9fa65608e4 Fix some clippy warnings. 2019-07-14 15:19:33 -07:00
Jethro Beekman
0e0d968825 Update #[test] attribute on all tests in the testsuite
sed -i 's/^#\[test\]/#[cargo_test]/' $(rg -l '^#\[test\]')

Manual fixes:
* proc_macro::proc_macro_doctest
2019-06-07 12:41:26 -07:00
vlad20012
e1d433d30f Add doctest field into metadata
Some tools can support rust doctests (e.g. highlighting
or launching). So it should be possible to find out if
doctests are enabled for a target or not. This commit
adds `doctest` field to `cargo metadata` output.
2019-05-17 18:39:23 +03:00
Eric Huss
53de08a57d Add links to cargo metadata.
This is needed for creating registry index entries.
2018-12-23 11:34:14 -08:00
Alex Crichton
fecb724643 Format with cargo fmt 2018-12-08 03:19:47 -08:00
Dale Wijnand
04ddd4d0fc
Upgrade to Rust 2018 2018-12-06 20:18:35 +01:00
Dale Wijnand
4415c72828
Remove/reworksome redundant .cwd(p.root()) in tests 2018-09-06 01:12:53 +01:00
Dale Wijnand
85984a8700
Migrate from tests fom assert_that/execs to .run() 2018-08-28 15:08:12 +02:00
Dale Wijnand
511d4bc503
Collapse multiline ProcessBuilder::arg calls in tests
.. by calling this a bunch of times:

    fastmod --multiline '\.cargo\("([^"]+)"\).[ ]+\.arg\("([^"]+)"\)' '.cargo("${1} ${2}")' tests/testsuite/
2018-08-18 15:12:54 +01:00
Dale Wijnand
16aeb0cd4f
Default test support's Execs to exit code 0 2018-08-03 07:44:42 +01:00
Dale Wijnand
05400b8018
Drop the [/] test output macro 2018-08-02 10:18:48 +01:00
Arseniy Pendryak
5dcc4f1794 Add edition field into target object in metadata as well 2018-08-01 02:24:49 +03:00
Arseniy Pendryak
62cd0dbe51 Add edition field into metadata.
Since edition feature was introduced, external tools have to support this new feature.
But cargo metadata doesn't provide info about package edition.
This commit adds edition field to SerializedPackage struct
to add the corresponding field into metadata output.
2018-07-31 22:46:31 +03:00
Dale Wijnand
43b42d6f4c
Reorganise the testsuite crate module hierarchy
* Collapse the nested cargotest::support module into the cargotest
  module (merge the mod.rs's)
* Rename the cargotest module to support
* Nest the top-level hamcrest module into support
2018-07-22 08:46:44 +01:00
Dale Wijnand
7fe2fbc8a3
Remove the argument from the project test support function
By rewriting the tests, with rerast (https://github.com/google/rerast),
to use the newly introduced "at" method.

First I added the following temporary function to cargotest::support:

    pub fn project_foo() -> ProjectBuilder {
        project("foo")
    }

Then I defined the following rewrite.rs:

    use cargotest::support::{ project, project_foo };

    fn rule1(a: &'static str) {
        replace!(project("foo") => project_foo());
        replace!(project(a) => project_foo().at(a));
    }

Then I ran rerast:

    cargo +nightly rerast --rules_file=rewrite.rs --force --targets tests --file tests/testsuite/main.rs

Finally I searched and replaced the references to project_foo with
argument-less project (a little awkardly on macOS with a git clean).

    find tests -type f -exec sed -i -e 's/project_foo/project/g' {} +
    git clean -d tests
2018-07-20 13:31:50 +01:00
Yusuf Simonson
d1cacfedf3 Added new metadata fields.
`cargo metadata` should now include all of the non-optional suggested fields in the API guidelines (see section C-METADATA.)
2018-04-18 15:08:18 +07:00
Andy Russell
2efeeda17b
include package metadata in cargo metadata
Fixes #4819.
2018-04-14 15:07:23 -04:00
Alex Crichton
1e6828485e cargo fmt 2018-03-14 17:48:23 -07:00
André Rocha
c2ff988c9f Reorganize integration tests as one crate with many modules. Issue #4867. 2018-02-21 13:33:51 -05:00
Renamed from tests/read-manifest.rs (Browse further)