shell_recorder for all plugins #1498

Open
markus2330 opened this Issue May 17, 2017 · 1 comment

Comments

Projects
None yet
1 participant
@markus2330
Contributor

markus2330 commented May 17, 2017

Add shell recorder tests for all plugins + execute them for all (automatically). The change to do so is trivial:

diff --git a/tests/shell/shell_recorder/tutorial_wrapper/CMakeLists.txt b/tests/shell/shell_recorder/tutorial_wrapper/CMakeLists.txt
index 8ab6c57..aff236f 100644
--- a/tests/shell/shell_recorder/tutorial_wrapper/CMakeLists.txt
+++ b/tests/shell/shell_recorder/tutorial_wrapper/CMakeLists.txt
@@ -8,28 +8,13 @@ function (add_s_test NAME FILE)
        set_property(TEST testshell_markdown_${NAME} PROPERTY LABELS memleak kdbtests)
 endfunction ()
 
-function (add_plugin_shell_test PLUGIN)
-       list (FIND REMOVED_PLUGINS ${PLUGIN} INDEX)
-       if (${INDEX} EQUAL -1)
-               add_s_test (${PLUGIN} "${CMAKE_SOURCE_DIR}/src/plugins/${PLUGIN}/README.md")
-       endif ()
-endfunction ()
-
 add_s_test (tutorial_cascading "${CMAKE_SOURCE_DIR}/doc/tutorials/cascading.md")
 add_s_test (kdb-complete "${CMAKE_SOURCE_DIR}/doc/help/kdb-complete.md")
 
-add_plugin_shell_test (blockresolver)
-add_plugin_shell_test (conditionals)
-add_plugin_shell_test (enum)
-add_plugin_shell_test (hosts)
-add_plugin_shell_test (line)
-add_plugin_shell_test (mathcheck)
-add_plugin_shell_test (multifile)
-add_plugin_shell_test (mini)
-add_plugin_shell_test (mozprefs)
-add_plugin_shell_test (xerces)
-add_plugin_shell_test (range)
-add_plugin_shell_test (type)
+
+foreach (PLUGIN ${ADDED_DIRECTORIES})
+       add_s_test (${PLUGIN} "${CMAKE_SOURCE_DIR}/src/plugins/${PLUGIN}/README.md")
+endforeach(PLUGIN)
 
 # Only works with super user privileges, since it writes to `/etc/hosts`:
 # add_s_test (tutorial_mount "${CMAKE_SOURCE_DIR}/doc/tutorials/mount.md")

But then many of the tests fail:

The following tests FAILED:
        130 - testshell_markdown_augeas (Failed)
        131 - testshell_markdown_base64 (Failed)
        133 - testshell_markdown_boolean (Failed)
        134 - testshell_markdown_c (Failed)
        135 - testshell_markdown_cachefilter (Failed)
        136 - testshell_markdown_ccode (Failed)
        138 - testshell_markdown_constants (Failed)
        139 - testshell_markdown_counter (Failed)
        140 - testshell_markdown_crypto (Failed)
        141 - testshell_markdown_csvstorage (Failed)
        142 - testshell_markdown_curlget (Failed)
        143 - testshell_markdown_date (Failed)
        144 - testshell_markdown_dbus (Failed)
        145 - testshell_markdown_desktop (Failed)
        146 - testshell_markdown_doc (Failed)
        147 - testshell_markdown_dpkg (Failed)
        148 - testshell_markdown_dump (Failed)
        150 - testshell_markdown_error (Failed)
        151 - testshell_markdown_fcrypt (Failed)
        152 - testshell_markdown_file (Failed)
        153 - testshell_markdown_filecheck (Failed)
        154 - testshell_markdown_fstab (Failed)
        155 - testshell_markdown_glob (Failed)
        156 - testshell_markdown_hexcode (Failed)
        157 - testshell_markdown_hidden (Failed)
        160 - testshell_markdown_ini (Failed)
        161 - testshell_markdown_iterate (Failed)
        162 - testshell_markdown_jni (Failed)
        163 - testshell_markdown_journald (Failed)
        164 - testshell_markdown_keytometa (Failed)
        166 - testshell_markdown_lineendings (Failed)
        167 - testshell_markdown_list (Failed)
        168 - testshell_markdown_logchange (Failed)
        169 - testshell_markdown_lua (Failed)
        174 - testshell_markdown_network (Failed)
        175 - testshell_markdown_ni (Failed)
        176 - testshell_markdown_noresolver (Failed)
        177 - testshell_markdown_null (Failed)
        178 - testshell_markdown_passwd (Failed)
        179 - testshell_markdown_path (Failed)
        180 - testshell_markdown_profile (Failed)
        181 - testshell_markdown_python (Failed)
        182 - testshell_markdown_python2 (Failed)
        184 - testshell_markdown_regexstore (Failed)
        185 - testshell_markdown_rename (Failed)
        186 - testshell_markdown_required (Failed)
        187 - testshell_markdown_resolver (Failed)
        188 - testshell_markdown_semlock (Failed)
        189 - testshell_markdown_shell (Failed)
        190 - testshell_markdown_simpleini (Failed)
        191 - testshell_markdown_simplespeclang (Failed)
        192 - testshell_markdown_spec (Failed)
        193 - testshell_markdown_struct (Failed)
        194 - testshell_markdown_sync (Failed)
        195 - testshell_markdown_syslog (Failed)
        196 - testshell_markdown_tcl (Failed)
        197 - testshell_markdown_template (Failed)
        198 - testshell_markdown_timeofday (Failed)
        199 - testshell_markdown_tracer (Failed)
        201 - testshell_markdown_uname (Failed)
        202 - testshell_markdown_validation (Failed)
        203 - testshell_markdown_wresolver (Failed)
        205 - testshell_markdown_xmltool (Failed)
        206 - testshell_markdown_yajl (Failed)
@markus2330

This comment has been minimized.

Show comment
Hide comment
@markus2330

markus2330 Mar 3, 2018

Contributor

As suggested in #1831 we will explicitly add info in add_plugin about markdown shell tests where they are working.

We should also add this information in the README.md infos/status. Ideally automatically with update-infos-status. (It should be trivial, the required code is nearly identical to hookUnittest.)

@KurtMi Any specific reason why you did not write a function checkRegexForFile? There is quite some code duplication in update-infos-status.

Contributor

markus2330 commented Mar 3, 2018

As suggested in #1831 we will explicitly add info in add_plugin about markdown shell tests where they are working.

We should also add this information in the README.md infos/status. Ideally automatically with update-infos-status. (It should be trivial, the required code is nearly identical to hookUnittest.)

@KurtMi Any specific reason why you did not write a function checkRegexForFile? There is quite some code duplication in update-infos-status.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment