main.cpp 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /**
  2. * Copyright (c) 2019 Paul-Louis Ageneau
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2.1 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with this library; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  17. */
  18. #include <iostream>
  19. using namespace std;
  20. void test_connectivity();
  21. void test_capi();
  22. void test_websocket();
  23. int main(int argc, char **argv) {
  24. try {
  25. cout << endl << "*** Running WebRTC connectivity test..." << endl;
  26. test_connectivity();
  27. cout << "*** Finished WebRTC connectivity test" << endl;
  28. } catch (const exception &e) {
  29. cerr << "WebRTC connectivity test failed: " << e.what() << endl;
  30. return -1;
  31. }
  32. try {
  33. cout << endl << "*** Running WebRTC C API test..." << endl;
  34. test_capi();
  35. cout << "*** Finished WebRTC C API test" << endl;
  36. } catch (const exception &e) {
  37. cerr << "WebRTC C API test failed: " << e.what() << endl;
  38. return -1;
  39. }
  40. #if RTC_ENABLE_WEBSOCKET
  41. try {
  42. cout << endl << "*** Running WebSocket test..." << endl;
  43. test_websocket();
  44. cout << "*** Finished WebSocket test" << endl;
  45. } catch (const exception &e) {
  46. cerr << "WebSocket test failed: " << e.what() << endl;
  47. return -1;
  48. }
  49. #endif
  50. return 0;
  51. }