From: Arnaud Giersch Date: Fri, 25 Oct 2013 07:58:04 +0000 (+0200) Subject: Put tests for tesh output sort in a separate file. X-Git-Tag: v3_10_rc1~69 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/989836699a54a02c1734402044b4a44504e3a167?hp=109b41019044f71d00b627a6e8579bae7b1cd93a Put tests for tesh output sort in a separate file. --- diff --git a/buildtools/Cmake/AddTests.cmake b/buildtools/Cmake/AddTests.cmake index a08908d7fa..6d8b7d84f5 100644 --- a/buildtools/Cmake/AddTests.cmake +++ b/buildtools/Cmake/AddTests.cmake @@ -32,7 +32,7 @@ INCLUDE(CTest) ENABLE_TESTING() if(NOT enable_memcheck) - ADD_TEST(tesh-self-basic ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/bin --cd "${CMAKE_HOME_DIRECTORY}/tools/tesh" basic.tesh) + ADD_TEST(tesh-self-basic ${TESH_COMMAND} ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/basic.tesh) ADD_TEST(tesh-self-cd ${TESH_COMMAND} ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/cd.tesh) ADD_TEST(tesh-self-IO-broken-pipe ${TESH_COMMAND} ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/IO-broken-pipe.tesh) ADD_TEST(tesh-self-IO-orders ${TESH_COMMAND} ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/IO-orders.tesh) @@ -40,6 +40,7 @@ if(NOT enable_memcheck) ADD_TEST(tesh-self-set-return ${TESH_COMMAND} ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/set-return.tesh) ADD_TEST(tesh-self-set-timeout ${TESH_COMMAND} ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/set-timeout.tesh) ADD_TEST(tesh-self-set-ignore-output ${TESH_COMMAND} ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/set-ignore-output.tesh) + ADD_TEST(tesh-self-set-output-sort ${TESH_COMMAND} ${TESH_OPTION} --setenv bindir=${CMAKE_BINARY_DIR}/bin --cd "${CMAKE_HOME_DIRECTORY}/tools/tesh" set-output-sort.tesh) ADD_TEST(tesh-self-catch-return ${TESH_COMMAND} ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/catch-return.tesh) ADD_TEST(tesh-self-catch-timeout ${TESH_COMMAND} ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/catch-timeout.tesh) ADD_TEST(tesh-self-catch-wrong-output ${TESH_COMMAND} ${TESH_OPTION} --cd "${CMAKE_BINARY_DIR}/bin" ${CMAKE_HOME_DIRECTORY}/tools/tesh/catch-wrong-output.tesh) diff --git a/tools/tesh/CMakeLists.txt b/tools/tesh/CMakeLists.txt index 3ed17582b5..d26fdee4fd 100644 --- a/tools/tesh/CMakeLists.txt +++ b/tools/tesh/CMakeLists.txt @@ -27,11 +27,12 @@ set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/setenv.tesh ${CMAKE_CURRENT_SOURCE_DIR}/set-ignore-output.tesh + ${CMAKE_CURRENT_SOURCE_DIR}/set-output-sort.tesh + ${CMAKE_CURRENT_SOURCE_DIR}/set-output-sort-1.tesh ${CMAKE_CURRENT_SOURCE_DIR}/set-return.tesh ${CMAKE_CURRENT_SOURCE_DIR}/set-signal.tesh ${CMAKE_CURRENT_SOURCE_DIR}/set-timeout.tesh ${CMAKE_CURRENT_SOURCE_DIR}/background.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/basic2.tesh ${CMAKE_CURRENT_SOURCE_DIR}/basic.tesh ${CMAKE_CURRENT_SOURCE_DIR}/bg-basic.tesh ${CMAKE_CURRENT_SOURCE_DIR}/bg-set-signal.tesh diff --git a/tools/tesh/basic.tesh b/tools/tesh/basic.tesh index d8c8f68c00..fd7de37e71 100644 --- a/tools/tesh/basic.tesh +++ b/tools/tesh/basic.tesh @@ -29,23 +29,3 @@ $ wc -l tmp_fich > 4 tmp_fich $ rm tmp_fich - -$ ${bindir:=.}/tesh --enable-coverage --log='log.thresh:info tesh.fmt:%m%n' basic2.tesh -> Enable coverage -> Test suite `basic2' -> [basic2:3] Test sorting and filtering of output -> [basic2:5] true -> [basic2:8] true -> [basic2:10] printf 'profiling: foo\\n' -> [basic2:12] printf 'profiling: foo' -> [basic2:15] printf 'profiling: foo\\n' -> [basic2:18] printf 'profiling: foo' -> [basic2:20] printf 'a\\nb\\nc\\nd\\n' -> [basic2:26] printf 'a\\nb\\nc\\nd' -> [basic2:33] printf 'c\\nd\\nb\\na\\n' -> [basic2:40] printf 'c\\nd\\nb\\na' -> [basic2:46] printf 'a\\nprofiling: foo\\nprofiling: bar\\nb\\nc\\nd\\nprofiling: baz\\n' -> [basic2:52] printf 'a\\nprofiling: foo\\nprofiling: bar\\nb\\nc\\nd\\nprofiling: baz' -> [basic2:59] printf 'c\\nprofiling: foo\\nprofiling: bar\\nd\\nb\\na\\nprofiling: baz\\n' -> [basic2:66] printf 'c\\nprofiling: foo\\nprofiling: bar\\nd\\nb\\na\\nprofiling: baz' -> Test suite `basic2' OK diff --git a/tools/tesh/basic2.tesh b/tools/tesh/set-output-sort-1.tesh similarity index 98% rename from tools/tesh/basic2.tesh rename to tools/tesh/set-output-sort-1.tesh index b95065e132..c009b4a718 100644 --- a/tools/tesh/basic2.tesh +++ b/tools/tesh/set-output-sort-1.tesh @@ -1,5 +1,3 @@ -#! ./tesh - p Test sorting and filtering of output $ true diff --git a/tools/tesh/set-output-sort.tesh b/tools/tesh/set-output-sort.tesh new file mode 100644 index 0000000000..5903494505 --- /dev/null +++ b/tools/tesh/set-output-sort.tesh @@ -0,0 +1,23 @@ +#! ./tesh + +p This tests whether TESH correctly sorts command output + +$ ${bindir:=.}/tesh --enable-coverage --log='log.thresh:info tesh.fmt:%m%n' set-output-sort-1.tesh +> Enable coverage +> Test suite `set-output-sort-1' +> [set-output-sort-1:1] Test sorting and filtering of output +> [set-output-sort-1:3] true +> [set-output-sort-1:6] true +> [set-output-sort-1:8] printf 'profiling: foo\\n' +> [set-output-sort-1:10] printf 'profiling: foo' +> [set-output-sort-1:13] printf 'profiling: foo\\n' +> [set-output-sort-1:16] printf 'profiling: foo' +> [set-output-sort-1:18] printf 'a\\nb\\nc\\nd\\n' +> [set-output-sort-1:24] printf 'a\\nb\\nc\\nd' +> [set-output-sort-1:31] printf 'c\\nd\\nb\\na\\n' +> [set-output-sort-1:38] printf 'c\\nd\\nb\\na' +> [set-output-sort-1:44] printf 'a\\nprofiling: foo\\nprofiling: bar\\nb\\nc\\nd\\nprofiling: baz\\n' +> [set-output-sort-1:50] printf 'a\\nprofiling: foo\\nprofiling: bar\\nb\\nc\\nd\\nprofiling: baz' +> [set-output-sort-1:57] printf 'c\\nprofiling: foo\\nprofiling: bar\\nd\\nb\\na\\nprofiling: baz\\n' +> [set-output-sort-1:64] printf 'c\\nprofiling: foo\\nprofiling: bar\\nd\\nb\\na\\nprofiling: baz' +> Test suite `set-output-sort-1' OK