self-test.mak 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. #
  2. # This is a make file for performing various tests on the libraries
  3. #
  4. # Sample user.mak contents:
  5. # export CFLAGS += -Wno-unused-label -Werror
  6. #
  7. # ifeq ($(CPP_MODE),1)
  8. # export CFLAGS += -x c++
  9. # export LDFLAGS += -lstdc++
  10. # endif
  11. PJSUA_OPT=--null-audio
  12. build_test: distclean rm_build_mak build_mak everything cpp_prep cpp_test cpp_post everything
  13. run_test: pjlib_test pjlib_util_test pjnath_test pjsip_test pjsua_test
  14. all: build_test run_test
  15. CPP_DIR=pjlib pjlib-util pjnath pjmedia pjsip
  16. .PHONY: build_test distclean rm_build_mak build_mak everything pjlib_test pjlib_util_test pjnath_test pjsip_test cpp_prep cpp_test cpp_post pjsua_test
  17. distclean:
  18. $(MAKE) distclean
  19. rm_build_mak:
  20. rm -f build.mak
  21. build_mak:
  22. ./configure
  23. $(MAKE) dep
  24. everything:
  25. $(MAKE)
  26. pjlib_test:
  27. cd pjlib/bin && ./pjlib-test-`../../config.guess`
  28. pjlib_util_test:
  29. cd pjlib-util/bin && ./pjlib-util-test-`../../config.guess`
  30. pjnath_test:
  31. cd pjnath/bin && ./pjnath-test-`../../config.guess`
  32. pjsip_test:
  33. cd pjsip/bin && ./pjsip-test-`../../config.guess`
  34. cpp_prep:
  35. for dir in $(CPP_DIR); do \
  36. $(MAKE) -C $$dir/build clean; \
  37. done
  38. cpp_test:
  39. $(MAKE) -f c++-build.mak
  40. cpp_post:
  41. $(MAKE) -f c++-build.mak clean
  42. pjsua_test: pjsua_config_file pjsua_local_port0 pjsua_ip_addr pjsua_no_tcp pjsua_no_udp pjsua_outbound pjsua_use_ice pjsua_add_codec pjsua_clock_rate pjsua_play_file pjsua_play_tone pjsua_rec_file pjsua_rtp_port pjsua_quality pjsua_ptime pjsua_ectail
  43. @echo pjsua_test completed successfully
  44. pjsua_config_file:
  45. touch testconfig.cfg
  46. echo q | pjsip-apps/bin/pjsua-`./config.guess` $(PJSUA_OPT) --config-file testconfig.cfg
  47. rm -f testconfig.cfg
  48. pjsua_local_port0:
  49. echo q | pjsip-apps/bin/pjsua-`./config.guess` $(PJSUA_OPT) --local-port 0
  50. pjsua_ip_addr:
  51. echo q | pjsip-apps/bin/pjsua-`./config.guess` $(PJSUA_OPT) --ip-addr 1.1.1.1
  52. pjsua_no_tcp:
  53. echo q | pjsip-apps/bin/pjsua-`./config.guess` $(PJSUA_OPT) --no-tcp
  54. pjsua_no_udp:
  55. echo q | pjsip-apps/bin/pjsua-`./config.guess` $(PJSUA_OPT) --no-udp
  56. pjsua_outbound:
  57. echo q | pjsip-apps/bin/pjsua-`./config.guess` $(PJSUA_OPT) --outbound 'sip:1.2.3.4;lr'
  58. pjsua_use_ice:
  59. echo q | pjsip-apps/bin/pjsua-`./config.guess` $(PJSUA_OPT) --use-ice
  60. pjsua_add_codec:
  61. echo q | pjsip-apps/bin/pjsua-`./config.guess` $(PJSUA_OPT) --add-codec pcma
  62. pjsua_clock_rate:
  63. echo q | pjsip-apps/bin/pjsua-`./config.guess` $(PJSUA_OPT) --clock-rate 8000
  64. pjsua_play_file:
  65. echo q | pjsip-apps/bin/pjsua-`./config.guess` $(PJSUA_OPT) --play-file pjsip-apps/bin/d16.wav --auto-play --auto-loop --auto-conf
  66. pjsua_play_tone:
  67. echo q | pjsip-apps/bin/pjsua-`./config.guess` $(PJSUA_OPT) --play-tone '400,600,100,500'
  68. pjsua_rec_file:
  69. echo q | pjsip-apps/bin/pjsua-`./config.guess` $(PJSUA_OPT) --rec-file pjsip-apps/bin/testrec.wav --auto-rec
  70. pjsua_rtp_port:
  71. echo q | pjsip-apps/bin/pjsua-`./config.guess` $(PJSUA_OPT) --rtp-port 8000
  72. pjsua_quality:
  73. echo q | pjsip-apps/bin/pjsua-`./config.guess` $(PJSUA_OPT) --quality 10
  74. pjsua_ptime:
  75. echo q | pjsip-apps/bin/pjsua-`./config.guess` $(PJSUA_OPT) --ptime 40
  76. pjsua_ectail:
  77. echo q | pjsip-apps/bin/pjsua-`./config.guess` $(PJSUA_OPT) --ec-tail 10