monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] Re: Testsuite status (SoC)


From: Alex Queiroz
Subject: Re: [Monotone-devel] Re: Testsuite status (SoC)
Date: Thu, 13 Jul 2006 17:05:34 -0300

Hallo,

On 7/13/06, Bruce Stephens <address@hidden> wrote:

Easier, but still not trivial.  It's surely still four or five lines
per function?


    This is getting off-topic, but still... What I did was to create
some macros for the developers to allow them to write the testsuite
without any Lua knowledge:

DECLARE_TEST(equality)
{
    if(1 == 1) {
         TEST_OK();
    } else {
         TEST_FAILED("not equal!");
    }
}

would become:

static int equality(lua_State* L)
{
    if(1 == 1) {
        do {
                lua_pushboolean(L, 1);
                return 1;
        } while(0);
    } else {
        do {
                return luaL_error(L, "%s(%d): %s", __FILE__, __LINE__, "not 
equal!");
        } while(0);
    }
}

    Of course there is more to it, but as you can see the impact is minimal.

--
-alex
http://www.ventonegro.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]