Module_PCBTest.c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * Module_PCBTest.c
  3. *
  4. * Created on: 2020¦~5¤ë17¤é
  5. * Author: Wendell
  6. */
  7. #include <stdio.h>
  8. #include <stdlib.h>
  9. #include <string.h>
  10. #include "Module_PCBTest.h"
  11. #include "Comm_Test.h"
  12. #include "PrimaryMCU_Test.h"
  13. #include "IO_Test.h"
  14. #include "Storage_Test.h"
  15. #include "Ethernet_Test.h"
  16. TestItem const TestList[] =
  17. {
  18. { 4, "Communication Test", "comm", DoDCMCommTest},
  19. { 4, "Ethernet 0 Test", "eth0", DoEthernet0Test},
  20. { 4, "Ethernet 1 Test", "eth1", DoEthernet1Test},
  21. { 7, "Primary MCU Test", "primary", DoPrimaryMCUTest},
  22. { 2, "Digital & Analog IO Test", "io", DoIOTest},
  23. { 7, "Storage Test", "storage", DoStorageTest},
  24. { 0, "", "", 0}
  25. };
  26. int main(int argc, char *argv[])
  27. {
  28. const TestItem *tItem;
  29. if(argc > 1)
  30. {
  31. for(tItem = TestList; tItem->CmdStrLen; tItem++)
  32. {
  33. if(strncmp(tItem->Cmd, argv[1], tItem->CmdStrLen) == 0)
  34. {
  35. printf("\r\nDCM %s Start", tItem->Name); /* prints !!!Hello World!!! */
  36. (*tItem->fnCmd)();
  37. break;
  38. }
  39. }
  40. }
  41. else
  42. {
  43. printf("\r\nNeed Some Parameter");
  44. }
  45. printf("\r\n");
  46. return 0;
  47. }