Snaipe / Criterion

A cross-platform C and C++ unit testing framework for the 21st century
MIT License
2.04k stars 181 forks source link

Criterion does not work wsl ubuntu #364

Closed Nekyt closed 4 years ago

Nekyt commented 4 years ago

Hello! I need to use criterion for my school project. I successfully built it from source and installed it using meson &ninja and pulled from the latest repo with the -recursive option. Unfortunately when i execute criterion I see nothing in my shell on wsl ubuntu. The fan starts working very loud and that's it. I even compiled a version of criterion natively from a valid linux distro on which criterion worked well and tried to execute the ./test on wsl but it still doesn't show anything wether it is in gnome shell or simple windows bash. this is a catastrophe! Please help

Nekyt commented 4 years ago

i ve got other pb now

Nekyt commented 4 years ago

now i have mincore(2) returned an unexpected error: Function not implemented This is a bug; please report it on the repository's issue tracker. Aborted (core dumped) thanks in advance

Snaipe commented 4 years ago

Do you still have the original issue?

Mincore returning -ENOTSUP is a bit infuriating -- why would WSL export the function if it's not going to be implemented?

Anyway, can you try to rebuild boxfort with #mesondefine HAVE_MINCORE removed in config.h.in? That should force boxfort to use msync instead.

Nekyt commented 4 years ago

I am sorry but the command grep -inr "HAVE_MINCORE" .
returns no result at all. I don't understand what to remove.

Nekyt commented 4 years ago

proffessor Snaipe! thank you very much for your help. after pulling from master i was able to successfully install criterion from source on wsl. I would like to point out that I was unable to install criterion from ppas using apt. People at my school use a script which install criterion on Fedora 33 automatically, which I unfortunately couldn't use because... unless you use this script and you are not a pro in c &linux it is hard to install. The release is broken and I had to switch branches on git. I understand that you have family kids etc and that the project is free of charge, but it is good that you as pros know that down on earth it is hard to install. Thank you anyways Your code is amazingly clean: no memory leaks!!(never happened to me)

ghost commented 2 years ago

I ran in the same problems Nekyt did. I installed from source according to this: https://criterion.readthedocs.io/en/latest/setup.html#installation fixed the issue of not finding the dynamic lib with this: g++ test.cpp -lcriterion -Wl,-rpath,/usr/local/lib/x86_64-linux-gnu

And fixed the micore error by removing #mesondefine HAVE_MINCORE in Criterion\subprojects\boxfort\src\config.h.in and rebuilding + reinstalling with ninja by rerunning ninja -C build && ninja -C build install as suggested by Snaipe

Glad I have criterion now working on WSL aswell

Kreijstal commented 1 year ago

Did someone figure out how to get around this bug?