Skip to content

Commit

Permalink
Tweak tests and Travis config
Browse files Browse the repository at this point in the history
... and bump to 0.12.4.

Make match_fun/0 return 'match-record' every time,
since we kept running out of atoms.

Also, change the Travis script to call eunit:test/2 manually
and pass +t 10 million to avoid the atom_tab max issue.
  • Loading branch information
yurrriq committed Jan 26, 2016
1 parent 55b99b9 commit 25c75ef
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ before_script:
- wget https://s3.amazonaws.com/rebar3/rebar3
- chmod 755 rebar3
script:
- ./rebar3 eunit -v
- erl +t 10000000 -pa _build/default/lib/*/ebin -noshell -eval 'eunit:test({application, lodox}, [verbose]).' -s init stop
notifications:
email:
- [email protected]
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Finally, add Lodox to your `plugins` list:
[% ...
{lodox, ".*",
{git, "git://github.com/quasiquoting/lodox.git",
{tag, "0.12.3"}}}]}.
{tag, "0.12.4"}}}]}.
```

The recommended place for the Lodox plugin entry is the global [rebar3](https://github.com/rebar/rebar3) config, `~/.config/rebar3/rebar.config`,
Expand Down Expand Up @@ -60,7 +60,7 @@ rebar3 do compile, lfe lodox

If all goes well, the output will look something like:

Generated lodox v0.12.3 docs in /path/to/lodox/doc
Generated lodox v0.12.4 docs in /path/to/lodox/doc

And, as promised, [generated documentation](http://quasiquoting.org/lodox/) will be in the `doc` subdirectory of
your project.
Expand Down
2 changes: 1 addition & 1 deletion doc
12 changes: 7 additions & 5 deletions org/Lodox.org
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ branch = gh-pages
:noweb: yes
:padline: no
:END:
*Describe =rebar.config= here.*
TODO: Describe =rebar.config= here.

#+BEGIN_SRC erlang :tangle ../rebar.config
<<generated("erlang")>>
Expand Down Expand Up @@ -1549,9 +1549,9 @@ parse_test_() ->
, {"A simple function with a docstring is correctly parsed.",
prop_defun_simple_doc(), 500}
, {"A function with pattern clauses produces an empty docstring.",
prop_defun_match(), 30}
prop_defun_match(), 100}
, {"A function with pattern clauses and a docstring is correctly parsed.",
prop_defun_match_doc(), 30}
prop_defun_match_doc(), 100}
],
[{timeout, ?TIMEOUT,
{Title, ?_assert(proper:quickcheck(Property, ?OPTIONS(NumTests)))}}
Expand Down Expand Up @@ -1644,7 +1644,9 @@ pattern_form() ->
match_fun()])
| non_empty(list())].

match_fun() -> ?LET(F, printable_string(), list_to_atom("match-" ++ F)).
%% Don't waste atoms, since we're already running out.
%% match_fun() -> ?LET(F, printable_string(), list_to_atom("match-" ++ F)).
match_fun() -> 'match-record'.

pattern_clause(Arity) ->
[arglist_patterns(Arity) |
Expand Down Expand Up @@ -1833,7 +1835,7 @@ before_script:
- wget https://s3.amazonaws.com/rebar3/rebar3
- chmod 755 rebar3
script:
- ./rebar3 eunit -v
- erl +t 10000000 -pa _build/default/lib/*/ebin -noshell -eval 'eunit:test({application, lodox}, [verbose]).' -s init stop
notifications:
email:
- [email protected]
Expand Down
22 changes: 13 additions & 9 deletions org/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ branch = gh-pages
```erlang
{application, 'lodox',
[{description, "The LFE rebar3 Lodox plugin"},
{vsn, "0.12.3"},
{vsn, "0.12.4"},
{modules, [lodox,
'lodox-html-writer', 'lodox-p', 'lodox-parse', 'lodox-util',
'unit-lodox-tests']},
Expand All @@ -124,7 +124,7 @@ branch = gh-pages

# Rebar3 Configuration<a id="orgheadline6"></a>

**Describe `rebar.config` here.**
TODO: Describe `rebar.config` here.

```erlang
{erl_opts, [debug_info, {src_dirs, ["test"]}]}.
Expand Down Expand Up @@ -341,8 +341,10 @@ If `name` is a binary, convert it to an atom first."
([name rebar-opts] (when (is_binary name))
(get-lodox-opts (binary_to_atom name 'latin1) rebar-opts))
([app rebar-opts] (when (is_atom app))
(let* ((lodox-config (dict:fetch 'lodox rebar-opts))
(lodox-apps (proplists:get_value 'apps lodox-config)))
(let* ((lodox-config (if (dict:is_key 'lodox rebar-opts)
(dict:fetch 'lodox rebar-opts)
[]))
(lodox-apps (proplists:get_value 'apps lodox-config [])))
(maps:from_list (proplists:get_value app lodox-apps [])))))
```

Expand Down Expand Up @@ -832,7 +834,7 @@ Use [pandoc] if available, otherwise [erlmarkdown].
```commonlisp
'#m(name #\"lodox\"
version \"0.12.3\"
version \"0.12.4\"
description \"The LFE rebar3 Lodox plugin\"
documents ()
modules {{list of maps of module metadata}}
Expand Down Expand Up @@ -1423,9 +1425,9 @@ parse_test_() ->
, {"A simple function with a docstring is correctly parsed.",
prop_defun_simple_doc(), 500}
, {"A function with pattern clauses produces an empty docstring.",
prop_defun_match(), 30}
prop_defun_match(), 100}
, {"A function with pattern clauses and a docstring is correctly parsed.",
prop_defun_match_doc(), 30}
prop_defun_match_doc(), 100}
],
[{timeout, ?TIMEOUT,
{Title, ?_assert(proper:quickcheck(Property, ?OPTIONS(NumTests)))}}
Expand Down Expand Up @@ -1518,7 +1520,9 @@ pattern_form() ->
match_fun()])
| non_empty(list())].

match_fun() -> ?LET(F, printable_string(), list_to_atom("match-" ++ F)).
%% Don't waste atoms, since we're already running out.
%% match_fun() -> ?LET(F, printable_string(), list_to_atom("match-" ++ F)).
match_fun() -> 'match-record'.

pattern_clause(Arity) ->
[arglist_patterns(Arity) |
Expand Down Expand Up @@ -1677,7 +1681,7 @@ before_script:
- wget https://s3.amazonaws.com/rebar3/rebar3
- chmod 755 rebar3
script:
- ./rebar3 eunit -v
- erl +t 10000000 -pa _build/default/lib/*/ebin -noshell -eval 'eunit:test({application, lodox}, [verbose]).' -s init stop
notifications:
email:
- [email protected]
Expand Down
2 changes: 1 addition & 1 deletion org/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.12.3
0.12.4
2 changes: 1 addition & 1 deletion src/lodox-parse.lfe
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
```commonlisp
'#m(name #\"lodox\"
version \"0.12.3\"
version \"0.12.4\"
description \"The LFE rebar3 Lodox plugin\"
documents ()
modules {{list of maps of module metadata}}
Expand Down
2 changes: 1 addition & 1 deletion src/lodox.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

{application, 'lodox',
[{description, "The LFE rebar3 Lodox plugin"},
{vsn, "0.12.3"},
{vsn, "0.12.4"},
{modules, [lodox,
'lodox-html-writer', 'lodox-p', 'lodox-parse', 'lodox-util',
'unit-lodox-tests']},
Expand Down
8 changes: 5 additions & 3 deletions test/lodox_parse_tests.erl
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ parse_test_() ->
, {"A simple function with a docstring is correctly parsed.",
prop_defun_simple_doc(), 500}
, {"A function with pattern clauses produces an empty docstring.",
prop_defun_match(), 30}
prop_defun_match(), 100}
, {"A function with pattern clauses and a docstring is correctly parsed.",
prop_defun_match_doc(), 30}
prop_defun_match_doc(), 100}
],
[{timeout, ?TIMEOUT,
{Title, ?_assert(proper:quickcheck(Property, ?OPTIONS(NumTests)))}}
Expand Down Expand Up @@ -122,7 +122,9 @@ pattern_form() ->
match_fun()])
| non_empty(list())].

match_fun() -> ?LET(F, printable_string(), list_to_atom("match-" ++ F)).
%% Don't waste atoms, since we're already running out.
%% match_fun() -> ?LET(F, printable_string(), list_to_atom("match-" ++ F)).
match_fun() -> 'match-record'.

pattern_clause(Arity) ->
[arglist_patterns(Arity) |
Expand Down

0 comments on commit 25c75ef

Please sign in to comment.