Questions tagged [common-test]

Common-Test is a powerful test framework that comes with Erlang/OTP

Common test is a very powerful testing framework that can be used for systems and unit testing and even for distributed tests. Its a bit hard to learn just from the documentation but in the chapter in "Learn You Some Erlang": Common Test for Uncommon Tests there is an easy to understand introduction.

For reference find below the official manuals, but by all means read the introduction in the link above first:

47 questions
1
vote
0 answers

How to add the return value to the cth_surefire XML report?

I am using erlangOTP and the common test framework. The XML test reort is produced by using the common test hook cth_surefire. Every test case ends by returning a customized stringsomehow like this: Comment = io_lib:format( "Success with blah blah.…
eDeviser
  • 1,605
  • 2
  • 17
  • 44
1
vote
0 answers

Structuring configuration for apps in Common Test suites

I have hit an issue with Common Test and the way I specify the configuration for the apps I test. I have several collections of test suites where each collection of test suites has a ct_hook module to set up some things. The way I configure apps I’m…
beta
  • 2,380
  • 21
  • 38
1
vote
1 answer

Testing a gen_server module using Common Test

I have this (very simple) gen_server implementation: -module(rand_gen). -behaviour(gen_server). -define(BASE, 1000). %% Module Functionality -export([start/0]). -export([stop/1]). -export([uniform/1, uniform/2]). %% Callback…
x80486
  • 6,627
  • 5
  • 52
  • 111
1
vote
1 answer

Erlang - Skip test suite immediately in common test

I know the way to skip test suite is: Let init_per_suite function return {skip, reason} value. But It will execute all commands in the init_per_suite function before skip. I want to skip test suite immediately when a condition is met.
1
vote
1 answer

finding lib directory during common test

My question is, how should my Erlang app reliably find a binary in the priv directory, not just in production; when installed properly, but during common test? I realised today when I added a travis-ci configuration to an old Erlang app and pushed…
Michael
  • 3,639
  • 14
  • 29
1
vote
0 answers

Run Common Test suite within another Common Test test case

Is it possible to run another Common Test test suite within a Common Test test case? I am writing a Common Test Hook module and need a way to test it. I figured the best way to the hook would be to define two test suite modules. One that's intended…
Stratus3D
  • 4,648
  • 4
  • 35
  • 67
1
vote
1 answer

Erlang common test global registered names

I'm using the common test framework to do some RPC testing for a cowboy based service. The service relies on an application that I am hosting on another node. In the application code I connect to that node. In common test: ct:print(default, 50,…
Matt
  • 207
  • 1
  • 7
1
vote
2 answers

What is the best way to generate test cases for erlang applications?

Now I'm engaged in creating test cases for application writing on Erlang. I use common-test for it. This tool is useful and suits me. But most of the tests have the same structure and sometimes contain the same code. So, I have a lot of…
pulitta
  • 43
  • 1
  • 5
1
vote
4 answers

Why do no third party assertion libraries exist for Common Test?

When writing tests I find myself writing all kinds of small little helper functions to make assertions. I searched for an assertion library and didn't find anything. In my tests I often have things like this: value_in_list(_Value, []) -> …
Stratus3D
  • 4,648
  • 4
  • 35
  • 67
1
vote
1 answer

Include common tests in Erlang release

I have a project written in Erlang (and releases generated by rebar) and I want to do integration testing in an environment which is as close as possible to the deployment environment. The project pulls in a few other Erlang applications as…
mikejohnharry
  • 103
  • 1
  • 6
1
vote
2 answers

How do I use "rebar ct" with a two application node?

I'm using rebar to compile my application. Actually, it's two applications: deps/ apps/A/ apps/B/ apps/B/suites ...where B depends on A. This is correctly configured in apps/B/src/B.app.src. However, when I attempt to run rebar ct, it fails to test…
Roger Lipscombe
  • 89,048
  • 55
  • 235
  • 380
1
vote
1 answer

How to avoid init_per_suite and end_per_suite to be counted as test cases in Common Test?

I have a test suite which has the init and end functions implemented in it. When I run the suite it produces some html outputs to show the results of the test cases (pass and fail etc.) from the suite. But in the log the init_per_suite and…
Vombat
  • 1,156
  • 1
  • 15
  • 27
0
votes
1 answer

Adding parameters to the init_per_testcase config parameter

I have a erlang integration test using the common test frame work. The config parameter passed to the init_per_testcase call and all the tests is initialized as: ConfigFilename = filename:absname("something.config",…
Usman Ismail
  • 17,999
  • 14
  • 83
  • 165
0
votes
1 answer

Fail test run if Common Test suite cannot be compiled

If I have a syntax error in one of my Common Test suites, ct_run simply waits for 15 seconds and then continues. It displays this message: {error,make_failed} Failed to compile or locate one or more test suites Press 'c' to continue or 'a' to…
Roger Lipscombe
  • 89,048
  • 55
  • 235
  • 380
0
votes
1 answer

Is there a nightly build for Erlang/OTP?

I am able to build Erlang from source, and also ran the tests shipped with the source followed the instructions documented at https://github.com/erlang/otp/wiki/Running-tests. I am seeing about 900 failures out of a total of 11000 test cases,…
Maxim Mai
  • 145
  • 5
  • 14