`
mryufeng
  • 浏览: 981765 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

Running tests

阅读更多
R13B03以后 OTP的模块加入了大量的测试模块,这些模块都是common_test的使用例子. 我们可以学到的2点 1. 如何编写common_test 2. 如何养成好习惯,为我们自己的工程编写测试案例.

以下是如何允许测试案例:

原文地址: http://wiki.github.com/erlang/otp/running-tests

Running tests
Building

Build the tests like this

make release_tests

Running

To run the test first do:

cd release/tests/test_server

and then start Erlang:

$ERL_TOP/bin/erl

Install the ts framework

ts:install().

To run all test suites do

ts:run().

Note that running all tests will require several hours, so you may want to run the test cases for a single application

ts:run(Application, [batch]).

or even part of the test suite for an application, for example

ts:run(emulator, bs, [batch]).

to run all test suite modules starting with bs (i.e. all modules that test the bit syntax).

To run a specific test case in a module, the full name of the module and test case must be spelled out:

ts:run(emulator, bs_bincomp_SUITE, byte_aligned, [batch]).

Run ts:help() to show some help.

There will currently be 15 or so failed test cases in the kernel application.
Examining the results

Open the file release/test/test_server/index.html in a web browser. Or open release/test/test_server/last_test.html when a test suite is running to examine the results so far for the currently executing test suite.
分享到:
评论
10 楼 hittyo 2010-01-23  
意思是如何在出错的情况下不影响服务正常运行并搜集反馈信息
9 楼 hittyo 2010-01-23  
我想是自己解决问题的思路错了,目前用的是gen_server

应该把注意力放在如何容错的环节上,而不是想着怎么去避免

深受原先错误处理思想的禁锢。

不好意思,水了帖子。
8 楼 mryufeng 2010-01-22  
whrllm 写道
count(X1,X2) when is_integer(X1),
                  is_integer(X2),->
是否可以?

这个只是基础的约束 X1 X2是都是整数了 但是是不是还有其他条件呀  还是让他出错的时候告诉你把
7 楼 whrllm 2010-01-22  
count(X1,X2) when is_integer(X1),
                  is_integer(X2),->
是否可以?
6 楼 hittyo 2010-01-21  
明白老大的意思,但是不匹配会导致服务崩溃
5 楼 hittyo 2010-01-20  
谢谢 老大

但是输入源是面向用户的...

很头疼
4 楼 mryufeng 2010-01-20  
hittyo 写道
问个超简单的问题

count(X1,X2)->
   ...
   math:pow(X1,X2),
   ...



在用户任意提交X1,X2值的前提下,如何保证程序不出错(因类型问题).

to hittyo:
erlang不提倡防御性编程, 上面的例子那么写就最好了, 一旦出了问题 sasl日志记录的很清楚是因为math:pow(X1,X2)参数的问题. 那就从输入源解决问题 而不是在中间环节.
3 楼 hittyo 2010-01-20  
问个超简单的问题

count(X1,X2)->
   ...
   math:pow(X1,X2),
   ...



在用户任意提交X1,X2值的前提下,如何保证程序不出错(因类型问题).
2 楼 whrllm 2010-01-20  
好东西,要学习一下,
1 楼 litaocheng 2010-01-19  
呵呵,很好
紧跟github otp,紧跟erlang潮流啊哈

相关推荐

    QC英文教程PDF文档

    Lesson 5: Running Tests ......................................................................75 Defining Test Sets ................................................................................76 ...

    Learning Selenium Testing Tools with Python(PACKT,2014)

    Towards the end of this book, you'll get to grips with Selenium Grid, which is used for running tests in parallel using nodes for cross-browser testing. It will also give you a basic overview of the ...

    Gradle.for.Android.1783986824

    The book will also help you set up unit and integration testing with different libraries and will show how Gradle and Android Studio can make running tests easier. Finally, you will be shown a number...

    Gradle for Android(PACKT,2015)

    The book will also help you set up unit and integration testing with different libraries and will show how Gradle and Android Studio can make running tests easier. Finally, you will be shown a number...

    html2canvas

    Running tests The library has two sets of tests. The first set is a number of qunit tests that check that different values parsed by browsers are correctly converted in ...

    Gradle for Android

    The book will also help you set up unit and integration testing with different libraries and will show how Gradle and Android Studio can make running tests easier. Finally, you will be shown a number...

    leetcoderust-dsa:主要用rust和javascript编写的问题的解决方案

    tests against js solutions npm install npm test # running tests for specific file npm test < regex > # example running tests against _1.rs npm test _1 # watch mode npm run test:watch npm run test:...

    Android Platform Developer‘s Guide.doc

    Running Tests 110 Writing Tests 114 Debugging with GDB 116 In this document 116 Debugging 117 Just-In-Time Debug Feature 119 Debugging Native Code 120 In this document 120 Capturing logs 120 Debug ...

    Walkthrough Creating and Running Unit Tests

    在本文中,我们将深入探讨如何在Visual Studio 2010中创建和运行单元测试,这对于软件开发过程中的质量保证和代码维护至关重要。单元测试是一种软件开发实践,它允许开发者独立地验证应用程序的各个组件,确保它们...

    Microsoft WinCE6.0 Exam Preparation Kit for the Microsoft Certified Technology Specialist (MCTS)

    - Techniques for setting up and running tests using the CETK. - Best practices for interpreting test results and making improvements based on feedback. **14. Developing Tux Extension Components to ...

    Jenkins高级篇之Pipeline技巧篇-4-根据参数传入条件控制执行不同stage.rar

    echo 'Running tests...' // 执行测试任务 } else { echo 'Tests skipped.' } } } } } } ``` 四、条件控制执行不同stage 通过参数和条件语句,我们可以构建出动态的Pipeline,使得不同输入可以触发不同的...

    Advanced Programming for the Java 2 Platform.chm

    Debugging Applets, Applications, and Servlets <br>Collecting Evidence Running Tests and Analyzing Servlet Debugging AWT Event Debugging Analyzing Stack Traces Version Issues ...

    Django 1.1 Testing and Debugging.pdf

    Running the sample tests 12 Breaking things on purpose 15 Test errors versus test failures 20 Command line options for running tests 23 Verbosity 24 Settings 27 Pythonpath 27 Traceback 27 No...

    Python库 | jake-0.0.7.tar.gz

    print("Running tests...") # 这里执行运行测试的逻辑 # 标记为可从命令行调用的任务 @task def default(): build() test() ``` 在上述示例中,`build`和`test`函数是两个任务,而`default`函数被标记为默认...

    python code patterns

    #### Running tests (运行测试) - **命令行运行**:通过命令行工具运行测试。 - **IDE集成**:使用集成开发环境中的测试运行功能。 #### Automatically Executing Tests (自动执行测试) - **持续集成**:每次提交...

Global site tag (gtag.js) - Google Analytics