test.me 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. test.me -- GoAhead Unit Tests
  3. */
  4. Me.load({
  5. targets: {
  6. /*
  7. Target for unit tests. Includes JST and form callbacks
  8. */
  9. 'goahead-test': {
  10. enable: `me.settings.profile != 'release'`,
  11. type: 'exe',
  12. sources: [ 'test.c' ],
  13. depends: [ 'libgo', 'install-certs' ],
  14. scripts: {
  15. prebuild: `
  16. if (me.settings.hasPam) {
  17. me.target.libraries.push('pam')
  18. }
  19. cp(['${BIN}/self.key', '${BIN}/self.crt'], '.')
  20. `,
  21. },
  22. },
  23. cgitest: {
  24. enable: 'me.settings.goahead.cgi',
  25. path: 'cgi-bin/cgitest${EXE}'
  26. type: 'exe',
  27. sources: [ 'cgitest.c' ],
  28. generate: false,
  29. },
  30. test: {
  31. action: `run('testme --depth ' + me.settings.depth)`,
  32. platforms: [ 'local' ],
  33. depends: [ 'test-prep' ],
  34. generate: false,
  35. },
  36. 'test-prep': {
  37. platforms: [ 'local' ],
  38. depends: [ 'clean-test', 'build', 'cgitest' ],
  39. generate: false,
  40. },
  41. 'clean-test': {
  42. type: 'clean',
  43. action: `
  44. Cmd.run('testme --clean')
  45. rm('cgi-bin/cgitest*')
  46. `
  47. }
  48. }
  49. })