aboutsummaryrefslogtreecommitdiffstats
path: root/lib/odbc/test/odbc_test_lib.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/odbc/test/odbc_test_lib.erl')
-rw-r--r--lib/odbc/test/odbc_test_lib.erl83
1 files changed, 61 insertions, 22 deletions
diff --git a/lib/odbc/test/odbc_test_lib.erl b/lib/odbc/test/odbc_test_lib.erl
index 012eb96e43..a8439d5fb6 100644
--- a/lib/odbc/test/odbc_test_lib.erl
+++ b/lib/odbc/test/odbc_test_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2002-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2002-2011. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -36,29 +36,25 @@ match_float(Float, Match, Delta) ->
(Float < Match + Delta) and (Float > Match - Delta).
odbc_check() ->
- case erlang:system_info(wordsize) of
- 4 ->
- case test_server:os_type() of
- {unix, sunos} ->
- ok;
- {unix, linux} ->
- ok;
- {win32, _} ->
+ case os:type() of
+ {unix,darwin} ->
+ lists:flatten(
+ io_lib:format("Currently we have no working drivers for MAC",
+ []));
+ _ ->
+ case erlang:system_info({wordsize, external}) of
+ 4 ->
ok;
Other ->
- lists:flatten(
- io_lib:format("Platform not supported: ~w",
- [Other]))
- end;
- Other ->
- case os:type() of
- {unix, linux} ->
- ok;
- Platform ->
- lists:flatten(
- io_lib:format("Word on platform ~w size"
- " ~w not supported", [Other,
- Platform]))
+ case os:type() of
+ {unix, linux} ->
+ ok;
+ Platform ->
+ lists:flatten(
+ io_lib:format("Word on platform ~w size"
+ " ~w not supported", [Other,
+ Platform]))
+ end
end
end.
@@ -75,3 +71,46 @@ check_row_count(Expected, Count) ->
to_upper(List) ->
lists:map(fun(Str) -> string:to_upper(Str) end, List).
+
+strict(Ref, mysql) ->
+ odbc:sql_query(Ref, "SET sql_mode='STRICT_ALL_TABLES,STRICT_TRANS_TABLES';");
+strict(_,_) ->
+ ok.
+
+platform_options() ->
+ [].
+
+skip() ->
+ case os:type() of
+ {unix, linux} ->
+ Issue = linux_issue(),
+ is_sles9(Issue);
+ {unix, sunos} ->
+ not supported_solaris();
+ _ ->
+ false
+ end.
+
+supported_solaris() ->
+ case os:version() of
+ {_,10,_} ->
+ true;
+ _ ->
+ false
+ end.
+
+linux_issue() ->
+ {ok, Binary} = file:read_file("/etc/issue"),
+ string:tokens(binary_to_list(Binary), " ").
+
+is_sles11(IssueTokens) ->
+ lists:member("11", IssueTokens).
+
+is_sles10(IssueTokens) ->
+ lists:member("10", IssueTokens).
+
+is_sles9(IssueTokens) ->
+ lists:member("9", IssueTokens).
+
+is_ubuntu(IssueTokens) ->
+ lists:member("Ubuntu", IssueTokens).