File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ #include " cppmenu.h"
2+ #include < iostream>
3+ #include < exception>
4+
5+ void foo () {
6+ return ;
7+ }
8+
9+ int main ()
10+ {
11+ try
12+ {
13+ CppMenu::CommonMenu menu
14+ {
15+ " SAMPLE TITLE" ,
16+
17+ {
18+ { " Function Title" , &foo, false }
19+ },
20+
21+ true
22+ };
23+
24+ if (false )
25+ menu.run (); // not executing so that the building and testing log doesn't get erased in case of running ctest -V
26+
27+ std::cout << " Automated tests passed.\n "
28+ << " You can include the cppmenu.h header file and use the CppMenu namespace.\n "
29+ << " You can try to run CppMenu-Tests executable to test the library's menus.\n " ;
30+ }
31+ catch (const std::exception& exception)
32+ {
33+ std::cerr << " CppMenu library's automated tests failed\n "
34+ << " Error: " << exception.what () << ' \n ' ;
35+
36+ return 1 ;
37+ }
38+
39+ return 0 ;
40+ }
You can’t perform that action at this time.
0 commit comments