test/tools/launcher/ExecutionEnvironment.java

Print this page

        

@@ -138,11 +138,12 @@
         for (String x : LD_PATH_STRINGS) {
             String pairs[] = x.split("=");
             env.put(pairs[0], pairs[1]);
         }
 
-        tr = doExec(env, javaCmd, "-jar", testJarFile.getAbsolutePath());
+        tr = doExec(env, javaCmd, haveServerVM ? "-server" : "-client",
+                    "-jar", testJarFile.getAbsolutePath());
 
         if (!tr.isNotZeroOutput()) {
             flagError(tr, "Error: No output at all. Did the test execute ?");
         }
 

@@ -159,11 +160,13 @@
      */
     @Test
     void testNoExec() {
         Map<String, String> env = new HashMap<>();
         env.put(JLDEBUG_KEY, "true");
-        TestResult tr = doExec(env, javaCmd, "-version");
+        TestResult tr = doExec(env, javaCmd,
+                               haveServerVM ? "-server" : "-client",
+                               "-version");
         if (tr.testOutput.contains(EXPECTED_MARKER)) {
             flagError(tr, "testNoExec: found  warning <" + EXPECTED_MARKER +
                     "> the process execing ?");
         }
     }

@@ -188,13 +191,14 @@
             for (String x : LD_PATH_STRINGS) {
                 String pairs[] = x.split("=");
                 env.put(pairs[0], pairs[1]);
             }
 
-            tr = doExec(env, javaCmd, "-jar", testJarFile.getAbsolutePath());
+            tr = doExec(env, javaCmd, haveServerVM ? "-server" : "-client",
+                        "-jar", testJarFile.getAbsolutePath());
             verifyJavaLibraryPathGeneric(tr);
-        } else {
+        } else { // Solaris
             // no override
             env.clear();
             env.put(LD_LIBRARY_PATH, LD_LIBRARY_PATH_VALUE);
             tr = doExec(env, javaCmd, "-jar", testJarFile.getAbsolutePath());
             verifyJavaLibraryPathGeneric(tr);

@@ -242,21 +246,23 @@
     @Test
     void testVmSelection() {
 
         TestResult tr = null;
 
-        if (is32Bit) {
+        if (haveClientVM) {
             tr = doExec(javaCmd, "-client", "-version");
             if (!tr.matches(".*Client VM.*")) {
                 flagError(tr, "the expected vm -client did not launch");
             }
         }
+        if (haveServerVM) {
         tr = doExec(javaCmd, "-server", "-version");
         if (!tr.matches(".*Server VM.*")) {
             flagError(tr, "the expected vm -server did not launch");
         }
     }
+    }
 
     /*
      * checks to see there is no extra libjvm.so than needed
      */
     @Test