Changeset 2414


Ignore:
Timestamp:
03/12/10 21:32:22 (5 months ago)
Author:
aturner
Message:

add additional unit test and indvidual make test_* targets
refs #341

Location:
trunk/test
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/CMakeLists.txt

    r2387 r2414  
    4545 
    4646set(tcpreplay_tests replay_basic replay_cache replay_pps replay_rate replay_top 
    47     replay_config replay_multi replay_pps_multi) 
     47    replay_config replay_multi replay_pps_multi replay_precache) 
    4848 
    4949######################################################### 
     
    7676    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/test 
    7777    DEPENDS Tests.cmake 
     78    COMMENT "Run all unit tests" 
    7879    VERBATIM) 
     80foreach(__test @tcpprep_tests@ @tcpreplay_tests@ @tcprewrite_tests@) 
     81    add_custom_target(${__test}) 
     82    add_custom_command(TARGET ${__test} 
     83        COMMAND cmake -D RUN_SINGLE:STRING=${__test} -P Tests.cmake 
     84        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/test 
     85        DEPENDS Tests.cmake  
     86        COMMENT "Run single unit test: ${__test}" 
     87        VERBATIM) 
     88endforeach(__test) 
    7989 
    8090# Add output files of tests to ADDITIONAL_MAKE_CLEAN_FILES 
  • trunk/test/RunUnitTest.cmake.in

    r2271 r2414  
    4747set(replay_multi "-i @NIC1@ --multiplier=25.0 test.pcap") 
    4848set(replay_pps_multi "-i @NIC1@ --pps=100 --pps-multi=5 test.pcap") 
     49set(replay_precache "-i @NIC1@ --preload-pcap test.pcap") 
    4950 
    5051set(DIFF @DIFF@) 
     
    6970        string(REPLACE __file__ ${output_file} new_command "${${__test}}") 
    7071    endif(standard) 
    71          
    7272 
    7373    set(stderr "") 
    7474    set(stdout "") 
    7575    set(rcode 0) 
    76      
    77      
     76 
    7877    if(__test MATCHES "rewrite_") 
    7978        # tcprewrite test! 
     
    118117            OUTPUT_STRIP_TRAILING_WHITESPACE) 
    119118    endif(__test MATCHES "rewrite_") 
    120      
     119 
    121120    if(NOT standard) 
    122121        if(rcode EQUAL 0) 
     
    125124                    execute_process(COMMAND @DIFF@ ${standard_file} ${output_file} 
    126125                    RESULT_VARIABLE diff_rcode) 
    127              
     126 
    128127                    if(${diff_rcode} EQUAL 0) 
    129128                        message(STATUS "Running ${__test}: OK!") 
     
    135134                endif(DIFF) 
    136135            else(EXISTS ${output_file}) 
    137                 message(STATUS "Running ${__test}: OK!")             
     136                message(STATUS "Running ${__test}: OK!") 
    138137            endif(EXISTS ${output_file}) 
    139              
     138 
    140139        else(rcode EQUAL 0) 
    141140            message(STATUS "Running ${__test}: FAILED!  Error code: ${rcode}") 
Note: See TracChangeset for help on using the changeset viewer.