Skip to content
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

How do I provide different configuration sets for different CPU architectures in tests? #954

Closed
statementreply opened this issue Jul 1, 2020 · 3 comments
Labels
question Further information is requested resolved Successfully resolved without a commit

Comments

@statementreply
Copy link
Contributor

I'm working on test coverage for #935, which contains numerical algorithm. It is desirable to test with different compiler and runtime configurations that could affect floating point behavior. The relevant options differ by CPU architecture.

For example, /arch: IA32 is only available on x86, while /arch:VFPv4 is only available on ARM. /link loosefpmath.obj is meaningless with /arch:IA32, while /link fp10.obj is only meaningful with /arch:IA32.

How do I setup a different set of configurations to test for each CPU architecture?

@statementreply statementreply added the question Further information is requested label Jul 1, 2020
@StephanTLavavej
Copy link
Member

We have some machinery in the test harness that @cbezault wrote which detects the undocumented compiler option /BE (that activates the EDG front-end), which is available only for x86 at this time. The test machinery has the concept of "features", and contains code that notes that the "edg" feature is available only for the x86 architecture. This is what skips /BE test configurations for x64 test runs. I believe it should be possible to extend this machinery, teaching it about the availability of compiler options like /arch:IA32 and /arch:VFPv4 on different architectures. Please let us know if you'd like help with this.

@cbezault
Copy link
Contributor

cbezault commented Jul 1, 2020

See here and here.

@StephanTLavavej StephanTLavavej added the resolved Successfully resolved without a commit label Jul 2, 2020
@StephanTLavavej
Copy link
Member

Thanks, Curtis! Inline code snippets:

for flag in chain(self.cxx.flags, self.cxx.compile_flags):
if flag[1:] == 'clr:pure':
self.requires.append('clr_pure') # TRANSITION, GH-798
elif flag[1:] == 'clr':
self.requires.append('clr') # TRANSITION, GH-797
elif flag[1:] == 'BE':
self.requires.append('edg') # available for x86, see config.py

if self.target_arch == 'x86':
self.config.available_features.add('edg')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested resolved Successfully resolved without a commit
Projects
None yet
Development

No branches or pull requests

3 participants