Hi,

After revisiting the issue, even though this solution deals with the
integration tests failing, it does not deal with the QA tests failing
due to the binaries leaking the build path. This is obviously caused
by the env! macro. A new solution will have to be implemented that
also treats this issue. Until then, please discard this series of
patches.

Best regards,
Andreas Stergiopoulos
IED1 Smile

On Mon, Nov 17, 2025 at 4:59 PM Andreas Stergiopoulos via
lists.openembedded.org
<[email protected]> wrote:
>
> When executing integration tests generated by cargo test, every test that 
> needs
> to somehow interact with the generated binary executables fails. This is due
> to the fact that most projects in Rust either use static methods to find the
> generated executable (such as going up and down the build directories) or use
> the "CARGO_BIN_EXE_<package-name>" environment variable, which is exported by
> cargo during compilation.
>
> Until now, ptest-cargo copies all the binary executables produced (unit and
> integration tests and binary executables) to the /usr/lib/<package>/ptest
> directory, where the run-ptest script executes the tests. Unit tests succeed
> but integration tests almost always fail. A side-effect of that is that the
> same binary is duplicated, as it can be found both in the package installation
> directory and in the corresponding ptest directory.
>
> This patch series improves the support of said integration tests by exporting
> the appropriate  environment variables during test runtime as well, so that
> integration tests can access the binary executables they neeed irregardless of
> the configuration of their environment.
>
> The method proposed here is a powerful tool for Rust integration for Yocto, as
> it allows the ptest-cargo framework to execute the actual installed binary
> packages while at the same time it also reduces image size, by avoiding the
> deduplication of the binary executables.
>
> v1: Original version.
> v2: Removed "-" from env invocation, as it implied an empty environment, which
> broke existing tests and improved how spaces are printed in order to increase
> readability and make the generated code better-looking.
>
> Andreas Stergiopoulos (3):
>   ptest-cargo.bbclass: Collect only test binaries and not executables
>   cargo.bbclass: Collect installation paths of executable binariesv
>   ptest-cargo.bbclass: Add support for CARGO_BIN_EXE_<name> environment
>     variables
>
>  meta/classes-recipe/cargo.bbclass       |  3 ++
>  meta/classes-recipe/ptest-cargo.bbclass | 44 +++++++++++++++++++++++--
>  2 files changed, 44 insertions(+), 3 deletions(-)
>
>
> 
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#226635): 
https://lists.openembedded.org/g/openembedded-core/message/226635
Mute This Topic: https://lists.openembedded.org/mt/116340214/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to