Add RESULTS_FORMAT, remove CSV as default, run JMH on the test JDK directly JEP-230-microbenchmarks-branch
authorredestad
Thu, 04 Oct 2018 17:09:33 +0200
branchJEP-230-microbenchmarks-branch
changeset 56926 d86dd5847e6d
parent 56925 6dd05d35378e
child 56927 40f438322384
Add RESULTS_FORMAT, remove CSV as default, run JMH on the test JDK directly
make/RunTests.gmk
--- a/make/RunTests.gmk	Thu Oct 04 16:01:19 2018 +0200
+++ b/make/RunTests.gmk	Thu Oct 04 17:09:33 2018 +0200
@@ -147,7 +147,7 @@
 
 $(eval $(call ParseKeywordVariable, MICRO, \
     KEYWORDS := ITER FORK TIME WARMUP_ITER WARMUP_TIME, \
-    STRING_KEYWORDS := OPTIONS JAVA_OPTIONS VM_OPTIONS TEST_JDK BENCHMARKS_JAR, \
+    STRING_KEYWORDS := OPTIONS JAVA_OPTIONS VM_OPTIONS RESULTS_FORMAT TEST_JDK BENCHMARKS_JAR, \
 ))
 
 ifneq ($(MICRO), )
@@ -487,11 +487,10 @@
   # Current tests needs to open java.io
   $1_MICRO_JAVA_OPTIONS += --add-opens=java.base/java.io=ALL-UNNAMED
 
-  # Save output as CSV file
-  $1_MICRO_BASIC_OPTIONS += -rf csv -rff $$($1_TEST_RESULTS_DIR)/jmh-result.csv
-
-  # Always specify test JVM
-  $1_MICRO_BASIC_OPTIONS += -jvm $$($1_MICRO_TEST_JDK)/bin/java
+  # Save output as JSON or CSV file
+  ifneq ($$(MICRO_RESULTS_FORMAT), )
+    $1_MICRO_BASIC_OPTIONS += -rf $$(MICRO_RESULTS_FORMAT) -rff $$($1_TEST_RESULTS_DIR)/jmh-result.$(MICRO_RESULTS_FORMAT)
+  endif
 
   ifneq ($$(MICRO_VM_OPTIONS), )
     $1_MICRO_VM_OPTIONS := -jvmArgs $$(MICRO_VM_OPTIONS)
@@ -518,7 +517,7 @@
 	$$(call LogWarn, Running test '$$($1_TEST)')
 	$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR))
 	$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/micro, \
-	    $$(JAVA) $$($1_MICRO_JAVA_OPTIONS) -jar $$($1_MICRO_BENCHMARKS_JAR) \
+	    $$($1_MICRO_TEST_JDK)/bin/java $$($1_MICRO_JAVA_OPTIONS) -jar $$($1_MICRO_BENCHMARKS_JAR) \
 	        $$($1_MICRO_ITER) $$($1_MICRO_FORK) $$($1_MICRO_TIME) \
 	        $$($1_MICRO_WARMUP_ITER) $$($1_MICRO_WARMUP_TIME) \
 	        $$($1_MICRO_VM_OPTIONS) $$($1_MICRO_BASIC_OPTIONS) $$(MICRO_OPTIONS)  \