~autopilot/xpathselect/1.4

« back to all changes in this revision

Viewing changes to test/CMakeLists.txt

  • Committer: Tarmac
  • Author(s): Thomi Richards
  • Date: 2013-01-18 03:25:00 UTC
  • mfrom: (25.1.9 trunk)
  • Revision ID: tarmac-20130118032500-2bhgu0n9r1tl0a62
Add capability for searching sub-trees with '//'.

Approved by PS Jenkins bot, Christopher Lee.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 
6
6
set(CMAKE_CXX_FLAGS "-ggdb -O0 -Wall")
7
7
 
8
 
# Detect if C++11 support is available, and attempt fallback to C++0x support 
 
8
# Detect if C++11 support is available, and attempt fallback to C++0x support
9
9
if(CMAKE_COMPILER_IS_GNUCXX)
10
10
   execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
11
11
   if (GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7)
13
13
        add_definitions("-std=c++11")
14
14
 
15
15
        #run all tests
16
 
        set(SOURCES test_main.cpp test_node.cpp test_xpath_simple.cpp test_xpath_tree.cpp dummynode.h test_utils.cpp)
 
16
        set(SOURCES test_main.cpp test_node.cpp test_xpath_simple.cpp test_xpath_tree.cpp dummynode.h)
17
17
        add_executable(test-runner ${SOURCES})
18
18
 
19
19
        add_dependencies (test-runner gtest)
24
24
        message(WARNING "C++0x activated. Tests have been disabled")
25
25
        add_definitions("-std=c++0x")
26
26
   else ()
27
 
        message(FATAL_ERROR "C++11 needed. Therefore a gcc compiler with a version higher than 4.3 is needed.")   
 
27
        message(FATAL_ERROR "C++11 needed. Therefore a gcc compiler with a version higher than 4.3 is needed.")
28
28
   endif()
29
29
else(CMAKE_COMPILER_IS_GNUCXX)
30
30
   add_definitions("-std=c++11") #turn on and hope non-gnu compiler supports it
48
48
  )
49
49
endif(GTEST_INCLUDE_DIR)
50
50
 
 
51
enable_testing()
 
52
add_test(TestSuite test-runner)
 
53
add_custom_target (test COMMAND ./test-runner)