Browse Source

Add tests for error reporting.

Andreas Stenius 11 years ago
parent
commit
52e9da3546
2 changed files with 13 additions and 3 deletions
  1. 2 1
      .travis.yml
  2. 11 2
      tests/src/erlydtl_unittests.erl

+ 2 - 1
.travis.yml

@@ -1,6 +1,7 @@
 language: erlang
 otp_release:
+  - R16B03
   - R16B02
   - R15B03
-  - R14B04
+#  - R14B04 (seems lists:concat/1 is broken on R14B04..)
 script: "make test"

+ 11 - 2
tests/src/erlydtl_unittests.erl

@@ -1232,11 +1232,20 @@ tests() ->
         <<"{{ r.baz }}">>, [{r, #testrec{ foo="Foo", bar="Bar", baz="Baz" }}], [],
         [{record_info, [{testrec, record_info(fields, testrec)}]}],
         <<"Baz">>}
+      ]},
+     {"error reporting",
+      [{"no out dir warning",
+        <<"foo bar">>, [], [], [], <<"foo bar">>, [error_info([no_out_dir])]},
+       {"warnings as errors",
+        <<"foo bar">>, [], [], [warnings_as_errors], {error, [error_info([no_out_dir])], []}}
       ]}
-     %% {"error reporting",
-     %%  [{"return warnings"}]}
     ].
 
+%% {Name, DTL, Vars, Output}
+%% {Name, DTL, Vars, RenderOpts, Output}
+%% {Name, DTL, Vars, RenderOpts, CompilerOpts, Output}
+%% {Name, DTL, Vars, RenderOpts, CompilerOpts, Output, Warnings}
+
 run_tests() ->
     io:format("Running unit tests..."),
     {Times, Failures} =