packagekit/libselftest/libselftest.h

71 lines
2.0 KiB
C
Raw Normal View History

2007-08-22 15:26:59 -07:00
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
*
* Copyright (C) 2007 Richard Hughes <richard@hughsie.com>
*
* Licensed under the GNU General Public License Version 2
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
2007-08-30 16:22:25 -07:00
#ifndef __LIBSELFTEST_H
#define __LIBSELFTEST_H
2007-08-30 16:20:13 -07:00
2007-08-22 15:26:59 -07:00
#include <glib.h>
2007-08-30 16:42:50 -07:00
#include <string.h>
2007-08-22 15:26:59 -07:00
typedef enum
{
CLASS_ALL,
CLASS_AUTO,
CLASS_MANUAL,
CLASS_LAST
2007-08-30 16:20:13 -07:00
} LibSelfTestClass;
2007-08-22 15:26:59 -07:00
typedef enum
{
LEVEL_QUIET,
LEVEL_NORMAL,
LEVEL_ALL,
LEVEL_LAST
2007-08-30 16:20:13 -07:00
} LibSelfTestLevel;
2007-08-22 15:26:59 -07:00
typedef struct
{
guint total;
guint succeeded;
gboolean started;
2007-08-30 16:20:13 -07:00
LibSelfTestClass class;
LibSelfTestLevel level;
2007-08-22 15:26:59 -07:00
gchar *type;
GTimer *timer;
GMainLoop *loop;
guint hang_loop_id;
2007-08-30 16:20:13 -07:00
} LibSelfTest;
2007-08-22 15:26:59 -07:00
gboolean libst_start (LibSelfTest *test, const gchar *name, LibSelfTestClass class);
void libst_end (LibSelfTest *test);
void libst_title (LibSelfTest *test, const gchar *format, ...);
void libst_success (LibSelfTest *test, const gchar *format, ...);
void libst_failed (LibSelfTest *test, const gchar *format, ...);
void libst_init (LibSelfTest *test);
gint libst_finish (LibSelfTest *test);
guint libst_elapsed (LibSelfTest *test);
2008-03-04 12:14:29 -08:00
void libst_loopquit (LibSelfTest *test);
void libst_loopwait (LibSelfTest *test, guint timeout);
void libst_loopcheck (LibSelfTest *test);
2007-08-22 15:26:59 -07:00
2007-08-30 16:22:25 -07:00
#endif /* __LIBSELFTEST_H */
2007-08-22 15:26:59 -07:00