Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 

98 linhas
2.6 KiB

  1. CC = gcc
  2. CFLAGS = -Wall
  3. LDFLAGS =
  4. # Need BCM26 <-> BCM19 connected (1kOhm)
  5. tests = wiringpi_test1_sysfs wiringpi_test2_sysfs wiringpi_test3_device_wpi wiringpi_test4_device_phys wiringpi_test5_default wiringpi_test6_isr wiringpi_test7_version
  6. # Need XO hardware
  7. xotests = wiringpi_xotest_test1_spi wiringpi_i2c_test1_pcf8574
  8. # Need PiFace hardware and tests condition
  9. pifacetests = wiringpi_piface_test1
  10. all: $(tests) $(xotests) $(pifacetests)
  11. wiringpi_test1_sysfs:
  12. ${CC} ${CFLAGS} wiringpi_test1_sysfs.c -o wiringpi_test1_sysfs -lwiringPi
  13. wiringpi_test2_sysfs:
  14. ${CC} ${CFLAGS} wiringpi_test2_sysfs.c -o wiringpi_test2_sysfs -lwiringPi
  15. wiringpi_test3_device_wpi:
  16. ${CC} ${CFLAGS} wiringpi_test3_device_wpi.c -o wiringpi_test3_device_wpi -lwiringPi
  17. wiringpi_test4_device_phys:
  18. ${CC} ${CFLAGS} wiringpi_test4_device_phys.c -o wiringpi_test4_device_phys -lwiringPi
  19. wiringpi_test5_default:
  20. ${CC} ${CFLAGS} wiringpi_test5_default.c -o wiringpi_test5_default -lwiringPi
  21. wiringpi_test6_isr:
  22. ${CC} ${CFLAGS} wiringpi_test6_isr.c -o wiringpi_test6_isr -lwiringPi
  23. wiringpi_test7_version:
  24. ${CC} ${CFLAGS} wiringpi_test7_version.c -o wiringpi_test7_version -lwiringPi
  25. wiringpi_xotest_test1_spi:
  26. ${CC} ${CFLAGS} wiringpi_xotest_test1_spi.c -o wiringpi_xotest_test1_spi -lwiringPi
  27. wiringpi_i2c_test1_pcf8574:
  28. ${CC} ${CFLAGS} wiringpi_i2c_test1_pcf8574.c -o wiringpi_i2c_test1_pcf8574 -lwiringPi
  29. wiringpi_piface_test1:
  30. ${CC} ${CFLAGS} wiringpi_piface_test1.c -o wiringpi_piface_test1 -lwiringPi -lwiringPiDev
  31. test:
  32. @error_state=false ; \
  33. for t in $(tests) ; do \
  34. echo === unit test: $${t} === ; \
  35. time ./$${t}; \
  36. if [ $$? -ne 0 ]; then \
  37. error_state=true ; \
  38. fi ; \
  39. echo ; echo ; \
  40. done ; \
  41. if [ "$$error_state" = true ]; then \
  42. echo "\n\e[5mSTD TEST FAILED\e[0m\n"; \
  43. else \
  44. echo "\n\e[5mSTD TEST SUCCESS\e[0m\n"; \
  45. fi
  46. xotest:
  47. @error_state=false ; \
  48. for t in $(tests) $(xotests) ; do \
  49. echo === XO unit test: $${t} === ; \
  50. time ./$${t} ; \
  51. if [ $$? -ne 0 ]; then \
  52. error_state=true ; \
  53. fi ; \
  54. echo ; echo ; \
  55. done
  56. if [ "$$error_state" = true ]; then \
  57. echo "\n\e[5mSTD/XO TEST FAILED\e[0m\n"; \
  58. else \
  59. echo "\n\e[5mSTD/XO TEST SUCCESS\e[0m\n"; \
  60. fi
  61. pifacetest:
  62. @error_state=false ; \
  63. for t in $(tests) $(pifacetests) ; do \
  64. echo === PiFace unit test: $${t} === ; \
  65. time ./$${t} ; \
  66. if [ $$? -ne 0 ]; then \
  67. error_state=true ; \
  68. fi ; \
  69. echo ; echo ; \
  70. done
  71. if [ "$$error_state" = true ]; then \
  72. echo "\n\e[5mPIFACE TEST FAILED\e[0m\n"; \
  73. else \
  74. echo "\n\e[5mPIFACE TEST SUCCESS\e[0m\n"; \
  75. fi
  76. clean:
  77. for t in $(tests) $(xotests) $(pifacetests) ; do \
  78. rm -fv $${t} ; \
  79. done