Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 14 08:44
    Snaipe commented #304
  • Oct 14 07:41
    vincentdupaquis commented #304
  • Oct 12 17:28
    Snaipe commented #304
  • Oct 12 12:13
    Snaipe commented #304
  • Oct 12 11:43
    Snaipe commented #305
  • Oct 12 00:25
    ntuDerekWang opened #305
  • Oct 09 10:43

    Snaipe on master

    (compare)

  • Oct 09 10:41

    Snaipe on bleeding

    Struct pointer references use -… (compare)

  • Oct 03 16:05
    vincentdupaquis commented #304
  • Oct 02 15:20
    vincentdupaquis commented #304
  • Oct 02 15:19
    Snaipe commented #304
  • Oct 02 14:58
    vincentdupaquis commented #304
  • Oct 02 14:56
    Snaipe commented #304
  • Oct 02 14:28
    vincentdupaquis commented #304
  • Oct 02 13:45
    vincentdupaquis commented #304
  • Oct 02 13:37
    vincentdupaquis commented #304
  • Oct 02 12:19
    Snaipe commented #304
  • Oct 02 10:52
    vincentdupaquis commented #304
  • Oct 02 10:49
    vincentdupaquis opened #304
  • Sep 26 21:38
    Snaipe commented #287
EdMaurer
@EdMaurer
My team is evaluating unit testing frameworks for our C++ API. Was planning on using xUnit++, but someone suggested looking at yr project. I have two questions. Can tests be run concurrently and is there any Visual Studio integration?
Franklin Mathieu
@Snaipe
@EdMaurer Tests can indeed be run concurrently. There is no VS integration yet, but I guess I can put this into the TODO list.
Although, if by integration you mean getting detailed reports from the IDE, if there is a plugin to parse JUnit XML reports, then it could be possible
EdMaurer
@EdMaurer
Thanks @Snaipe. I had a very positive experience using xUnit in the .NET world with VS. Tests could be launched via context menu. Failures showed up in the error window. Selecting the error would open the file with the test code. I was very productive. I'm looking to recreate that with our C++ API, or get as close as I can.
Franklin Mathieu
@Snaipe
IDE & editor integration is not something that has really been done since the project is still a bit young -- although I do plan to make these kind of integrations easier
I'm absolutely not familiar with xUnit++, but Criterion tries to be as much simple as possible while keeping the extensibility and being cross platform
Franklin Mathieu
@Snaipe
So, currently I'm afraid that tests are best run from the command line or all at once from a CI server. The project tries to make sure that whatever happens inside a test function does not change the state of the runner nor crashes its state
@EdMaurer Also, are you specifically targetting Microsoft Platforms?
EdMaurer
@EdMaurer
Today our project runs on Windows but we are in the process of bringing it to Linux. Someone from our team is gonna take a closer look at Criterion. Thanks for your responses. xUnit++ has the distinct downside that the project maintainer has moved on.
Franklin Mathieu
@Snaipe
Okay. Feel free to ask anything if you or your team has any other questions, I'll do my best to answer them.
Trollderim
@Trollderim
Hi @Snaipe, unfortunately the binary for Windows (MinGW - x86_64) is nowhere to be found and I have problems building the library from source. Would it be possible for you to reupload the binary release?
Franklin Mathieu
@Snaipe
@Trollderim I'll see to it once I get back home. Out of curiosity, what troubles are you having when building Criterion with MinGW? It might come from our CMakeFiles.txt.
Trollderim
@Trollderim
@Snaipe I get a linking error to systems libraries. I suppose it is due to an error with the cmake installation.
Franklin Mathieu
@Snaipe
Do you have a log, perhaps? There are known linking errors on windows for gettext/libintl, if its that, you can deactivate i18n with -DI18N=OFF.
Trollderim
@Trollderim
It was exactly this problem, now it was build correctly thank you very much.
Dominik
@kaidowei

@Snaipe hi, I have issues running the criterion tests for the bleeding branch.
The cram_tests failed.

