An emulator, assembler, and disassembler for the Sega Game Gear
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

runner.c 1.8 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /* Copyright (C) 2014-2015 Ben Kurtovic <ben.kurtovic@gmail.com>
  2. Released under the terms of the MIT License. See LICENSE for details. */
  3. #include <stdbool.h>
  4. #include <stdio.h>
  5. #include <stdlib.h>
  6. #include <string.h>
  7. #include "../src/logging.h"
  8. /*
  9. Run tests for the Z80 CPU.
  10. */
  11. static bool test_cpu()
  12. {
  13. // TODO
  14. return true;
  15. }
  16. /*
  17. Run tests for the VDP.
  18. */
  19. static bool test_vdp()
  20. {
  21. // TODO
  22. return true;
  23. }
  24. /*
  25. Run tests for the SN76489 PSG.
  26. */
  27. static bool test_psg()
  28. {
  29. // TODO
  30. return true;
  31. }
  32. /*
  33. Run tests for the assembler.
  34. */
  35. static bool test_asm()
  36. {
  37. // TODO
  38. return true;
  39. }
  40. /*
  41. Run tests for the disassembler.
  42. */
  43. static bool test_dis()
  44. {
  45. // TODO
  46. return true;
  47. }
  48. /*
  49. Run integration tests (i.e., multiple components working together).
  50. */
  51. static bool test_integrate()
  52. {
  53. // TODO
  54. return true;
  55. }
  56. /*
  57. Main function.
  58. */
  59. int main(int argc, char *argv[])
  60. {
  61. if (argc != 2)
  62. FATAL("a single component name is required")
  63. const char *component = argv[1], *name;
  64. bool (*func)();
  65. if (!strcmp(component, "cpu")) {
  66. name = "Z80 CPU";
  67. func = test_cpu;
  68. } else if (!strcmp(component, "vdp")) {
  69. name = "VDP";
  70. func = test_vdp;
  71. } else if (!strcmp(component, "psg")) {
  72. name = "SN76489 PSG";
  73. func = test_psg;
  74. } else if (!strcmp(component, "asm")) {
  75. name = "assembler";
  76. func = test_asm;
  77. } else if (!strcmp(component, "dis")) {
  78. name = "disassembler";
  79. func = test_dis;
  80. } else if (!strcmp(component, "integrate")) {
  81. name = "integration";
  82. func = test_integrate;
  83. } else {
  84. FATAL("unknown component: %s", component)
  85. }
  86. printf("crater: running %s tests\n", name);
  87. return func() ? EXIT_SUCCESS : EXIT_FAILURE;
  88. }