]> granicus.if.org Git - esp-idf/commitdiff
tiny-test-fw: add class diagram to document
authorHe Yin Ling <heyinling@espressif.com>
Sun, 1 Jul 2018 13:17:04 +0000 (21:17 +0800)
committerbot <bot@espressif.com>
Mon, 2 Jul 2018 10:40:23 +0000 (10:40 +0000)
tools/tiny-test-fw/docs/conf.py
tools/tiny-test-fw/docs/index.rst

index 254f841f711b45963cfe2fa3413c36eedb85377c..36e5aa93714e39a451d109ddb87b8ab193cd8024 100644 (file)
@@ -33,7 +33,8 @@ sys.path.insert(0, os.path.abspath('..'))
 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
 # ones.
 extensions = ['sphinx.ext.autodoc',
-    'sphinx.ext.viewcode']
+              'sphinx.ext.viewcode',
+              'plantweb.directive']
 
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['_templates']
index d154254aa4db7a064887f197b93ed2f462225e28..76bd236d07507e4638416763bb756a0fe4c67608 100644 (file)
@@ -11,27 +11,6 @@ Usually we send command to the port and then check response to see if the test s
 TinyTestFW is designed for such scenarios.
 It supports ESP-IDF applications and can be adapted to other applications by writing new bundles.
 
-Test FW features
-----------------
-
-1. Test Environment:
-    1. DUT: DUT class provides methods to interact with DUT
-        * read/write through port
-        * expect method which supports expect one or multiple string or RegEx
-        * tool methods provided by the tool bundle, like ``start_app``, ``reset``
-    2. App:
-        * provide some specific features to the test application of DUT, for example:
-            * SDK path
-            * SDK tools
-            * application information like partition table, download configs
-    3. Environment Configs:
-        * support get env configs from config file or auto-detect from current PC
-        * provide ``get_variable`` method to get variables
-2. Allow to customize components (DUT, App) to support different devices
-3. Integrate to CI:
-    * provide interfaces for Gitlab-CI
-    * provide ``search case`` and ``runner`` interfaces, able to integrate with other CI
-
 Example
 -------
 
@@ -110,6 +89,86 @@ SOP for adding test cases
 
 * or, use ``runner`` to execute. see :doc:`runner <Runner>` for details
 
+Test FW features
+----------------
+
+1. Test Environment:
+    1. DUT: DUT class provides methods to interact with DUT
+        * read/write through port
+        * expect method which supports expect one or multiple string or RegEx
+        * tool methods provided by the tool bundle, like ``start_app``, ``reset``
+    2. App:
+        * provide some specific features to the test application of DUT, for example:
+            * SDK path
+            * SDK tools
+            * application information like partition table, download configs
+    3. Environment Configs:
+        * support get env configs from config file or auto-detect from current PC
+        * provide ``get_variable`` method to get variables
+2. Allow to customize components (DUT, App) to support different devices
+3. Integrate to CI:
+    * provide interfaces for Gitlab-CI
+    * provide ``search case`` and ``runner`` interfaces, able to integrate with other CI
+
+
+Class Diagram
+=============
+.. uml::
+
+   class BaseDUT {
+   {field} app
+   {method} expect
+   {method} expect_any
+   {method} expect_all
+   {method} read
+   {method} write
+   {method} open
+   {method} close
+   }
+   class SerialDUT {
+   {method} _port_read
+   {method} _port_write
+   {method} _port_open
+   {method} _port_close
+   }
+   class IDFDUT {
+   {method} reset
+   {method} start_app
+   }
+   class BaseApp {
+   {method} get_sdk_path
+   {method} get_tools
+   {method} process_app_info
+   {method} get_log_folder
+   }
+   class IDFApp {
+   {method} process_app_info
+   }
+   class Example {
+   {method} get_binary_path
+   }
+   class EnvConfig {
+   {method} get_variable
+   }
+   class Env {
+   {field} config
+   {field} allocated_duts
+   {field} app_cls
+   {method} get_dut
+   {method} close_dut
+   {method} get_variable
+   {method} get_pc_nic_info
+   {method} close
+   }
+
+   SerialDUT --|> BaseDUT
+   IDFDUT --|> SerialDUT
+   IDFApp --|> BaseApp
+   Example --|> IDFApp
+   Env *-- EnvConfig
+   Env *-- BaseDUT
+   Env o-- BaseApp
+   BaseDUT o-- BaseApp
 
 
 .. toctree::
@@ -133,7 +192,8 @@ The following 3rd party lib is required:
 
 These libraries can be installed by running ``pip install -r requirements.txt`` in tiny-test-fw directory.
 
-To build document, we need to install ``Sphinx`` and ``sphinx-rtd-theme`` (you may replace this with your own theme).
+To build document, we need to install ``Sphinx``, ``plantweb`` and ``sphinx-rtd-theme`` (you may replace this with your own theme). ``plantweb`` requires internet access during building document.
+
 
 Indices and tables
 ==================