This is the mail archive of the frysk@sourceware.org mailing list for the frysk project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to get installed compiler version for test cases?


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]