For the other tests, I had to run make test twice and make criterion_unit_tests.

How do I run the cram_tests?
Thanks

Franklin Mathieu
@Snaipe
@kaidowei you need to install the cram module on python3, then define the PYTHON_BIN environment variable to your python 3 binary.
It's a bit of a hassle right now, but there will be proper checks for cram & python 3 for the stable release
Dominik
@kaidowei
okay, they run now (with TRAVIS=yes , otherwise, python says "/usr/bin/python3: No module named cram.main; 'cram' is a package and cannot be directly executed")
but 4/15 tests fail, without any changes
is that normal?
Dominik
@kaidowei

$ simple.c.bin --list
misc: 2 tests

  • ├── failing
  • └── passing
  • \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 failing (esc)
  • \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 passing (esc)

the listing in all cram tests fails.

Franklin Mathieu
@Snaipe
@kaidowei you are running your tests with python2+cram, rather than python3+cram
Criterion sometimes uses unicode output, and python2 just can't handle it well
Dominik
@kaidowei
yeah, bit of a hassle... made it working, thanks
Dominik
@kaidowei
:worried: made a pull request, but something failed, because the build system signaled/killed some tests
Franklin Mathieu
@Snaipe
@kaidowei there are issues with the regression tests on theories at the moment, your changes aren't causing this
Dominik
@kaidowei
yes, already saw that. Thanks for the help :)
Dominik
@kaidowei
@Snaipe hi again, do you have a quick fix for the following:
test_all.c: In function ‘another_suite_test_stdout_impl’:
test_all.c:43:140: warning: zero-length gnu_printf format string [-Wformat-zero-length]
cr_assert_stdout_eq_str("foo");
^
test_all.c:47:140: warning: zero-length gnu_printf format string [-Wformat-zero-length]
cr_assert_stderr_eq_str("bar");
Dominik
@kaidowei

btw. I was thinking about the default message:
[----] test_all.c:30: Assertion failed: The expression (as strings) (s) != ("hello") is false.

Something like "The expession (as strings) (s) != ("hello") is false. (s == "something_not_hello").

or even better expand both arguments, maybe the user has some variable for expected too
The expession (as strings) (s) != ("hello") is false. (actual = 'something_else', expected = 'hello')
with a check for null obviously
Franklin Mathieu
@Snaipe
@kaidowei the first warnings are weird, they should be suppressed by pragmas already
Dominik
@kaidowei
Okay, can I help to fix this?
Franklin Mathieu
@Snaipe
as for the parameter expansion, it should be possible. I wasn't doing anything more than printing the parameters because there was no generic way to print two variables as strings in C, but I'll do it at least for strings
(and maybe think about actually printing something if _Generic is available)
As for fixing the warning, does cr_assert(0) yield any warning for you?
Dominik
@kaidowei
test_all.c:23:77: warning: zero-length gnu_printf format string [-Wformat-zero-length]
cr_assert(0);
^
yes
Franklin Mathieu
@Snaipe
What compiler (+version) are you using?
Dominik
@kaidowei
gcc --version
gcc (Ubuntu 4.8.4-2ubuntu1~14.04.1) 4.8.4
Franklin Mathieu
@Snaipe
@kaidowei just for the sake of it, does putting #pragma GCC diagnostic ignored "-Wformat-zero-length" on the top of your test file suppresses the warning?
Dominik
@kaidowei
yes it does
Dominik
@kaidowei
as for the parameter expansion, it should be possible. I wasn't doing anything more than printing the parameters because there was no generic way to print two variables as strings in C, but I'll do it at least for strings
thanks, will work for pointer and floats too :)
Franklin Mathieu
@Snaipe
@kaidowei could you try to apply this patch and tell me if it fixes anything?
Dominik
@kaidowei
nope, does not fix it
ah wait... let me check again
our build process cleans everything...
nope, sorry, still there with the patch
Franklin Mathieu
@Snaipe
I'm not sure why the pragma isn't picked up. Try this patch and tell me what errors you are hitting.