aboutsummaryrefslogtreecommitdiffstats
path: root/lib/parsetools/test/leex_SUITE.erl
diff options
context:
space:
mode:
authorTuncer Ayaz <[email protected]>2011-06-12 18:39:45 +0200
committerTuncer Ayaz <[email protected]>2011-09-06 17:24:09 +0200
commitab37957a93b3645468a697a8b47b1aa48d754ede (patch)
tree181c271132b8b082214b13246a781c2f9e274e09 /lib/parsetools/test/leex_SUITE.erl
parent22dae863060e0d66fa268f6d1cd4d6f084b850ab (diff)
downloadotp-ab37957a93b3645468a697a8b47b1aa48d754ede.tar.gz
otp-ab37957a93b3645468a697a8b47b1aa48d754ede.tar.bz2
otp-ab37957a93b3645468a697a8b47b1aa48d754ede.zip
parsetools: test if warnings_as_errors writes file
warnings_as_errors changes warnings to be treated as errors. Extend leex_SUITE and yecc_SUITE to check that output file is not generated if warnings_as_errors is enabled and warnings are emitted.
Diffstat (limited to 'lib/parsetools/test/leex_SUITE.erl')
-rw-r--r--lib/parsetools/test/leex_SUITE.erl11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/parsetools/test/leex_SUITE.erl b/lib/parsetools/test/leex_SUITE.erl
index 48312445ef..1e50aedf07 100644
--- a/lib/parsetools/test/leex_SUITE.erl
+++ b/lib/parsetools/test/leex_SUITE.erl
@@ -152,6 +152,7 @@ file(Config) when is_list(Config) ->
?line writable(Dotfile),
file:delete(Dotfile),
+ ok = file:delete(Scannerfile),
Warn = <<"Definitions.1998\n"
"D = [0-9]\n"
"Rules.\n"
@@ -159,11 +160,15 @@ file(Config) when is_list(Config) ->
"Erlang code.\n">>,
ok = file:write_file(Filename, Warn),
error = leex:file(Filename, [warnings_as_errors]),
+ false = filelib:is_regular(Scannerfile),
error = leex:file(Filename, [return_warnings,warnings_as_errors]),
- {ok,Scannerfile,[{Filename,[{1,leex,ignored_characters}]}]} =
- leex:file(Filename, [return_warnings]),
+ false = filelib:is_regular(Scannerfile),
{error,_,[{Filename,[{1,leex,ignored_characters}]}]} =
- leex:file(Filename, [return_errors,warnings_as_errors]),
+ leex:file(Filename, [return_errors,warnings_as_errors]),
+ false = filelib:is_regular(Scannerfile),
+ {ok,Scannerfile,[{Filename,[{1,leex,ignored_characters}]}]} =
+ leex:file(Filename, [return_warnings]),
+ true = filelib:is_regular(Scannerfile),
file:delete(Filename),
ok.