Add tests.

This commit is contained in:
Matt McCormick 2013-06-09 22:50:03 -04:00
parent beea1a7cae
commit e5f3dc1503

@ -17,3 +17,29 @@ add_executable(tmux-mem-cpu-load tmux-mem-cpu-load.cpp)
install(TARGETS tmux-mem-cpu-load install(TARGETS tmux-mem-cpu-load
RUNTIME DESTINATION bin RUNTIME DESTINATION bin
) )
include( CTest )
if( BUILD_TESTING )
add_test( NAME usage
COMMAND tmux-mem-cpu-load -h )
add_test( NAME no_arguments
COMMAND tmux-mem-cpu-load )
add_test( NAME colors
COMMAND tmux-mem-cpu-load --colors )
add_test( NAME arguments
COMMAND tmux-mem-cpu-load --colors 1 4 )
add_test( NAME invalid_status_interval
COMMAND tmux-mem-cpu-load -1 4 )
add_test( NAME invalid_graph_lines
COMMAND tmux-mem-cpu-load 1 -4 )
set_tests_properties( usage
invalid_status_interval
invalid_graph_lines
PROPERTIES WILL_FAIL TRUE )
endif()