Hallo,

On 7/13/06, Bruce Stephens <[EMAIL PROTECTED]> 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/


_______________________________________________
Monotone-devel mailing list
Monotone-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monotone-devel

Reply via email to