This is the mail archive of the
frysk@sourceware.org
mailing list for the frysk project.
Re: How to get installed compiler version for test cases?
- From: Roland McGrath <roland at redhat dot com>
- To: Nurdin Premji <npremji at redhat dot com>
- Cc: frysk <frysk at sourceware dot org>
- Date: Thu, 3 Jan 2008 18:19:19 -0800 (PST)
- Subject: Re: How to get installed compiler version for test cases?
- References: <477D9333.5050106@redhat.com>
> What is the quickest way to find out the installed compiler version for
> use with junit Test cases.
>
> I know that for kernel versions there are KernelMatch, KernelVersion and
> Uname, to decide which kernels have what features, but the use of uname
> is also a function and not just a program.
>
> What I need to do is grab the output of "gcc --version" to decide
> whether the new tests should be run or skipped as unresolved.
One simple approach is to have tests that do:
#if __GNUC__ < 4 || __GNUC_MINOR__ < 3
int main (void) { return 77; }
#else
... real test ...
#endif
i.e., you run them anyway but they are stubs that always just quickly exit
with 77, which means "SKIP". I don't know if it's simple to have junit
treat it that way though.
Thanks,
Roland