Important: Please read the Qt Code of Conduct -

[Moved]QMake: Adding target to start unit tests

  • 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

    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]

  • One possibility would be "QMAKE_EXTRA_TARGETS":

Log in to reply