1
/***************************************************************************
2
qttest.cpp - QtTest ruby extension
5
copyright : (C) 2008 by Richard Dale
6
email : richard.j.dale@gmail.com
7
***************************************************************************/
9
/***************************************************************************
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
16
***************************************************************************/
24
#include <smoke/qttest_smoke.h>
30
static VALUE getClassList(VALUE /*self*/)
32
VALUE classList = rb_ary_new();
33
for (int i = 1; i <= qttest_Smoke->numClasses; i++) {
34
if (qttest_Smoke->classes[i].className && !qttest_Smoke->classes[i].external)
35
rb_ary_push(classList, rb_str_new2(qttest_Smoke->classes[i].className));
41
resolve_classname_qttest(smokeruby_object * o)
43
return qtruby_modules[o->smoke].binding->className(o->classId);
46
extern TypeHandler QtTest_handlers[];
51
VALUE qttest_internal_module;
53
static QtRuby::Binding binding;
60
binding = QtRuby::Binding(qttest_Smoke);
62
smokeList << qttest_Smoke;
64
QtRubyModule module = { "QtTest", resolve_classname_qttest, 0, &binding };
65
qtruby_modules[qttest_Smoke] = module;
67
install_handlers(QtTest_handlers);
69
qttest_module = rb_define_module("QtTest");
70
qttest_internal_module = rb_define_module_under(qttest_module, "Internal");
72
rb_define_singleton_method(qttest_internal_module, "getClassList", (VALUE (*) (...)) getClassList, 0);
74
rb_require("qttest/qttest.rb");
75
rb_funcall(qttest_internal_module, rb_intern("init_all_classes"), 0);