837 // Profiles used to run tests using Jib for internal dependencies. |
837 // Profiles used to run tests using Jib for internal dependencies. |
838 var testedProfile = input.testedProfile; |
838 var testedProfile = input.testedProfile; |
839 if (testedProfile == null) { |
839 if (testedProfile == null) { |
840 testedProfile = input.build_os + "-" + input.build_cpu; |
840 testedProfile = input.build_os + "-" + input.build_cpu; |
841 } |
841 } |
842 var testedProfileJDK = testedProfile + ".jdk"; |
842 var testedProfileJdk = testedProfile + ".jdk"; |
843 var testedProfileTest = "" |
843 // Make it possible to use the test image from a different profile |
844 if (testedProfile.endsWith("-jcov")) { |
844 var testImageProfile; |
845 testedProfileTest = testedProfile.substring(0, testedProfile.length - "-jcov".length) + ".test"; |
845 if (input.testImageProfile != null) { |
|
846 testImageProfile = input.testImageProfile; |
|
847 } else if (testedProfile.endsWith("-jcov")) { |
|
848 testImageProfile = testedProfile.substring(0, testedProfile.length - "-jcov".length); |
846 } else { |
849 } else { |
847 testedProfileTest = testedProfile + ".test"; |
850 testImageProfile = testedProfile; |
848 } |
851 } |
|
852 var testedProfileTest = testImageProfile + ".test" |
849 var testOnlyMake = [ "run-test-prebuilt", "LOG_CMDLINES=true", "JTREG_VERBOSE=fail,error,time" ]; |
853 var testOnlyMake = [ "run-test-prebuilt", "LOG_CMDLINES=true", "JTREG_VERBOSE=fail,error,time" ]; |
850 if (testedProfile.endsWith("-gcov")) { |
854 if (testedProfile.endsWith("-gcov")) { |
851 testOnlyMake = concat(testOnlyMake, "GCOV_ENABLED=true") |
855 testOnlyMake = concat(testOnlyMake, "GCOV_ENABLED=true") |
852 } |
856 } |
853 var testOnlyProfilesPrebuilt = { |
857 var testOnlyProfilesPrebuilt = { |
854 "run-test-prebuilt": { |
858 "run-test-prebuilt": { |
855 target_os: input.build_os, |
859 target_os: input.build_os, |
856 target_cpu: input.build_cpu, |
860 target_cpu: input.build_cpu, |
857 dependencies: [ |
861 dependencies: [ |
858 "jtreg", "gnumake", "boot_jdk", "devkit", "jib", "jcov", testedProfileJDK, |
862 "jtreg", "gnumake", "boot_jdk", "devkit", "jib", "jcov", testedProfileJdk, |
859 testedProfileTest |
863 testedProfileTest |
860 ], |
864 ], |
861 src: "src.conf", |
865 src: "src.conf", |
862 make_args: testOnlyMake, |
866 make_args: testOnlyMake, |
863 environment: { |
867 environment: { |
864 "BOOT_JDK": common.boot_jdk_home, |
868 "BOOT_JDK": common.boot_jdk_home, |
865 "JDK_IMAGE_DIR": input.get(testedProfileJDK, "home_path"), |
869 "JDK_IMAGE_DIR": input.get(testedProfileJdk, "home_path"), |
866 "TEST_IMAGE_DIR": input.get(testedProfileTest, "home_path") |
870 "TEST_IMAGE_DIR": input.get(testedProfileTest, "home_path") |
867 }, |
871 }, |
868 labels: "test" |
872 labels: "test" |
869 } |
873 } |
870 }; |
874 }; |
871 |
875 |
872 // If actually running the run-test-prebuilt profile, verify that the input |
876 // If actually running the run-test-prebuilt profile, verify that the input |
873 // variable is valid and if so, add the appropriate target_* values from |
877 // variable is valid and if so, add the appropriate target_* values from |
874 // the tested profile. |
878 // the tested profile. Use testImageProfile value as backup. |
875 if (input.profile == "run-test-prebuilt") { |
879 if (input.profile == "run-test-prebuilt") { |
876 if (profiles[testedProfile] == null) { |
880 if (profiles[testedProfile] == null && profiles[testImageProfile] == null) { |
877 error("testedProfile is not defined: " + testedProfile); |
881 error("testedProfile is not defined: " + testedProfile + " " + testImageProfile); |
878 } |
882 } |
879 } |
883 } |
880 if (profiles[testedProfile] != null) { |
884 if (profiles[testedProfile] != null) { |
881 testOnlyProfilesPrebuilt["run-test-prebuilt"]["target_os"] |
885 testOnlyProfilesPrebuilt["run-test-prebuilt"]["target_os"] |
882 = profiles[testedProfile]["target_os"]; |
886 = profiles[testedProfile]["target_os"]; |
883 testOnlyProfilesPrebuilt["run-test-prebuilt"]["target_cpu"] |
887 testOnlyProfilesPrebuilt["run-test-prebuilt"]["target_cpu"] |
884 = profiles[testedProfile]["target_cpu"]; |
888 = profiles[testedProfile]["target_cpu"]; |
|
889 } else if (profiles[testImageProfile] != null) { |
|
890 testOnlyProfilesPrebuilt["run-test-prebuilt"]["target_os"] |
|
891 = profiles[testImageProfile]["target_os"]; |
|
892 testOnlyProfilesPrebuilt["run-test-prebuilt"]["target_cpu"] |
|
893 = profiles[testImageProfile]["target_cpu"]; |
885 } |
894 } |
886 profiles = concatObjects(profiles, testOnlyProfilesPrebuilt); |
895 profiles = concatObjects(profiles, testOnlyProfilesPrebuilt); |
887 |
896 |
888 // On macosx add the devkit bin dir to the path in all the run-test profiles. |
897 // On macosx add the devkit bin dir to the path in all the run-test profiles. |
889 // This gives us a guaranteed working version of lldb for the jtreg failure handler. |
898 // This gives us a guaranteed working version of lldb for the jtreg failure handler. |