Thu, 16 Jul 2015 19:59:53 -0700
Merge
1.1 --- a/test/tools/javac/links/LinksTest.java Thu Jul 16 14:23:16 2015 -0700 1.2 +++ b/test/tools/javac/links/LinksTest.java Thu Jul 16 19:59:53 2015 -0700 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -30,6 +30,7 @@ 1.11 * @run main LinksTest 1.12 */ 1.13 1.14 +import java.io.IOException; 1.15 import java.nio.file.Files; 1.16 import java.nio.file.Paths; 1.17 1.18 @@ -48,19 +49,26 @@ 1.19 throws Exception { 1.20 // mkdir tmp 1.21 // cp ${TESTSRC}/b/B.java tmp 1.22 - ToolBox.writeFile(Paths.get("tmp", "B.java"), BSrc); 1.23 + ToolBox.writeFile(Paths.get("tmp/B.java"), BSrc); 1.24 1.25 + // Try to set up a symbolic link for the test. 1.26 +// ln -s `pwd`/tmp "${TESTCLASSES}/a" 1.27 try { 1.28 -// ln -s `pwd`/tmp "${TESTCLASSES}/a" 1.29 Files.createSymbolicLink(Paths.get("a"), Paths.get("tmp")); 1.30 - ////"${TESTJAVA}/bin/javac" ${TESTTOOLVMOPTS} -sourcepath "${TESTCLASSES}" -d "${TESTCLASSES}/classes" "${TESTSRC}/T.java" 2>&1 1.31 - ToolBox.JavaToolArgs javacArgs = 1.32 - new ToolBox.JavaToolArgs() 1.33 - .setOptions("-sourcepath", ".", "-d", ".").setSources(TSrc); 1.34 - ToolBox.javac(javacArgs); 1.35 - } catch (UnsupportedOperationException e) { 1.36 - System.err.println("Symbolic links not supported on this system. The test can't finish"); 1.37 + System.err.println("Created symbolic link"); 1.38 + } catch (UnsupportedOperationException | IOException e) { 1.39 + System.err.println("Problem creating symbolic link: " + e); 1.40 + System.err.println("Test cannot continue; test passed by default"); 1.41 + return; 1.42 } 1.43 + 1.44 + // If symbolic link was successfully created, 1.45 + // try a compilation that will use it. 1.46 + ////"${TESTJAVA}/bin/javac" ${TESTTOOLVMOPTS} -sourcepath "${TESTCLASSES}" -d "${TESTCLASSES}/classes" "${TESTSRC}/T.java" 2>&1 1.47 + ToolBox.JavaToolArgs javacArgs = 1.48 + new ToolBox.JavaToolArgs() 1.49 + .setOptions("-sourcepath", ".", "-d", ".").setSources(TSrc); 1.50 + ToolBox.javac(javacArgs); 1.51 } 1.52 1.53 }