From 35030ae2cd6a6a6af4986f9f1ae8a98d76f43863 Mon Sep 17 00:00:00 2001 From: Siri Hansen Date: Tue, 19 Feb 2013 16:50:27 +0100 Subject: [jinterface] Make tests handle space in path on windows Add quotes around classpath on windows. --- lib/jinterface/test/jitu.erl | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'lib/jinterface/test') 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], -- cgit v1.2.3