summaryrefslogtreecommitdiffstats
path: root/meta/classes-recipe/ptest-cargo.bbclass
Commit message (Collapse)AuthorAgeFilesLines
* cargo: Rename MANIFEST_PATH -> CARGO_MANIFEST_PATHAlex Kiernan2023-12-081-1/+1
| | | | | | | | | | | This variable is a piece of recipe configurable interface, scope it with the class name to make that clear. (From OE-Core rev: 0101de25832fbed3d08cd522512784133c628cad) Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* ptest-cargo.bbclass: Support of cargo workspacesFrederic Martinsons2023-07-301-4/+8
| | | | | | | | | | | | | | | | For complex project, it is very common to have multiple sub artifacts and so use workspaces, sometimes it has even no root artifacts (but several bin or lib) and virtual manifest is used for that. Long story short, support this case in ptest-cargo class to look for all test binaries in the current project and no more those generated by the root Cargo.toml (From OE-Core rev: 67644c3fa7d012ad03d0a876a281d5abd5edf7fe) Signed-off-by: Frederic Martinsons <frederic.martinsons@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* ptest-cargo.bbclass: fix condition to detect test executableFrederic Martinsons2023-07-141-3/+3
| | | | | | | | | | | | before that, a test executable at None was picked. Moreover, use universal_newlines to subprocess call to avoid being polluted by fancy carriage return characters. (From OE-Core rev: 8dd52f19a919fb7be0ffb7d40782eafe183f8a09) Signed-off-by: Frederic Martinsons <frederic.martinsons@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* ptest-cargo.bbclass: add the possibility to define test argumentsFrederic Martinsons2023-05-101-2/+6
| | | | | | | | | | | | | | | | It can be useful for user of this class for giving common rust test arguments (like --shuffle, --format or --test-threads) To add arguments to test binary , simply define RUST_TEST_ARGS in your recipe that inherit ptest-cargo, for example: RUST_TEST_ARGS = "--shuffle" (From OE-Core rev: ea1feece62b0347aa2ebf02509ff2da151d96b61) Signed-off-by: Frederic Martinsons <frederic.martinsons@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* ptest-cargo.bbclass: create classFrederic Martinsons2023-05-051-0/+130
This new class offers the possibility to build rust unit tests (and integration tests) and find them correctly. Due to non deterministic names of generated binaries, a custom parsing of build result must be performed. See https://github.com/rust-lang/cargo/issues/1924 All rust projects will generate a test binary with "cargo build --tests" command, even if there are no test defined in source code. The binary will just output that it ran 0 tests. (From OE-Core rev: dad9bad239d757ae0b159fe5f1276b6856547b4c) Signed-off-by: Frederic Martinsons <frederic.martinsons@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>