File: AddGTestSuite.cmake

package info (click to toggle)
cryptominisat 5.11.21%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 4,488 kB
  • sloc: cpp: 55,562; ansic: 7,786; python: 7,485; sh: 813; sql: 403; xml: 34; makefile: 22; javascript: 17
file content (26 lines) | stat: -rw-r--r-- 931 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Sets for the current directory (and below) the testsuite to use.
# This macro should be used with the AddSTPGTest function.
macro(AddGTestSuite TESTSUITENAME)
    set(TESTSUITE "${TESTSUITENAME}") # Unit test group name
    # Setup custom target
    add_custom_target(${TESTSUITE})
    add_dependencies(check ${TESTSUITE})

    if(USE_VALGRIND)
        set(LIT_EXTRA_FLAGS --vg --vg-leak)
    else()
        set(LIT_EXTRA_FLAGS "")
    endif()

    add_custom_command(TARGET ${TESTSUITE}
                       POST_BUILD
                       COMMAND ${LIT_TOOL} ${LIT_ARGS} ${LIT_EXTRA_FLAGS} ${CMAKE_CURRENT_BINARY_DIR}
                       COMMENT "Running ${TESTSUITE}"
                      )

    # Setup lit configuration
    configure_file(${CMAKE_SOURCE_DIR}/tests/lit-unit-tests-common.site.cfg.in
                   ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
                   @ONLY@
                  )
endmacro()