Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ct tests will now run using proper or eqc
Ct does not use the modules compiled by rebar (during the eunit tests). Ct will try to compile the *_SUITE test modules. It does this by trying to find an "Emakefile" in the same directory as the suite. If there isn't one, it just compiles everything using default options. This meant that the tests rebar does to set to the 'EQC' and 'PROPER' macros is never run or found. So, the quickcheck tests that ct defines where never run. The change adds a script to generate the Emakefile before the ct tests are run. It uses similar logic as rebar to accomplish the task. Note how tests are failing (as of this commit); at least now they are running.
- Loading branch information
Showing
4 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ deps | |
src/protobuffs_parser.erl | ||
src/protobuffs_scanner.erl | ||
erl_crash.dump | ||
test/Emakefile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#! /usr/bin/env escript | ||
|
||
main(_Args) -> | ||
CompileOpts = [debug_info], | ||
CheckFor = [{proper, 'PROPER', "proper.hrl"}, {eqc, 'EQC', "eqc.hrl"}], | ||
Opts = lists:foldl(fun({Mod, Define, Hrl}, Acc) -> | ||
case is_avail(Mod, Hrl) of | ||
false -> | ||
Acc; | ||
true -> | ||
[{d, Define} | Acc] | ||
end | ||
end, CompileOpts, CheckFor), | ||
MakeLine = {'*', Opts}, | ||
|
||
FileName = filename:join(["test", "Emakefile"]), | ||
case file:open(FileName, [write]) of | ||
{ok, File} -> | ||
io:format(File, "~p.~n", [MakeLine]); | ||
Error -> | ||
io:format("Could not open file ~s: ~p~n", [FileName, Error]) | ||
end. | ||
|
||
is_avail(AppMod, Hrl) -> | ||
case code:lib_dir(AppMod) of | ||
{error, bad_name} -> | ||
false; | ||
Dir -> | ||
filelib:is_regular(filename:join([Dir, "include", Hrl])) | ||
end. | ||
|
||
|