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

Add OS info preceding tests #34

Closed
jbergstroem opened this issue Dec 4, 2014 · 12 comments
Closed

Add OS info preceding tests #34

jbergstroem opened this issue Dec 4, 2014 · 12 comments

Comments

@jbergstroem
Copy link
Contributor

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 :)

@saghul
Copy link
Member

saghul commented Dec 8, 2014

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 :-)

@jbergstroem
Copy link
Contributor Author

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.

@saghul
Copy link
Member

saghul commented Dec 8, 2014

Well, that's autoconf at work... We'd need something cross platform, and parsing uname really isn't.

@jbergstroem
Copy link
Contributor Author

If we rely on autoconf we could "parse" its output (config.log)?

@saghul
Copy link
Member

saghul commented Dec 8, 2014

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.

@sztomi
Copy link

sztomi commented Dec 14, 2015

@saghul, is this something you would still add to libuv? If so, I would take look.

@saghul
Copy link
Member

saghul commented Dec 14, 2015

I'm open to suggestions :-)

@sztomi
Copy link

sztomi commented Dec 14, 2015

@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?

@saghul
Copy link
Member

saghul commented Dec 17, 2015

@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.

@zhaozg
Copy link
Contributor

zhaozg commented Dec 17, 2015

Need this feature thanks

@sztomi
Copy link

sztomi commented Dec 17, 2015

@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.

@saghul
Copy link
Member

saghul commented May 17, 2016

No follow-up, closing. Feel free to open a PR when ready.

@saghul saghul closed this as completed May 17, 2016
vtjnash referenced this issue in JuliaLang/libuv Apr 2, 2019
move declarations to top of fcn for MSVC < 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants