aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2013-02-19 16:50:27 +0100
committerSiri Hansen <[email protected]>2013-03-04 11:01:14 +0100
commit35030ae2cd6a6a6af4986f9f1ae8a98d76f43863 (patch)
treedb15ad347d6b20916040509814ec359efd8df1f2 /lib
parent9138513e1e80e2956b34138d711b63b93e6a9eb0 (diff)
downloadotp-35030ae2cd6a6a6af4986f9f1ae8a98d76f43863.tar.gz
otp-35030ae2cd6a6a6af4986f9f1ae8a98d76f43863.tar.bz2
otp-35030ae2cd6a6a6af4986f9f1ae8a98d76f43863.zip
[jinterface] Make tests handle space in path on windows
Add quotes around classpath on windows.
Diffstat (limited to 'lib')
-rw-r--r--lib/jinterface/test/jitu.erl26
1 files changed, 14 insertions, 12 deletions
diff --git a/lib/jinterface/test/jitu.erl b/lib/jinterface/test/jitu.erl
index 571a2dc9c7..0de074a9c9 100644
--- a/lib/jinterface/test/jitu.erl
+++ b/lib/jinterface/test/jitu.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2013. 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
@@ -84,24 +84,26 @@ to_string([]) -> [].
% filename:join(Dir, File)).
classpath(Dir) ->
- PS =
+ {PS,Quote,EscSpace} =
case os:type() of
- {win32, _} -> ";";
- _ -> ":"
+ {win32, _} -> {";","\"",""};
+ _ -> {":","","\\"}
end,
es(Dir++PS++
filename:join([code:lib_dir(jinterface),"priv","OtpErlang.jar"])++PS++
case os:getenv("CLASSPATH") of
false -> "";
Classpath -> Classpath
- end).
-
-es(L) ->
- lists:flatmap(fun($ ) ->
- "\\ ";
- (C) ->
- [C]
- end,lists:flatten(L)).
+ end,
+ Quote,
+ EscSpace).
+
+es(L,Quote,EscSpace) ->
+ Quote++lists:flatmap(fun($ ) ->
+ EscSpace++" ";
+ (C) ->
+ [C]
+ end,lists:flatten(L)) ++ Quote.
cmd(Cmd) ->
PortOpts = [{line,80},eof,exit_status,stderr_to_stdout],