Skip to content

test: integration tests can now call dynamic libraries#1690

Open
ostylk wants to merge 1 commit intowild-linker:mainfrom
ostylk:push-ntlnsyyuosmx
Open

test: integration tests can now call dynamic libraries#1690
ostylk wants to merge 1 commit intowild-linker:mainfrom
ostylk:push-ntlnsyyuosmx

Conversation

@ostylk
Copy link

@ostylk ostylk commented Mar 13, 2026

Implements #1687 .

Using //#RunDynSym:foo the output binary is treated as a shared library and loaded into the current test process.
The function foo needs to return an integer and it succeeds if it returns 42.

Cross compiled libraries cannot be tested that way.

Is there one test in particular where you want to use this feature? I enabled it for shared.c and called foo().

Comment on lines 1 to 3
// We don't currently run this, we just make sure that we can produce a shared
// object and that it passes the diff test.
//
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove these lines.

.with_context(|| format!("Invalid Mode `{arg}`"))?;
if mode == Mode::Dynamic {
config.assertions.expect_dynamic = true;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, specifying //#Mode:dynamic implicitly sets //#RunEnabled:false (introduced in #1033), so I think this needs to be corrected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for loading and running shared objects to test framework

2 participants