module.mk 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. ######################################################################
  2. # Unit/regression tests, based on CxxTest.
  3. # Use the 'test' target to run them.
  4. # Edit TESTS and TESTLIBS to add more tests.
  5. #
  6. ######################################################################
  7. TESTS := $(srcdir)/decompiler/test/*.h
  8. TEST_LIBS := \
  9. common/file.o\
  10. decompiler/codegen.o \
  11. decompiler/control_flow.o \
  12. decompiler/disassembler.o \
  13. decompiler/instruction.o \
  14. decompiler/simple_disassembler.o \
  15. decompiler/value.o \
  16. decompiler/scummv6/disassembler.o \
  17. decompiler/scummv6/codegen.o \
  18. decompiler/scummv6/engine.o \
  19. decompiler/kyra/disassembler.o \
  20. decompiler/kyra/codegen.o \
  21. decompiler/kyra/engine.o \
  22. decompiler/test/disassembler/pasc.o \
  23. decompiler/test/disassembler/subopcode.o \
  24. decompiler/unknown_opcode.o \
  25. #
  26. TEST_FLAGS := --runner=StdioPrinter
  27. TEST_CFLAGS := -I$(srcdir)/decompiler/test/cxxtest
  28. TEST_LDFLAGS := $(decompile_LIBS) $(LDFLAGS)
  29. ifdef HAVE_GCC3
  30. # In test/common/str.h, we test a zero length format string. This causes GCC
  31. # to generate a warning which in turn poses a problem when building with -Werror.
  32. # To work around this, we disable -Wformat here.
  33. TEST_CFLAGS += -Wno-format
  34. endif
  35. # Enable this to get an X11 GUI for the error reporter.
  36. #TEST_FLAGS += --gui=X11Gui
  37. #TEST_LDFLAGS += -L/usr/X11R6/lib -lX11
  38. test: decompiler/test/runner
  39. ./decompiler/test/runner
  40. decompiler/test/runner: decompiler/test/runner.cpp $(TEST_LIBS)
  41. $(QUIET_LINK)$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TEST_LDFLAGS) $(TEST_CFLAGS) -o $@ $+
  42. decompiler/test/runner.cpp: $(TESTS)
  43. @mkdir -p decompiler
  44. @mkdir -p decompiler/test
  45. python $(srcdir)/decompiler/test/cxxtest/cxxtestgen.py $(TEST_FLAGS) -o $@ $+
  46. clean: clean-test
  47. clean-test:
  48. -$(RM) decompiler/test/runner.cpp decompiler/test/runner
  49. .PHONY: test clean-test