All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [RFC] Calling SAFE_MACROS() from test cleanup()
@ 2014-02-12 16:18 chrubis
  0 siblings, 0 replies; only message in thread
From: chrubis @ 2014-02-12 16:18 UTC (permalink / raw)
  To: ltp-list

Hi!
Currently we have a ugly hack that allows SAFE_MACROS() to be called
from test cleanup. See tst_brk() function in the tst_res.c especially:

        /*
         * If no cleanup function was specified, just return to the caller.
         * Otherwise call the specified function.
         */
        if (func != NULL) {
                tst_brk_entered++;
                (*func) ();
                tst_brk_entered--;
        }
        if (tst_brk_entered == 0)
                tst_exit();


This piece of code detects if tst_brk() was called from tst_brk() recursively
and aborts only if it gets back to the first instance, which is ugly and
non-intuitive.

It has been added here in order not to abort a cleanup() if one of the
SAFE_MACROS() has failed (in which case it calls tst_brkm()).

If nobody object in a week or so I would:

* Add a deprecation warning in case that SAFE_MACRO was called from a cleanup()

* Add a deprecation warning in case tst_brkm() was called recursively

* Patches that use SAFE_MACROS() or tst_brkm() in cleanup will not be accepted anymore


-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-02-12 16:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-12 16:18 [LTP] [RFC] Calling SAFE_MACROS() from test cleanup() chrubis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.