-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Add OS info preceding tests #34
Comments
The information shown is actually part of the actual test suite, since we test the output of some functions. There are currently no uv functions to provide OS information, do you have something in mind? I have a vague recolection of someone also asking for this long time ago. As for the format, I'd stick to good old plaintext :-) |
I didn't really consider including functionality for os information in libuv, rather just fiddling with uname/similar output. If you/they paste full configure output some parts show up, but that's just hard to read. |
Well, that's autoconf at work... We'd need something cross platform, and parsing |
If we rely on autoconf we could "parse" its output (config.log)? |
We don't rely on autoconf. That's one of the build systems, we also have GYP and on Windows / MinGW there is a dedicated Makefile. |
@saghul, is this something you would still add to libuv? If so, I would take look. |
I'm open to suggestions :-) |
@saghul, I'm thinking something along the lines of uv_cpu_info_t, but for OS information. typedef enum { android, aix, win, unix, darwin } uv_sys_kind_t;
typedef struct uv_kernel_version_s {
int major;
int minor;
int patch;
int build;
char* extra_string;
} uv_kernel_version_t;
typedef struct uv_os_info {
uv_sys_kind_t sys;
char* sysname_string; /* "Windows", "Android" etc. */
char* release_string; /* "Vista", "XP", "trusty" etc.*/
uv_kernel_version_t kernel_version; /* structure to allow testing the versions numerically */
} uv_os_info_t;
/* Retrieve OS information */
int uv_os_info(uv_os_info_t*);
/* Pretty print OS information */
int uv_strosinfo(char*, uv_os_info_t*); (just as a quick sketch, I need to familiarize myself with the project more, but you get the idea) It might make sense to return the kernel version in a struct. As for the implementation, GetVersion&friends on Windows, uname on posix-friendly systems, plus trying to read /etc/lsb-release or issue etc. files. (I think it would be nice if the implementation detected the distributions on *nix). Is this something like what you had in mind? |
@sztomi thios is good work, thanks! I'll need a few days to work through the mail pile, but this is a good start IMHO. |
Need this feature thanks |
@saghul cool, then I'll try to whip out an initial implementation on my fork and let you know here when I have something to show. |
No follow-up, closing. Feel free to open a PR when ready. |
move declarations to top of fcn for MSVC < 2013
Currently, interface and cpu/memory information precedes test output. In order to simplify submitting test failures, the info could benefit from os/architecture information as well (see for instance #30).
Another option would be writing fail output and a summary to a markdown document for easier pasting. Come to think of it, this sounds like a pretty nifty C library :)
The text was updated successfully, but these errors were encountered: