Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. [Moved]QMake: Adding target to start unit tests
QtWS25 Last Chance

[Moved]QMake: Adding target to start unit tests

Scheduled Pinned Locked Moved Qt Creator and other tools
2 Posts 2 Posters 3.8k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bkamps
    wrote on last edited by
    #1

    Hi,

    I want to add a target to my QMake unit test project file to execute the unit test that was built.

    In the makefile i would use the following targets:

    @
    all: $(TARGET)

    test: $(TARGET)
    @rm -f $(OBJDIR)/*.gcda
    @LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):$(subst $(SPACE),:,$(LDDIRS)) && ./$(TARGET)

    coverage: test
    @for i in cd ../main && ls *.cpp *.h && cd -; do echo $$i; gcov -o build $$i | grep -m1 "%"; done
    @

    (How) can this be done using QMake project files to generate a makefile like above?

    [EDIT: code formatting, Volker]

    1 Reply Last reply
    0
    • L Offline
      L Offline
      lgeyer
      wrote on last edited by
      #2

      One possibility would be "QMAKE_EXTRA_TARGETS":http://doc.qt.nokia.com/latest/qmake-environment-reference.html#customizing.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved