好了,我這裏有:
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