diff options
Diffstat (limited to 'lib/stdlib/test/shell_docs_SUITE.erl')
-rw-r--r-- | lib/stdlib/test/shell_docs_SUITE.erl | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/lib/stdlib/test/shell_docs_SUITE.erl b/lib/stdlib/test/shell_docs_SUITE.erl index ba0f256df9..028e2c0aba 100644 --- a/lib/stdlib/test/shell_docs_SUITE.erl +++ b/lib/stdlib/test/shell_docs_SUITE.erl @@ -70,7 +70,7 @@ end_per_group(_GroupName, Config) -> %% tested. %% %% Currently the modules are: --define(RENDER_MODULES, [sofs, re, file, erlang]). +-define(RENDER_MODULES, [sofs, re, file, erlang, user_drv, ?MODULE]). %% If you need to update the definition because this %% testcase fails, just run update_render/0,1. render(Config) -> @@ -88,7 +88,12 @@ render(Config) -> {ok, Original} -> ct:log("Original: ~n~ts",[Original]), ct:log("Current : ~n~ts",[Current]), - ct:fail(output_changed) + ct:fail(output_changed); + {error, enoent} -> + %% All modules are not available on all + %% platforms. For instance socket is not + %% available on windows. + ok end end, render_module(Module, D)) end, ?RENDER_MODULES). @@ -108,7 +113,9 @@ update_render(DataDir) -> maps:map( fun(FName, Output) -> ok = file:write_file(filename:join(DataDir, FName), Output) - end, render_module(Module, D)) + end, render_module(Module, D)); + E -> + io:format("Error processing: ~p ~p",[Module, E]) end end, ?RENDER_MODULES). @@ -275,8 +282,8 @@ render_all(Dir) -> docsmap(fun(Mod, D) -> maps:map( fun(FName, Value) -> - file:write_file(filename:join(Dir, FName), Value) end, - render_module(Mod, D)) + file:write_file(filename:join(Dir, FName), Value) + end, render_module(Mod, D)) end). render_module(Mod, #docs_v1{ docs = Docs } = D) -> @@ -315,7 +322,11 @@ render_module(Mod, #docs_v1{ docs = Docs } = D) -> end, Files, Docs). sanitize(FName) -> - re:replace(FName,"[/:]","_",[global,{return,list}]). + lists:foldl( + fun({Re,Replace}, Txt) -> + re:replace(Txt,Re,Replace,[global,{return,list}]) + end, FName, [{"/","slash"},{":","colon"}, + {"\\*","star"},{"<","lt"},{">","gt"},{"=","eq"}]). docsmap(Fun) -> lists:map( |