-
-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Allow passing extra_libs
to CheckLibWithHeader
#4676
Merged
Merged
Changes from 3 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
7575421
:bug: Allow passing `extra_libs` to `CheckLibWithHeader`
rdbisme dae3e49
:white_check_mark: Add test
rdbisme 5c1ee17
:memo: Add change summary
rdbisme 2bb3cd3
Also enable extra_libs for CheckLib
mwichmann 07e63ae
Minor fixes to CheckLibWithHeader test
mwichmann b1d71e6
Fix CheckLibWithHeader test - undo mistake
mwichmann 5f8a725
Windows-ify the new CheckLibWithHeader test
mwichmann 9bcbf7b
Per request, "fixture-ize" CheckLibWithHeader_extra_libs test
mwichmann 663165b
Simplify use of dir_fixture and some test logic. Added DefaultEnviron…
bdbaddog 2a9d19a
Simplify use of dir_fixture
bdbaddog a5fcde6
Simplify use of dir_fixture
bdbaddog e3c23de
Simplify
bdbaddog 769eff9
Add note to docstring that this is a live test per mwichmann
bdbaddog File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
""" | ||
Verify that a program which depends on library which in turns depend on another library | ||
can be built correctly using CheckLibWithHeader | ||
""" | ||
|
||
from pathlib import Path | ||
|
||
from TestSCons import TestSCons | ||
|
||
test = TestSCons(match=TestSCons.match_re_dotall) | ||
|
||
|
||
libA_dir = Path(test.workdir) / "libA" | ||
libA_dir.mkdir() | ||
test.write( | ||
str(libA_dir / "libA.h"), | ||
"""\ | ||
void libA(); | ||
""", | ||
) | ||
test.write( | ||
str(libA_dir / "libA.c"), | ||
"""\ | ||
#include <stdio.h> | ||
#include "libA.h" | ||
|
||
void libA() { | ||
printf("libA\\n"); | ||
} | ||
""", | ||
) | ||
test.write( | ||
str(libA_dir / "SConstruct"), | ||
"""\ | ||
SharedLibrary('libA', source=['libA.c']) | ||
""", | ||
) | ||
test.run(chdir=libA_dir) | ||
|
||
|
||
libB_dir = Path(test.workdir) / "libB" | ||
libB_dir.mkdir() | ||
test.write( | ||
str(libB_dir / "libB.h"), | ||
"""\ | ||
void libB(); | ||
""", | ||
) | ||
test.write( | ||
str(libB_dir / "libB.c"), | ||
"""\ | ||
#include <stdio.h> | ||
#include "libA.h" | ||
#include "libB.h" | ||
|
||
void libB () { | ||
libA(); | ||
} | ||
""", | ||
) | ||
test.write( | ||
str(libB_dir / "SConstruct"), | ||
"""\ | ||
SharedLibrary( | ||
'libB', | ||
source=['libB.c'], | ||
LIBS=['A'], | ||
LIBPATH='../libA', | ||
CPPPATH='../libA', | ||
) | ||
""", | ||
) | ||
test.run(chdir=libB_dir) | ||
|
||
test.write( | ||
"SConstruct", | ||
"""\ | ||
import os | ||
env = Environment(ENV=os.environ, CPPPATH=['libB', 'libA'], LIBPATH=['libB', 'libA']) | ||
conf = Configure(env) | ||
|
||
ret = conf.CheckLibWithHeader( | ||
['B'], | ||
header="libB.h", | ||
language='C', | ||
extra_libs=['A'], | ||
call='libB();', | ||
autoadd=False, | ||
) | ||
assert ret | ||
""", | ||
) | ||
test.run() | ||
test.pass_test() |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mwichmann - what's the blurb to indicate this is added in NEXT_RELEASE?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the xml files are not processed by Sphinx, it needs the hand-crafted version:
It's a little unclear whether an existing method getting a new parameter is considered "added" or "changed". I'm tending to follow what CPython does, which is to consider that "changed" (though I admit that's not been consistent).
The corresponding markup in source code (aka the docstring) is: