Skip to content

Commit befd479

Browse files
committed
测试套件 目录结构基本定义
1 parent 7ca01f4 commit befd479

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

org_agentzh/testing/test-suite-layout.adoc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,21 @@
22

33
// 翻译中。。。。(yuansheng)
44

5+
使用 `Test::Nginx` 驱动我们的测试套件,通常会用一个公共的目录结构以及规范的测试文件名样式,用来组织我们的测试集合。
6+
这些会让用户更容易明白,这些测试用例在项目源码中的目录关系,以及测试用例的使用情况。
7+
它不是必须的,然而,按照这种常见惯例组织,还是非常推荐的。
8+
59
Projects using `Test::Nginx` to drive their test suites usually have a
610
common directory layout and common test file name patterns to organize
711
their tests. This makes the user easy
812
to reason about the location of the test suite in a project source tree
913
and the usage of the tests. It is not really required, however, to use
1014
this common convention; it is just highly recommended.
1115

16+
按照惯例,这些项目在当前源码的根目录下,有个 `t/` 目录用来存放测试文件。
17+
每个测试文件包含一些具有相同属性或关联度的测试用例,保存在扩展名为 `.t` 的文件中,可以很容易的表明它们自身是 “测试文件”。
18+
下面的目录树结构,是真实项目 link:https://github.com/openresty/headers-more-nginx-module[headers-more-nginx-module] 的测试套件:
19+
1220
By convention, such projects have a `t/` directory at the root of their
1321
source tree where test files reside in. Each test file contains test cases
1422
that are closely related in some way and has the file extension `.t` to
@@ -33,6 +41,7 @@ project:
3341
   └── vars.t
3442
....
3543

44+
3645
When you have many test files, you can also group them further with sub-directories
3746
under `t/`. For example, in the link:https://github.com/openresty/lua-nginx-module[lua-nginx-module]
3847
project, we have sub-directores like `023-rewrite/` and `024-access/` under

0 commit comments

Comments
 (0)