好了,我这里有:
Nana C++ GUI test in Travis
Other click,特拉维斯:
3.04s$ ./clicked
Will wait 2 sec...
waiting 2 sec...
running...
3 times automatic click.
Automatically clicking widget :
When the window fm is clicked, this function is called.
Automatically clicking widget :
When the window fm is clicked, this function is called.
Automatically clicking widget :
When the window fm is clicked, this function is called.
Now with then mouse.
Congratulations, this was not trivial !
Done...
Now again waiting 1 sec...
Done... Now API::exit all ...
编程here。
void clicked(const nana::arg_click & eventinfo)
{
std::cout<< "When the window fm is clicked, this function is called. \n";
}
int main()
{
using namespace nana;
form fm;
fm.events().click(clicked);
fm.show();
exec(2, 1, [&fm]()
{
std::cout << "3 times automatic click. \n";
click(fm);
click(fm);
click(fm);
nana::arg_mouse m;
m.window_handle=fm;
m.alt=m.ctrl=m.mid_button=m.shift=false;
m.left_button=true;
m.pos.x=m.pos.y=1;
m.button=::nana::mouse::left_button;
std::cout << "Now with then mouse. \n";
//fm.events().mouse_down.emit(m);
//fm.events().mouse_up.emit(m);
// char c;
// std::cin >> c;
//fm.close();
});
}
这远远没有准备好,只是我最初的想法。我最大的问题是,我没有在Linux的GUI经验。我实施了一些测试和几个例子,目前这些例子足以让我们发现大问题。我在Windows中测试localy(当然,当我有时间的时候......)但我个人无法在Linux中测试,所以,Travis对我来说非常有用。 我发明了几个函数来在GUI库自己写测试。不是(非常)优雅。我希望我会有时间让它变得更好。我很乐意看到您的解决方案。
这很有帮助。我现在会试试这个。谢谢! – richelbilderbeek
我试过使用它,但是https://travis-ci.org/richelbilderbeek/testing_cpp_gui_applications_tutorial#L948显示这不是问题。感谢您的帮助,但:-) – richelbilderbeek