`
mryufeng
  • 浏览: 968943 次
  • 性别: 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潮流啊哈

相关推荐

    TD中文版使用手册(上册).doc

    1.4测试执行(Running Tests) 1.5缺陷跟踪(Tracking Defects) 1.6 Working with Project Database 1.7用户权限(User Privileges) 1.8导出Word文档(Exporting Documents from Microsoft Word) 1.9导出Excel...

    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...

    Learning Selenium Testing Tools with Python 最新 原版

    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 ...

    Walkthrough Creating and Running Unit Tests

    How to Create and Run Unit Tests in VS2010

    Mastering.Spring.Cloud

    Running tests with an in-memory database Handling HTTP clients and service discovery Implementing sample tests Integration tests Categorizing tests Capturing HTTP traffic Contract tests Using Pact ...

    Testing.with.Junit.1782166602

    Master high quality software development driven by unit tests About This Book Design and implement robust system components by means of the de ...Chapter 8: Running Tests Automatically within a CI Build

    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 ...

    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...

    OSGI in Action

    OSGi test tools 245 ■ Running tests on multiple frameworks 246 Unit testing 250 ■ Integration testing 251 ■ Management testing 254 7.4 Summary 257 8 Debugging applications 258 8.1 Debugging bundles...

    ipykernel:Jupyter 的 IPython 内核

    运行测试确保您有nosetests和nose-warnings-filters插件安装了pip install nose nose-warnings-filters 然后从根目录nosetests ipykernel运行测试覆盖按照Running tests的说明Running tests 。 确保您安装了coverage...

Global site tag (gtag.js) - Google Analytics