You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(11) |
Sep
(5) |
Oct
(3) |
Nov
(3) |
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(3) |
Feb
|
Mar
(1) |
Apr
(2) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(1) |
Nov
|
Dec
(1) |
2003 |
Jan
|
Feb
(1) |
Mar
(3) |
Apr
|
May
(2) |
Jun
(1) |
Jul
|
Aug
(5) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
(6) |
2004 |
Jan
(2) |
Feb
(1) |
Mar
(2) |
Apr
|
May
(1) |
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2005 |
Jan
(2) |
Feb
(1) |
Mar
|
Apr
(2) |
May
|
Jun
(3) |
Jul
(2) |
Aug
(6) |
Sep
(3) |
Oct
|
Nov
(3) |
Dec
(2) |
2006 |
Jan
(4) |
Feb
(5) |
Mar
(19) |
Apr
(4) |
May
|
Jun
(5) |
Jul
(6) |
Aug
(3) |
Sep
(7) |
Oct
(37) |
Nov
(36) |
Dec
(36) |
2007 |
Jan
(34) |
Feb
(25) |
Mar
(39) |
Apr
(28) |
May
(17) |
Jun
(19) |
Jul
(48) |
Aug
(56) |
Sep
(19) |
Oct
(24) |
Nov
(21) |
Dec
|
2008 |
Jan
(3) |
Feb
(3) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
(18) |
Aug
(8) |
Sep
|
Oct
|
Nov
(1) |
Dec
(1) |
2009 |
Jan
(27) |
Feb
(5) |
Mar
(22) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2010 |
Jan
(9) |
Feb
(9) |
Mar
(2) |
Apr
(6) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(16) |
Dec
(6) |
2011 |
Jan
(2) |
Feb
(3) |
Mar
(3) |
Apr
(1) |
May
|
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
2012 |
Jan
(3) |
Feb
|
Mar
|
Apr
|
May
(10) |
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
(7) |
Nov
(1) |
Dec
(4) |
2013 |
Jan
(6) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
(27) |
Aug
(5) |
Sep
|
Oct
(22) |
Nov
(3) |
Dec
(4) |
2014 |
Jan
(3) |
Feb
(12) |
Mar
(5) |
Apr
(19) |
May
(13) |
Jun
(17) |
Jul
(6) |
Aug
(20) |
Sep
(2) |
Oct
(6) |
Nov
(8) |
Dec
|
2015 |
Jan
(3) |
Feb
(5) |
Mar
|
Apr
(4) |
May
(4) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(5) |
Dec
(1) |
2016 |
Jan
|
Feb
|
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(4) |
Sep
|
Oct
(2) |
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(3) |
Oct
|
Nov
(2) |
Dec
|
2018 |
Jan
|
Feb
|
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
2021 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Nicholas H. <nj...@ae...> - 2021-04-21 08:48:44
|
Hi! Thank you very much for your reply. I created a function called redirect_stderr() based on your code. I am using checkmk to create my test files. Adding the following line at the bottom of my .tc file worked for me: #main-pre tcase_add_checked_fixture(tc1_1, redirect_stderr, NULL); I have always been a bit confused by the Checked/Unchecked Fixture terminology but very happy to have something working 👍 Code is here, if anyone is looking for something similar in the future: https://github.com/njh/tinyppp6/tree/main/tests nick. On 20/04/2021 10:10, Fredrik Hugosson wrote: > Hi! > > Maybe something like this in the checked_setup() function that is run inside the fork > > #include <stdio.h> > #include <stdlib.h> > #include <fcntl.h> > #include <unistd.h> > > int err = open("/dev/null", O_RDWR, 0600); > if (-1 == err) { perror("opening /dev/null"); return 255; } > > if (-1 == dup2(err, fileno(stderr))) { perror("cannot redirect stderr"); return 255; } > > > > > -----Original Message----- > From: Nicholas Humfrey <nj...@ae...> > Sent: den 16 april 2021 00:15 > To: che...@li... > Subject: [Check-users] Redirecting STDERR? > > Hi, > > Does anyone have any tips on redirecting stderr when using check? > (probably to /dev/null) > > I am writing error messages to stderr during fault conditions, which results in lots of error messages appearing in the console when testing the code. Is to possible to redirect stderr inside the fork, before each test is run? > > I guess the obvious solution would be to make the destination of error messages configurable in my code. > But even, so is there a way of creating a setup() function that is run before each of the tests in the suite? > > > Thanks, > > nick. > > > > > > _______________________________________________ > Check-users mailing list > Che...@li... > https://lists.sourceforge.net/lists/listinfo/check-users |
From: Fredrik H. <fre...@ax...> - 2021-04-20 09:25:50
|
Hi! Maybe something like this in the checked_setup() function that is run inside the fork #include <stdio.h> #include <stdlib.h> #include <fcntl.h> #include <unistd.h> int err = open("/dev/null", O_RDWR, 0600); if (-1 == err) { perror("opening /dev/null"); return 255; } if (-1 == dup2(err, fileno(stderr))) { perror("cannot redirect stderr"); return 255; } -----Original Message----- From: Nicholas Humfrey <nj...@ae...> Sent: den 16 april 2021 00:15 To: che...@li... Subject: [Check-users] Redirecting STDERR? Hi, Does anyone have any tips on redirecting stderr when using check? (probably to /dev/null) I am writing error messages to stderr during fault conditions, which results in lots of error messages appearing in the console when testing the code. Is to possible to redirect stderr inside the fork, before each test is run? I guess the obvious solution would be to make the destination of error messages configurable in my code. But even, so is there a way of creating a setup() function that is run before each of the tests in the suite? Thanks, nick. _______________________________________________ Check-users mailing list Che...@li... https://lists.sourceforge.net/lists/listinfo/check-users |
From: Nicholas H. <nj...@ae...> - 2021-04-15 22:32:40
|
Hi, Does anyone have any tips on redirecting stderr when using check? (probably to /dev/null) I am writing error messages to stderr during fault conditions, which results in lots of error messages appearing in the console when testing the code. Is to possible to redirect stderr inside the fork, before each test is run? I guess the obvious solution would be to make the destination of error messages configurable in my code. But even, so is there a way of creating a setup() function that is run before each of the tests in the suite? Thanks, nick. |
From: Fredrik H. <fre...@ax...> - 2019-08-20 08:22:24
|
Hi! The error is not in check proper, but something on the apt packaging for either check or clam, or on the apt configuration side. Try to debug your apt configuration and caching, or to get help from Ubuntu packagers for these two packages. Best of luck! /Fredrik On 8/14/19 6:26 PM, Joseph Moore wrote: > I got the error message when I first tried to install check, but it > repeats for when I try to install clam av as well (which I tried to do > first when it informed me that check was a necessary component for how I > was trying to install clam) > > On Wed., Aug. 14, 2019, 10:31 a.m. Fredrik Hugosson, > <fre...@ax... <mailto:fre...@ax...>> wrote: > > Hi! > > From what I can see check is already installed on your system. > > But there seems to be some issue with your sources.list configuration. > Do you get the same warning when 'apt install'-ing some other > package or > just for check? > > BR, > /Fredrik > > On 8/14/19 3:35 PM, Joseph Moore wrote: > > > > > > I'm trying to install check on ubuntu 19.04, but it gives me the > > following message and does not finish installing properly: > > > > ~$ sudo apt install check > > Reading package lists... Done > > Building dependency tree > > Reading state information... Done > > check is already the newest version (0.10.0-3build2). > > 0 upgraded, 0 newly installed, 0 to remove and 12 not upgraded. > > W: Target Packages (partner/binary-amd64/Packages) is configured > > multiple times in /etc/apt/sources.list:43 and > > /etc/apt/sources.list.d/disco-partner.list:4 > > W: Target Packages (partner/binary-i386/Packages) is configured > > multiple times in /etc/apt/sources.list:43 and > > /etc/apt/sources.list.d/disco-partner.list:4 > > W: Target Packages (partner/binary-all/Packages) is configured > > multiple times in /etc/apt/sources.list:43 and > > /etc/apt/sources.list.d/disco-partner.list:4 > > W: Target Translations (partner/i18n/Translation-en_CA) is > > configured multiple times in /etc/apt/sources.list:43 and > > /etc/apt/sources.list.d/disco-partner.list:4 > > W: Target Translations (partner/i18n/Translation-en) is > configured > > multiple times in /etc/apt/sources.list:43 and > > /etc/apt/sources.list.d/disco-partner.list:4 > > W: Target DEP-11 (partner/dep11/Components-amd64.yml) is > configured > > multiple times in /etc/apt/sources.list:43 and > > /etc/apt/sources.list.d/disco-partner.list:4 > > W: Target DEP-11 (partner/dep11/Components-all.yml) is > configured > > multiple times in /etc/apt/sources.list:43 and > > /etc/apt/sources.list.d/disco-partner.list:4 > > W: Target DEP-11-icons-small (partner/dep11/icons-48x48.tar) is > > configured multiple times in /etc/apt/sources.list:43 and > > /etc/apt/sources.list.d/disco-partner.list:4 > > W: Target DEP-11-icons (partner/dep11/icons-64x64.tar) is > configured > > multiple times in /etc/apt/sources.list:43 and > > /etc/apt/sources.list.d/disco-partner.list:4 > > W: Target CNF (partner/cnf/Commands-amd64) is configured > multiple > > times in /etc/apt/sources.list:43 and > > /etc/apt/sources.list.d/disco-partner.list:4 > > W: Target CNF (partner/cnf/Commands-all) is configured multiple > > times in /etc/apt/sources.list:43 and > > /etc/apt/sources.list.d/disco-partner.list:4 > > > > > > How do I resolve this issue? The program will not run or read as > > installed by other installations I am trying to do... > > > > Thanks for any help you can give. > |
From: Fredrik H. <fre...@ax...> - 2019-08-14 14:32:09
|
Hi! From what I can see check is already installed on your system. But there seems to be some issue with your sources.list configuration. Do you get the same warning when 'apt install'-ing some other package or just for check? BR, /Fredrik On 8/14/19 3:35 PM, Joseph Moore wrote: > > > I'm trying to install check on ubuntu 19.04, but it gives me the > following message and does not finish installing properly: > > ~$ sudo apt install check > Reading package lists... Done > Building dependency tree > Reading state information... Done > check is already the newest version (0.10.0-3build2). > 0 upgraded, 0 newly installed, 0 to remove and 12 not upgraded. > W: Target Packages (partner/binary-amd64/Packages) is configured > multiple times in /etc/apt/sources.list:43 and > /etc/apt/sources.list.d/disco-partner.list:4 > W: Target Packages (partner/binary-i386/Packages) is configured > multiple times in /etc/apt/sources.list:43 and > /etc/apt/sources.list.d/disco-partner.list:4 > W: Target Packages (partner/binary-all/Packages) is configured > multiple times in /etc/apt/sources.list:43 and > /etc/apt/sources.list.d/disco-partner.list:4 > W: Target Translations (partner/i18n/Translation-en_CA) is > configured multiple times in /etc/apt/sources.list:43 and > /etc/apt/sources.list.d/disco-partner.list:4 > W: Target Translations (partner/i18n/Translation-en) is configured > multiple times in /etc/apt/sources.list:43 and > /etc/apt/sources.list.d/disco-partner.list:4 > W: Target DEP-11 (partner/dep11/Components-amd64.yml) is configured > multiple times in /etc/apt/sources.list:43 and > /etc/apt/sources.list.d/disco-partner.list:4 > W: Target DEP-11 (partner/dep11/Components-all.yml) is configured > multiple times in /etc/apt/sources.list:43 and > /etc/apt/sources.list.d/disco-partner.list:4 > W: Target DEP-11-icons-small (partner/dep11/icons-48x48.tar) is > configured multiple times in /etc/apt/sources.list:43 and > /etc/apt/sources.list.d/disco-partner.list:4 > W: Target DEP-11-icons (partner/dep11/icons-64x64.tar) is configured > multiple times in /etc/apt/sources.list:43 and > /etc/apt/sources.list.d/disco-partner.list:4 > W: Target CNF (partner/cnf/Commands-amd64) is configured multiple > times in /etc/apt/sources.list:43 and > /etc/apt/sources.list.d/disco-partner.list:4 > W: Target CNF (partner/cnf/Commands-all) is configured multiple > times in /etc/apt/sources.list:43 and > /etc/apt/sources.list.d/disco-partner.list:4 > > > How do I resolve this issue? The program will not run or read as > installed by other installations I am trying to do... > > Thanks for any help you can give. |
From: Joseph M. <he...@gm...> - 2019-08-14 13:35:57
|
I'm trying to install check on ubuntu 19.04, but it gives me the following message and does not finish installing properly: ~$ sudo apt install check Reading package lists... Done Building dependency tree Reading state information... Done check is already the newest version (0.10.0-3build2). 0 upgraded, 0 newly installed, 0 to remove and 12 not upgraded. W: Target Packages (partner/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:43 and /etc/apt/sources.list.d/disco-partner.list:4 W: Target Packages (partner/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:43 and /etc/apt/sources.list.d/disco-partner.list:4 W: Target Packages (partner/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:43 and /etc/apt/sources.list.d/disco-partner.list:4 W: Target Translations (partner/i18n/Translation-en_CA) is configured multiple times in /etc/apt/sources.list:43 and /etc/apt/sources.list.d/disco-partner.list:4 W: Target Translations (partner/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:43 and /etc/apt/sources.list.d/disco-partner.list:4 W: Target DEP-11 (partner/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:43 and /etc/apt/sources.list.d/disco-partner.list:4 W: Target DEP-11 (partner/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list:43 and /etc/apt/sources.list.d/disco-partner.list:4 W: Target DEP-11-icons-small (partner/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list:43 and /etc/apt/sources.list.d/disco-partner.list:4 W: Target DEP-11-icons (partner/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:43 and /etc/apt/sources.list.d/disco-partner.list:4 W: Target CNF (partner/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:43 and /etc/apt/sources.list.d/disco-partner.list:4 W: Target CNF (partner/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:43 and /etc/apt/sources.list.d/disco-partner.list:4 How do I resolve this issue? The program will not run or read as installed by other installations I am trying to do... Thanks for any help you can give. |
From: Igor F. <ro...@sk...> - 2018-03-09 22:54:58
|
> Can you refactor your code to run only one test inside each case? And then > put them all inside one suite? Chris i ended refactoring all teh tests to cleanup side effects using checked fixtures and it worked. i think making a test case for each unit test would be pretty messy... specially since i use a loop. anyway, thank you! <3 -- Igor |
From: Branden A. <b.m...@gm...> - 2018-03-09 13:18:06
|
I do not think that there is a mechanism for running a specific test in isolation, only a specific suite or case. The only advice I can think of is to set gdb to follow forks and set breakpoints to stop on specific conditions, for example if the loop in a given test is a specific value. https://stackoverflow.com/questions/14390256/gdb-break-if-variable-equal-value - Branden On Thu, Mar 8, 2018 at 11:27 PM, Igor Fontana <ro...@sk...> wrote: > > You can tell Check to run only a specific suite or test case using the > > environment variables CK_RUN_CASE and CK_RUN_SUITE. You can also mark a > test > > case with a tag and run only tests which match that tag using the > > environment variable CK_INCLUDE_TAGS. See the documentation here for > both of > > those. > > yes, but they wont let me pick just a single unit test inside teh > suite/case, right? > > what i needed was something liek CK_RUN_TEST and CK_RUN_TEST_I, which > would allow to restrict even further. or perhaps something shorter, > liek CK_RUN_ID, which would uniquely identify a unit inside a case > inside a suite. > > in my test case i have some common data and a huge table of operation > parameters to try. some of those parameters run just fine and some > segfault. so if i run teh whole test case it is still problematic to > either CK_FORK=no, because of side effects, or gdb with fork(). > > sorry if im asking too much! and thank you again for teh quick response! <3 > > -- > Igor > |
From: Igor F. <ro...@sk...> - 2018-03-09 04:28:30
|
> You can tell Check to run only a specific suite or test case using the > environment variables CK_RUN_CASE and CK_RUN_SUITE. You can also mark a test > case with a tag and run only tests which match that tag using the > environment variable CK_INCLUDE_TAGS. See the documentation here for both of > those. yes, but they wont let me pick just a single unit test inside teh suite/case, right? what i needed was something liek CK_RUN_TEST and CK_RUN_TEST_I, which would allow to restrict even further. or perhaps something shorter, liek CK_RUN_ID, which would uniquely identify a unit inside a case inside a suite. in my test case i have some common data and a huge table of operation parameters to try. some of those parameters run just fine and some segfault. so if i run teh whole test case it is still problematic to either CK_FORK=no, because of side effects, or gdb with fork(). sorry if im asking too much! and thank you again for teh quick response! <3 -- Igor |
From: Branden A. <b.m...@gm...> - 2018-03-09 03:33:08
|
You can tell Check to run only a specific suite or test case using the environment variables CK_RUN_CASE and CK_RUN_SUITE. You can also mark a test case with a tag and run only tests which match that tag using the environment variable CK_INCLUDE_TAGS. See the documentation here <https://libcheck.github.io/check/doc/check_html/check_7.html#Environment-Variable-Reference> for both of those. Hope it helps. - Branden On Thu, Mar 8, 2018 at 10:26 PM, Igor Fontana <ro...@sk...> wrote: > EHLO > > i just hit a segfault on my tests and stated debugging... > > first i tried to run it inside gdb, but then it becomes a mess because > it forks liek 300 times. > > then i tried to CK_FORK=no, but it makes good tests crash because they > rely on fork() to isolate side effects. > > then i tried to manage teh forks inside gdb but its impossible. > > then i started to think about checking my fixtures and managing side > effects myself, but i fear this is gonna be quite a lot of work and > very error prone. > > finally i thought i could run just teh problematic unit test on > CK_FORK=no, but i couldnt find a way to run just a _single unit test_, > and to make things worse, its a loop test. > > so before refactoring more mistakes into my code, i thought it would > be worth to ask here. could somebody give me a light on this matter? > please? > > thank you! <3 > > -- > Igor > > ------------------------------------------------------------ > ------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > Check-users mailing list > Che...@li... > https://lists.sourceforge.net/lists/listinfo/check-users > |
From: Igor F. <ro...@sk...> - 2018-03-09 03:26:43
|
EHLO i just hit a segfault on my tests and stated debugging... first i tried to run it inside gdb, but then it becomes a mess because it forks liek 300 times. then i tried to CK_FORK=no, but it makes good tests crash because they rely on fork() to isolate side effects. then i tried to manage teh forks inside gdb but its impossible. then i started to think about checking my fixtures and managing side effects myself, but i fear this is gonna be quite a lot of work and very error prone. finally i thought i could run just teh problematic unit test on CK_FORK=no, but i couldnt find a way to run just a _single unit test_, and to make things worse, its a loop test. so before refactoring more mistakes into my code, i thought it would be worth to ask here. could somebody give me a light on this matter? please? thank you! <3 -- Igor |
From: Branden A. <b.m...@gm...> - 2017-11-05 21:18:10
|
Albert, Feel free to use the stylesheets. I do not think I have many changes, if any, from the original from DesignsByDarren.com. Unless you find a specific change, you are OK just referencing DesignsByDarren.com. When you finish, drop a line if you would like; I'd be curious to see the finished result if it is public. - Branden On November 5, 2017 3:03:27 PM EST, "Albert Tománek" <ele...@gm...> wrote: >Hello, >I like the appearance of your website, and am writing to ask whether I >could use your stylesheet in documentation for a project that I'm >working on. Would this be possible? >Of course I would credit libcheck.github.io/check/ and >DesignsByDarren.com in the footer. >Thanks in advance >Albert Tomanek -- Sent from my Android device with K-9 Mail. Please excuse my brevity. |
From: Albert T. <ele...@gm...> - 2017-11-05 20:03:43
|
Hello, I like the appearance of your website, and am writing to ask whether I could use your stylesheet in documentation for a project that I'm working on. Would this be possible? Of course I would credit libcheck.github.io/check/ and DesignsByDarren.com in the footer. Thanks in advance Albert Tomanek |
From: Fredrik H. <fre...@ax...> - 2017-09-27 08:52:29
|
As long as one does not rely on global resources in the tests, typically stuff that is set up in unchecked fixtures or before tests are run at all, it should be theoretically possible. Only problem that needs to be adressed is result reporting that currently, as far as I can remember, is not done in a locked manner and therefore may mix different results and probably break. /HUGO. On 09/27/2017 02:59 AM, Branden Archer wrote: > I do not see why parallel tests would not be possible if fork mode is used. > > - Branden > > On Thu, Sep 21, 2017 at 9:54 PM, David Niklas <do...@ma... > <mailto:do...@ma...>> wrote: > > On Sun, 30 Oct 2016 13:02:39 -0400 > Branden Archer <b.m...@gm... > <mailto:b.m...@gm...>> wrote: > > Check does not have support for running test cases in parallel. I > cannot > > say definitively for all unit testing frameworks, however ever unit > > testing framework I've personally used has only offered to run tests > > sequentially. > > > > Our library has support for handling multiple application requests at > > the > > > same time, It will really help us if we have option in CHECK test > > > framework to simultaniously running selected testcases. > > > > > > Are you trying to find a way to run many requests against your code > > concurrently to ensure that it responds properly? This sounds more > of an > > integration or system-level test instead of a unit test. If > instead you > > are concerned about there being multiple threads in your application > > and if Check can still unit test such a setup, Check can do this. > > > > - Branden > > Not that I'm volunteering, but because check starts another process > so as > not to crash the parent (unless nofork is used), wouldn't parallel > checking be possible from a technical standpoint? > > Thanks, > David > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > Check-users mailing list > Che...@li... > <mailto:Che...@li...> > https://lists.sourceforge.net/lists/listinfo/check-users > <https://lists.sourceforge.net/lists/listinfo/check-users> > > > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > > > > _______________________________________________ > Check-users mailing list > Che...@li... > https://lists.sourceforge.net/lists/listinfo/check-users > |
From: Branden A. <b.m...@gm...> - 2017-09-27 06:29:08
|
I do not see why parallel tests would not be possible if fork mode is used. - Branden On Thu, Sep 21, 2017 at 9:54 PM, David Niklas <do...@ma...> wrote: > On Sun, 30 Oct 2016 13:02:39 -0400 > Branden Archer <b.m...@gm...> wrote: > > Check does not have support for running test cases in parallel. I cannot > > say definitively for all unit testing frameworks, however ever unit > > testing framework I've personally used has only offered to run tests > > sequentially. > > > > Our library has support for handling multiple application requests at > > the > > > same time, It will really help us if we have option in CHECK test > > > framework to simultaniously running selected testcases. > > > > > > Are you trying to find a way to run many requests against your code > > concurrently to ensure that it responds properly? This sounds more of an > > integration or system-level test instead of a unit test. If instead you > > are concerned about there being multiple threads in your application > > and if Check can still unit test such a setup, Check can do this. > > > > - Branden > > Not that I'm volunteering, but because check starts another process so as > not to crash the parent (unless nofork is used), wouldn't parallel > checking be possible from a technical standpoint? > > Thanks, > David > > ------------------------------------------------------------ > ------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > Check-users mailing list > Che...@li... > https://lists.sourceforge.net/lists/listinfo/check-users > |
From: David N. <do...@ma...> - 2017-09-22 14:57:39
|
On Sun, 30 Oct 2016 13:02:39 -0400 Branden Archer <b.m...@gm...> wrote: > Check does not have support for running test cases in parallel. I cannot > say definitively for all unit testing frameworks, however ever unit > testing framework I've personally used has only offered to run tests > sequentially. > > Our library has support for handling multiple application requests at > the > > same time, It will really help us if we have option in CHECK test > > framework to simultaniously running selected testcases. > > > Are you trying to find a way to run many requests against your code > concurrently to ensure that it responds properly? This sounds more of an > integration or system-level test instead of a unit test. If instead you > are concerned about there being multiple threads in your application > and if Check can still unit test such a setup, Check can do this. > > - Branden Not that I'm volunteering, but because check starts another process so as not to crash the parent (unless nofork is used), wouldn't parallel checking be possible from a technical standpoint? Thanks, David |
From: Branden A. <b.m...@gm...> - 2017-03-24 00:47:55
|
You can tackle this one of two ways. GDB: You can instruct GDB what to do on a fork using its follow-fork-mode <https://sourceware.org/gdb/onlinedocs/gdb/Forks.html>. Namely you can instruct GDB to follow the parent or child on a fork. If you set this to "child" you should then be debugging the unit test in question. You may want to disable test timeouts if you go this route, so the parent process monitoring the unit test does not kill the test for running too long. To do this, set the CK_DEFAULT_TIMEOUT <https://libcheck.github.io/check/doc/check_html/check_4.html#Test-Timeouts> environment variable to "0". Check: If you set the CK_FORK <https://libcheck.github.io/check/doc/check_html/check_4.html#No-Fork-Mode> environment variable to "no", then check will not fork to run unit tests. Good luck figuring out your crash! - Branden On Thu, Mar 23, 2017 at 6:43 PM, Nicola Spanti < nic...@ec...> wrote: > Hi. > > I have an error in one of my test, but I do not understand why. It > causes a SEGFAULT, so it should be easy to find with GDB. > But GDB seems not to follow the processes created by the test. There is > probably a way to use GDB correctly in this context, but I do not know it. > Is there a way to force check not to create process and thread (that > will enable me to use GDB in a simple way)? I would particularly > appreciate a way without recompiling check, but I found nothing in the > public API. > I am on GNU/Linux. > > user@user-ThinkPad-X200:~/workspace/PlanetWars2dRT-SDL2/externals/core$ > ./debug/bin/check_activity_manager > Running suite(s): Activity manager > 71%: Checks: 7, Failures: 0, Errors: 2 > /home/user/workspace/PlanetWars2dRT-SDL2/externals/ > core/tests/check_activity_manager.c:66:E:Current:test_ > activity_manager_start_current:0: > (after this point) Received signal 11 (Segmentation fault) > /home/user/workspace/PlanetWars2dRT-SDL2/externals/ > core/tests/check_activity_manager.c:87:E:Next:test_ > activity_manager_start_next:0: > (after this point) Received signal 11 (Segmentation fault) > user@user-ThinkPad-X200:~/workspace/PlanetWars2dRT-SDL2/externals/core$ > gdb ./debug/bin/check_activity_manager > GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1 > Copyright (C) 2014 Free Software Foundation, Inc. > License GPLv3+: GNU GPL version 3 or later > <http://gnu.org/licenses/gpl.html> > This is free software: you are free to change and redistribute it. > There is NO WARRANTY, to the extent permitted by law. Type "show copying" > and "show warranty" for details. > This GDB was configured as "x86_64-linux-gnu". > Type "show configuration" for configuration details. > For bug reporting instructions, please see: > <http://www.gnu.org/software/gdb/bugs/>. > Find the GDB manual and other documentation resources online at: > <http://www.gnu.org/software/gdb/documentation/>. > For help, type "help". > Type "apropos word" to search for commands related to "word"... > Reading symbols from ./debug/bin/check_activity_manager...done. > (gdb) b tests/check_activity_manager.c:65 > Breakpoint 1 at 0x4030f3: file > /home/user/workspace/PlanetWars2dRT-SDL2/externals/ > core/tests/check_activity_manager.c, > line 65. > (gdb) r > Starting program: > /home/user/workspace/PlanetWars2dRT-SDL2/externals/ > core/debug/bin/check_activity_manager > [Thread debugging using libthread_db enabled] > Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". > Running suite(s): Activity manager > 71%: Checks: 7, Failures: 0, Errors: 2 > /home/user/workspace/PlanetWars2dRT-SDL2/externals/ > core/tests/check_activity_manager.c:66:E:Current:test_ > activity_manager_start_current:0: > (after this point) Received signal 11 (Segmentation fault) > /home/user/workspace/PlanetWars2dRT-SDL2/externals/ > core/tests/check_activity_manager.c:87:E:Next:test_ > activity_manager_start_next:0: > (after this point) Received signal 11 (Segmentation fault) > [Inferior 1 (process 8147) exited with code 01] > > Regards. > > ------------------------------------------------------------ > ------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > Check-users mailing list > Che...@li... > https://lists.sourceforge.net/lists/listinfo/check-users > |
From: Nicola S. <nic...@ec...> - 2017-03-23 22:43:36
|
Hi. I have an error in one of my test, but I do not understand why. It causes a SEGFAULT, so it should be easy to find with GDB. But GDB seems not to follow the processes created by the test. There is probably a way to use GDB correctly in this context, but I do not know it. Is there a way to force check not to create process and thread (that will enable me to use GDB in a simple way)? I would particularly appreciate a way without recompiling check, but I found nothing in the public API. I am on GNU/Linux. user@user-ThinkPad-X200:~/workspace/PlanetWars2dRT-SDL2/externals/core$ ./debug/bin/check_activity_manager Running suite(s): Activity manager 71%: Checks: 7, Failures: 0, Errors: 2 /home/user/workspace/PlanetWars2dRT-SDL2/externals/core/tests/check_activity_manager.c:66:E:Current:test_activity_manager_start_current:0: (after this point) Received signal 11 (Segmentation fault) /home/user/workspace/PlanetWars2dRT-SDL2/externals/core/tests/check_activity_manager.c:87:E:Next:test_activity_manager_start_next:0: (after this point) Received signal 11 (Segmentation fault) user@user-ThinkPad-X200:~/workspace/PlanetWars2dRT-SDL2/externals/core$ gdb ./debug/bin/check_activity_manager GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1 Copyright (C) 2014 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from ./debug/bin/check_activity_manager...done. (gdb) b tests/check_activity_manager.c:65 Breakpoint 1 at 0x4030f3: file /home/user/workspace/PlanetWars2dRT-SDL2/externals/core/tests/check_activity_manager.c, line 65. (gdb) r Starting program: /home/user/workspace/PlanetWars2dRT-SDL2/externals/core/debug/bin/check_activity_manager [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Running suite(s): Activity manager 71%: Checks: 7, Failures: 0, Errors: 2 /home/user/workspace/PlanetWars2dRT-SDL2/externals/core/tests/check_activity_manager.c:66:E:Current:test_activity_manager_start_current:0: (after this point) Received signal 11 (Segmentation fault) /home/user/workspace/PlanetWars2dRT-SDL2/externals/core/tests/check_activity_manager.c:87:E:Next:test_activity_manager_start_next:0: (after this point) Received signal 11 (Segmentation fault) [Inferior 1 (process 8147) exited with code 01] Regards. |
From: Branden A. <b.m...@gm...> - 2016-10-30 17:02:46
|
Check does not have support for running test cases in parallel. I cannot say definitively for all unit testing frameworks, however ever unit testing framework I've personally used has only offered to run tests sequentially. Our library has support for handling multiple application requests at the > same time, It will really help us if we have option in CHECK test framework > to simultaniously running selected testcases. Are you trying to find a way to run many requests against your code concurrently to ensure that it responds properly? This sounds more of an integration or system-level test instead of a unit test. If instead you are concerned about there being multiple threads in your application and if Check can still unit test such a setup, Check can do this. - Branden On Sat, Oct 29, 2016 at 2:09 AM, purush reddy <pur...@gm...> wrote: > Hi, > > I have a library and i am planning to write testcases using CHECK > framework. Can anyone tell me whether CHECK has support running the test > cases in parallel . I know we can select multiple testcases and start > execution. But my requirement is all the testcases has to start in parallel > on my multicore environment. > > Our library has support for handling multiple application requests at the > same time, It will really help us if we have option in CHECK test framework > to simultaniously running selected testcases. > > Thanks > Purush > > ------------------------------------------------------------ > ------------------ > The Command Line: Reinvented for Modern Developers > Did the resurgence of CLI tooling catch you by surprise? > Reconnect with the command line and become more productive. > Learn the new .NET and ASP.NET CLI. Get your free copy! > http://sdm.link/telerik > _______________________________________________ > Check-users mailing list > Che...@li... > https://lists.sourceforge.net/lists/listinfo/check-users > > |
From: purush r. <pur...@gm...> - 2016-10-29 06:09:47
|
Hi, I have a library and i am planning to write testcases using CHECK framework. Can anyone tell me whether CHECK has support running the test cases in parallel . I know we can select multiple testcases and start execution. But my requirement is all the testcases has to start in parallel on my multicore environment. Our library has support for handling multiple application requests at the same time, It will really help us if we have option in CHECK test framework to simultaniously running selected testcases. Thanks Purush |
From: Branden A. <b.m...@gm...> - 2016-08-26 00:13:41
|
> > AFAIK if the process fork(2)s then all inherited memory is also duplicated and aught to be free(3)ed as it now belongs to the child. Generally this is true. When using fork mode with Check each unit test is forked into its own process. If the unit test fails _exit() is invoked. Otherwise, exit(EXIT_SUCCESS) is invoked. As the client will write the code which initializes Check by creating test cases, suites, and runners, it is the client's responsibility to properly free these resources with the provided API. I suppose that if one were interested in freeing these in each unit test to prevent valgrind from indicating that a memory allocation is reachable but not freed on process exit one could add code so that each unit test freed the structures. Maybe this would be done in a checked fixture. That would be a bit pedantic, but should be feasible. Ok, but how do (un)checked_fixtures work with respect to memory? I want to make my unit tests call my init and delete functions inside the child. The unchecked fixtures are run prior to running the test cases, and are done before the fork(). The checked fixtures run after the fork(). If there are resources you would like to create and free per unit test you may want to do it in a checked fixture. Hope this helps. - Branden On Fri, Aug 5, 2016 at 6:31 PM, David Niklas <do...@ma...> wrote: > On Thu, 4 Aug 2016 12:14:36 Branden Archer wrote: > [top post replaced to bottom] > > On Wed, Aug 3, 2016 at 6:16 PM, David Niklas <do...@ma...> wrote: > > > > > Hello, > > > I've been trying to test my library and I found that though it runs > > > fine when using CK_NOFORK and without, but in the latter case > > > valgrind reports numerous leaks. > > > > > > Examples include: > > > ==23703== 8 bytes in 1 blocks are still reachable in loss record 1 of > > > 58 ==23703== at 0x4C2B010: malloc (in /usr/lib64/valgrind/ > > > vgpreload_memcheck-amd64-linux.so) > > > ==23703== by 0x5200288: emalloc (check_error.c:62) > > > ==23703== by 0x5200364: check_list_create (check_list.c:61) > > > ==23703== by 0x51FF6EB: tcase_create (check.c:147) > > > ==23703== by 0x425407: main (libarmored-ml-tests.check:176) > > > > > > This does not look like part of my program. > > > > > > ==23709== 4 bytes in 1 blocks are still reachable in loss record 1 of > > > 1,831 ==23709== at 0x4C2B010: malloc (in /usr/lib64/valgrind/ > > > vgpreload_memcheck-amd64-linux.so) > > > ==23709== by 0x56F0F48: re_node_set_init_copy > > > (regex_internal.c:1031) ==23709== by 0x56F124C: create_cd_newstate > > > (regex_internal.c:1673) ==23709== by 0x56F124C: > > > re_acquire_state_context (regex_internal.c:1545) ==23709== by > > > 0x56FBD4C: create_initial_state (regcomp.c:1050) ==23709== by > > > 0x56FBD4C: re_compile_internal (regcomp.c:814) ==23709== by > > > 0x56FC869: regcomp (regcomp.c:505) ==23709== by 0x42431E: > > > libarmored_ml_init (armor-init.c:32) ==23709== by 0x424A70: setup > > > (libarmored-ml-tests.check:18) ==23709== by 0x5202BB2: > > > srunner_run_setup (check_run.c:297) ==23709== by 0x52036BE: > > > tcase_run_checked_setup (check_run.c:324) ==23709== by 0x52036BE: > > > tcase_run_tfun_fork (check_run.c:463) ==23709== by 0x52036BE: > > > srunner_iterate_tcase_tfuns (check_run.c:224) ==23709== by > > > 0x52036BE: srunner_run_tcase (check_run.c:373) ==23709== by > > > 0x52036BE: srunner_iterate_suites (check_run.c:195) ==23709== by > > > 0x52036BE: srunner_run (check_run.c:782) ==23709== by 0x4255EF: > > > main (libarmored-ml-tests.check:189) > > > > > > libarmored_ml_init is mine and is supposed to be called one per > > > libarmored_ml_delete. It is actually silly for it to leak memory > > > since it is fifty lines and I would have noticed it. valgrind would > > > also have noticed it when running in CK_NOFORK mode. > > > > > > Here is the last error (there were many repeats, I may have missed > > > one), again, this is part of my init (two of two allocs). > > > > > > ==23709== 16 bytes in 1 blocks are still reachable in loss record 35 > > > of 1,831 ==23709== at 0x4C2B010: malloc (in /usr/lib64/valgrind/ > > > vgpreload_memcheck-amd64-linux.so) > > > ==23709== by 0x4EDFF30: recode_malloc > > > (in /usr/lib64/librecode.so.0.0.0) ==23709== by 0x4EDDA75: > > > declare_implied_surface (in /usr/lib64/ librecode.so.0.0.0) > > > ==23709== by 0x4EDF156: recode_new_outer (in > > > /usr/lib64/librecode.so.0.0.0) > > > ==23709== by 0x42438F: libarmored_ml_init (armor-init.c:52) > > > ==23709== by 0x424A70: setup (libarmored-ml-tests.check:18) > > > ==23709== by 0x5202BB2: srunner_run_setup (check_run.c:297) > > > ==23709== by 0x52036BE: tcase_run_checked_setup (check_run.c:324) > > > ==23709== by 0x52036BE: tcase_run_tfun_fork (check_run.c:463) > > > ==23709== by 0x52036BE: srunner_iterate_tcase_tfuns > > > (check_run.c:224) ==23709== by 0x52036BE: srunner_run_tcase > > > (check_run.c:373) ==23709== by 0x52036BE: srunner_iterate_suites > > > (check_run.c:195) ==23709== by 0x52036BE: srunner_run > > > (check_run.c:782) ==23709== by 0x4255EF: main > > > (libarmored-ml-tests.check:189) > > > > If the unit test program is configured to use fork() to run its tests, > > the main process will fork() and run the unit tests in the child > > process. The child process will eventually terminate, and the main > > process will detect this and continue on. The child process will > > inherit any "baggage" from the main process. Namely, if a resource is > > allocated in the main process before the child process is forked, the > > child process will not clean up that resource (as it is not supposed > > to). > AFAIK if the process fork(2)s then all inherited memory is also duplicated > and aught to be free(3)ed as it now belongs to the child. > > > Check does just this, notably the test suite structure used to > > define what tests to run. Usually this appears as "still > > reachable" in Valgrind. If CK_NOFORK were used, those resources should > > be cleaned up at the end of the tests. > > > > At one point I setup a Jenkins job > > <https://check.ci.cloudbees.com/job/check-linux-sf/> which which would > > run a memory leak test > > <http://sourceforge.net/p/check/code/HEAD/tree/trunk/ > tests/test_mem_leaks.sh> > > with > > Valgrind to avoid a memory leak sneaking into Check unintentionally. > > That job has not found a memory leak on GNU/Linux, so one might hope > > that on other platforms all would be well. > > > > My advice for avoiding Valgrind's misleading false positives is to run > > Check in the CK_NOFORK mode, if it is practical. If not, attempt to > > detect leaks from Valgrind with the description "definitely lost", as > > they indicated actual memory leaks. > Ok, but how do (un)checked_fixtures work with respect to memory? I want to > make my unit tests call my init and delete functions inside the child. > > > A related discussion on memory leaks in Check 0.10.0 appeared in the > > mailing list here, for reference: > > > > https://sourceforge.net/p/check/mailman/check-users/?viewmonth=201511 > > > > - Branden > > Thanks, > David > > ------------------------------------------------------------ > ------------------ > _______________________________________________ > Check-users mailing list > Che...@li... > https://lists.sourceforge.net/lists/listinfo/check-users > |
From: David N. <do...@ma...> - 2016-08-05 22:31:51
|
On Thu, 4 Aug 2016 12:14:36 Branden Archer wrote: [top post replaced to bottom] > On Wed, Aug 3, 2016 at 6:16 PM, David Niklas <do...@ma...> wrote: > > > Hello, > > I've been trying to test my library and I found that though it runs > > fine when using CK_NOFORK and without, but in the latter case > > valgrind reports numerous leaks. > > > > Examples include: > > ==23703== 8 bytes in 1 blocks are still reachable in loss record 1 of > > 58 ==23703== at 0x4C2B010: malloc (in /usr/lib64/valgrind/ > > vgpreload_memcheck-amd64-linux.so) > > ==23703== by 0x5200288: emalloc (check_error.c:62) > > ==23703== by 0x5200364: check_list_create (check_list.c:61) > > ==23703== by 0x51FF6EB: tcase_create (check.c:147) > > ==23703== by 0x425407: main (libarmored-ml-tests.check:176) > > > > This does not look like part of my program. > > > > ==23709== 4 bytes in 1 blocks are still reachable in loss record 1 of > > 1,831 ==23709== at 0x4C2B010: malloc (in /usr/lib64/valgrind/ > > vgpreload_memcheck-amd64-linux.so) > > ==23709== by 0x56F0F48: re_node_set_init_copy > > (regex_internal.c:1031) ==23709== by 0x56F124C: create_cd_newstate > > (regex_internal.c:1673) ==23709== by 0x56F124C: > > re_acquire_state_context (regex_internal.c:1545) ==23709== by > > 0x56FBD4C: create_initial_state (regcomp.c:1050) ==23709== by > > 0x56FBD4C: re_compile_internal (regcomp.c:814) ==23709== by > > 0x56FC869: regcomp (regcomp.c:505) ==23709== by 0x42431E: > > libarmored_ml_init (armor-init.c:32) ==23709== by 0x424A70: setup > > (libarmored-ml-tests.check:18) ==23709== by 0x5202BB2: > > srunner_run_setup (check_run.c:297) ==23709== by 0x52036BE: > > tcase_run_checked_setup (check_run.c:324) ==23709== by 0x52036BE: > > tcase_run_tfun_fork (check_run.c:463) ==23709== by 0x52036BE: > > srunner_iterate_tcase_tfuns (check_run.c:224) ==23709== by > > 0x52036BE: srunner_run_tcase (check_run.c:373) ==23709== by > > 0x52036BE: srunner_iterate_suites (check_run.c:195) ==23709== by > > 0x52036BE: srunner_run (check_run.c:782) ==23709== by 0x4255EF: > > main (libarmored-ml-tests.check:189) > > > > libarmored_ml_init is mine and is supposed to be called one per > > libarmored_ml_delete. It is actually silly for it to leak memory > > since it is fifty lines and I would have noticed it. valgrind would > > also have noticed it when running in CK_NOFORK mode. > > > > Here is the last error (there were many repeats, I may have missed > > one), again, this is part of my init (two of two allocs). > > > > ==23709== 16 bytes in 1 blocks are still reachable in loss record 35 > > of 1,831 ==23709== at 0x4C2B010: malloc (in /usr/lib64/valgrind/ > > vgpreload_memcheck-amd64-linux.so) > > ==23709== by 0x4EDFF30: recode_malloc > > (in /usr/lib64/librecode.so.0.0.0) ==23709== by 0x4EDDA75: > > declare_implied_surface (in /usr/lib64/ librecode.so.0.0.0) > > ==23709== by 0x4EDF156: recode_new_outer (in > > /usr/lib64/librecode.so.0.0.0) > > ==23709== by 0x42438F: libarmored_ml_init (armor-init.c:52) > > ==23709== by 0x424A70: setup (libarmored-ml-tests.check:18) > > ==23709== by 0x5202BB2: srunner_run_setup (check_run.c:297) > > ==23709== by 0x52036BE: tcase_run_checked_setup (check_run.c:324) > > ==23709== by 0x52036BE: tcase_run_tfun_fork (check_run.c:463) > > ==23709== by 0x52036BE: srunner_iterate_tcase_tfuns > > (check_run.c:224) ==23709== by 0x52036BE: srunner_run_tcase > > (check_run.c:373) ==23709== by 0x52036BE: srunner_iterate_suites > > (check_run.c:195) ==23709== by 0x52036BE: srunner_run > > (check_run.c:782) ==23709== by 0x4255EF: main > > (libarmored-ml-tests.check:189) > > If the unit test program is configured to use fork() to run its tests, > the main process will fork() and run the unit tests in the child > process. The child process will eventually terminate, and the main > process will detect this and continue on. The child process will > inherit any "baggage" from the main process. Namely, if a resource is > allocated in the main process before the child process is forked, the > child process will not clean up that resource (as it is not supposed > to). AFAIK if the process fork(2)s then all inherited memory is also duplicated and aught to be free(3)ed as it now belongs to the child. > Check does just this, notably the test suite structure used to > define what tests to run. Usually this appears as "still > reachable" in Valgrind. If CK_NOFORK were used, those resources should > be cleaned up at the end of the tests. > > At one point I setup a Jenkins job > <https://check.ci.cloudbees.com/job/check-linux-sf/> which which would > run a memory leak test > <http://sourceforge.net/p/check/code/HEAD/tree/trunk/tests/test_mem_leaks.sh> > with > Valgrind to avoid a memory leak sneaking into Check unintentionally. > That job has not found a memory leak on GNU/Linux, so one might hope > that on other platforms all would be well. > > My advice for avoiding Valgrind's misleading false positives is to run > Check in the CK_NOFORK mode, if it is practical. If not, attempt to > detect leaks from Valgrind with the description "definitely lost", as > they indicated actual memory leaks. Ok, but how do (un)checked_fixtures work with respect to memory? I want to make my unit tests call my init and delete functions inside the child. > A related discussion on memory leaks in Check 0.10.0 appeared in the > mailing list here, for reference: > > https://sourceforge.net/p/check/mailman/check-users/?viewmonth=201511 > > - Branden Thanks, David |
From: Branden A. <b.m...@gm...> - 2016-08-04 16:14:43
|
If the unit test program is configured to use fork() to run its tests, the main process will fork() and run the unit tests in the child process. The child process will eventually terminate, and the main process will detect this and continue on. The child process will inherit any "baggage" from the main process. Namely, if a resource is allocated in the main process before the child process is forked, the child process will not clean up that resource (as it is not supposed to). Check does just this, notably the test suite structure used to define what tests to run. Usually this appears as "still reachable" in Valgrind. If CK_NOFORK were used, those resources should be cleaned up at the end of the tests. At one point I setup a Jenkins job <https://check.ci.cloudbees.com/job/check-linux-sf/> which which would run a memory leak test <http://sourceforge.net/p/check/code/HEAD/tree/trunk/tests/test_mem_leaks.sh> with Valgrind to avoid a memory leak sneaking into Check unintentionally. That job has not found a memory leak on GNU/Linux, so one might hope that on other platforms all would be well. My advice for avoiding Valgrind's misleading false positives is to run Check in the CK_NOFORK mode, if it is practical. If not, attempt to detect leaks from Valgrind with the description "definitely lost", as they indicated actual memory leaks. A related discussion on memory leaks in Check 0.10.0 appeared in the mailing list here, for reference: https://sourceforge.net/p/check/mailman/check-users/?viewmonth=201511 - Branden On Wed, Aug 3, 2016 at 6:16 PM, David Niklas <do...@ma...> wrote: > Hello, > I've been trying to test my library and I found that though it runs fine > when using CK_NOFORK and without, but in the latter case valgrind reports > numerous leaks. > > Examples include: > ==23703== 8 bytes in 1 blocks are still reachable in loss record 1 of 58 > ==23703== at 0x4C2B010: malloc (in /usr/lib64/valgrind/ > vgpreload_memcheck-amd64-linux.so) > ==23703== by 0x5200288: emalloc (check_error.c:62) > ==23703== by 0x5200364: check_list_create (check_list.c:61) > ==23703== by 0x51FF6EB: tcase_create (check.c:147) > ==23703== by 0x425407: main (libarmored-ml-tests.check:176) > > This does not look like part of my program. > > ==23709== 4 bytes in 1 blocks are still reachable in loss record 1 of 1,831 > ==23709== at 0x4C2B010: malloc (in /usr/lib64/valgrind/ > vgpreload_memcheck-amd64-linux.so) > ==23709== by 0x56F0F48: re_node_set_init_copy (regex_internal.c:1031) > ==23709== by 0x56F124C: create_cd_newstate (regex_internal.c:1673) > ==23709== by 0x56F124C: re_acquire_state_context (regex_internal.c:1545) > ==23709== by 0x56FBD4C: create_initial_state (regcomp.c:1050) > ==23709== by 0x56FBD4C: re_compile_internal (regcomp.c:814) > ==23709== by 0x56FC869: regcomp (regcomp.c:505) > ==23709== by 0x42431E: libarmored_ml_init (armor-init.c:32) > ==23709== by 0x424A70: setup (libarmored-ml-tests.check:18) > ==23709== by 0x5202BB2: srunner_run_setup (check_run.c:297) > ==23709== by 0x52036BE: tcase_run_checked_setup (check_run.c:324) > ==23709== by 0x52036BE: tcase_run_tfun_fork (check_run.c:463) > ==23709== by 0x52036BE: srunner_iterate_tcase_tfuns (check_run.c:224) > ==23709== by 0x52036BE: srunner_run_tcase (check_run.c:373) > ==23709== by 0x52036BE: srunner_iterate_suites (check_run.c:195) > ==23709== by 0x52036BE: srunner_run (check_run.c:782) > ==23709== by 0x4255EF: main (libarmored-ml-tests.check:189) > > libarmored_ml_init is mine and is supposed to be called one per > libarmored_ml_delete. It is actually silly for it to leak memory > since it is fifty lines and I would have noticed it. valgrind would > also have noticed it when running in CK_NOFORK mode. > > Here is the last error (there were many repeats, I may have missed one), > again, this is part of my init (two of two allocs). > > ==23709== 16 bytes in 1 blocks are still reachable in loss record 35 of > 1,831 ==23709== at 0x4C2B010: malloc (in /usr/lib64/valgrind/ > vgpreload_memcheck-amd64-linux.so) > ==23709== by 0x4EDFF30: recode_malloc (in /usr/lib64/librecode.so.0.0.0) > ==23709== by 0x4EDDA75: declare_implied_surface (in /usr/lib64/ > librecode.so.0.0.0) > ==23709== by 0x4EDF156: recode_new_outer (in > /usr/lib64/librecode.so.0.0.0) > ==23709== by 0x42438F: libarmored_ml_init (armor-init.c:52) > ==23709== by 0x424A70: setup (libarmored-ml-tests.check:18) > ==23709== by 0x5202BB2: srunner_run_setup (check_run.c:297) > ==23709== by 0x52036BE: tcase_run_checked_setup (check_run.c:324) > ==23709== by 0x52036BE: tcase_run_tfun_fork (check_run.c:463) > ==23709== by 0x52036BE: srunner_iterate_tcase_tfuns (check_run.c:224) > ==23709== by 0x52036BE: srunner_run_tcase (check_run.c:373) > ==23709== by 0x52036BE: srunner_iterate_suites (check_run.c:195) > ==23709== by 0x52036BE: srunner_run (check_run.c:782) > ==23709== by 0x4255EF: main (libarmored-ml-tests.check:189) > > > Thanks, > David > > > ------------------------------------------------------------------------------ > _______________________________________________ > Check-users mailing list > Che...@li... > https://lists.sourceforge.net/lists/listinfo/check-users > |
From: David N. <do...@ma...> - 2016-08-04 14:30:31
|
Hello, I've been trying to test my library and I found that though it runs fine when using CK_NOFORK and without, but in the latter case valgrind reports numerous leaks. Examples include: ==23703== 8 bytes in 1 blocks are still reachable in loss record 1 of 58 ==23703== at 0x4C2B010: malloc (in /usr/lib64/valgrind/ vgpreload_memcheck-amd64-linux.so) ==23703== by 0x5200288: emalloc (check_error.c:62) ==23703== by 0x5200364: check_list_create (check_list.c:61) ==23703== by 0x51FF6EB: tcase_create (check.c:147) ==23703== by 0x425407: main (libarmored-ml-tests.check:176) This does not look like part of my program. ==23709== 4 bytes in 1 blocks are still reachable in loss record 1 of 1,831 ==23709== at 0x4C2B010: malloc (in /usr/lib64/valgrind/ vgpreload_memcheck-amd64-linux.so) ==23709== by 0x56F0F48: re_node_set_init_copy (regex_internal.c:1031) ==23709== by 0x56F124C: create_cd_newstate (regex_internal.c:1673) ==23709== by 0x56F124C: re_acquire_state_context (regex_internal.c:1545) ==23709== by 0x56FBD4C: create_initial_state (regcomp.c:1050) ==23709== by 0x56FBD4C: re_compile_internal (regcomp.c:814) ==23709== by 0x56FC869: regcomp (regcomp.c:505) ==23709== by 0x42431E: libarmored_ml_init (armor-init.c:32) ==23709== by 0x424A70: setup (libarmored-ml-tests.check:18) ==23709== by 0x5202BB2: srunner_run_setup (check_run.c:297) ==23709== by 0x52036BE: tcase_run_checked_setup (check_run.c:324) ==23709== by 0x52036BE: tcase_run_tfun_fork (check_run.c:463) ==23709== by 0x52036BE: srunner_iterate_tcase_tfuns (check_run.c:224) ==23709== by 0x52036BE: srunner_run_tcase (check_run.c:373) ==23709== by 0x52036BE: srunner_iterate_suites (check_run.c:195) ==23709== by 0x52036BE: srunner_run (check_run.c:782) ==23709== by 0x4255EF: main (libarmored-ml-tests.check:189) libarmored_ml_init is mine and is supposed to be called one per libarmored_ml_delete. It is actually silly for it to leak memory since it is fifty lines and I would have noticed it. valgrind would also have noticed it when running in CK_NOFORK mode. Here is the last error (there were many repeats, I may have missed one), again, this is part of my init (two of two allocs). ==23709== 16 bytes in 1 blocks are still reachable in loss record 35 of 1,831 ==23709== at 0x4C2B010: malloc (in /usr/lib64/valgrind/ vgpreload_memcheck-amd64-linux.so) ==23709== by 0x4EDFF30: recode_malloc (in /usr/lib64/librecode.so.0.0.0) ==23709== by 0x4EDDA75: declare_implied_surface (in /usr/lib64/ librecode.so.0.0.0) ==23709== by 0x4EDF156: recode_new_outer (in /usr/lib64/librecode.so.0.0.0) ==23709== by 0x42438F: libarmored_ml_init (armor-init.c:52) ==23709== by 0x424A70: setup (libarmored-ml-tests.check:18) ==23709== by 0x5202BB2: srunner_run_setup (check_run.c:297) ==23709== by 0x52036BE: tcase_run_checked_setup (check_run.c:324) ==23709== by 0x52036BE: tcase_run_tfun_fork (check_run.c:463) ==23709== by 0x52036BE: srunner_iterate_tcase_tfuns (check_run.c:224) ==23709== by 0x52036BE: srunner_run_tcase (check_run.c:373) ==23709== by 0x52036BE: srunner_iterate_suites (check_run.c:195) ==23709== by 0x52036BE: srunner_run (check_run.c:782) ==23709== by 0x4255EF: main (libarmored-ml-tests.check:189) Thanks, David |
From: David N. <do...@ma...> - 2016-03-12 17:21:10
|
Hello, I began using check in my own project and I intend to contribute to the uzbl browser on gihub. I have a problem though, up until now I've used mockups when working with my project as it is pretty basic, but when working on something that uses webkit, glib, gtk , and a lot of global information passing via structs I find that significant effort is needed to create the mockups (I've mocked-up everything but glib so far, which I don't think I'll (be able to), do). I wanted to know if you fellows do the same or what? I thought I might try a different framework, like cmocka, but I could not understand their framework. I also must confess that I like yours a lot. I did read the docs, but they and the money examples provide no answer, or at least I did not notice any answer. Thanks, David |