From qudongfang at gmail.com Wed Aug 1 07:35:59 2018 From: qudongfang at gmail.com (qudongfang) Date: Wed, 1 Aug 2018 15:35:59 +0800 Subject: RFR: update testing frameworks Message-ID: <3b3e523c-ea28-7041-207e-077935209990@gmail.com> Hi, there I found that the testing framework versions are out of date. I'd like to update them to the latest stable version. Could someone help me with this? webrev file link stored in google drive -- Best regards, QU DONGFANG -------------- next part -------------- # HG changeset patch # User qudongfang # Date 1533108000 -28800 # Wed Aug 01 15:20:00 2018 +0800 # Node ID 78d7cf12bb7fea8f7283d6ae2d49edaaccd07b5a # Parent 4363bb684f513c2516615b3b1b7309a33d9bea0e update testing frameworks, junit to 4.12 and testng to 6.14.3. diff --git a/make/Defs.gmk b/make/Defs.gmk --- a/make/Defs.gmk +++ b/make/Defs.gmk @@ -295,8 +295,8 @@ endif ASMTOOLS_LICENSE := $(call FullPath,$(ASMTOOLS_LICENSE)) -#----- JUnit 4.10: http://www.junit.org/ -# https://sourceforge.net/projects/junit/files/junit/4.10/junit-4.10.jar/download +#----- JUnit 4.12: http://www.junit.org/ +# http://repo1.maven.org/maven2/junit/junit/4.12/ # # JUnit is required, to support the execution of tests using JUnit # @@ -309,13 +309,13 @@ ifndef JUNIT_HOME ifdef SLASHJAVA - JUNIT_HOME = $(SLASHJAVA)/devtools/share/junit/junit-4.10/ + JUNIT_HOME = $(SLASHJAVA)/devtools/share/junit/junit-4.12/ endif endif ifndef JUNIT_JAR ifdef JUNIT_HOME - JUNIT_JAR = $(JUNIT_HOME)/junit-4.10.jar + JUNIT_JAR = $(JUNIT_HOME)/junit-4.12.jar endif endif JUNIT_JAR := $(call FullPath,$(JUNIT_JAR)) @@ -327,7 +327,7 @@ endif JUNIT_LICENSE := $(call FullPath,$(JUNIT_LICENSE)) -#----- TestNG 6.9.5: see http://www.testng.org/ +#----- TestNG 6.14.3: see http://www.testng.org/ # http://testng.org/doc/download.html # # TestNG is required, to support the execution of tests using TestNG @@ -341,14 +341,14 @@ ifndef TESTNG_HOME ifdef SLASHJAVA - TESTNG_HOME = $(SLASHJAVA)/devtools/share/testng/testng-6.9.5 + TESTNG_HOME = $(SLASHJAVA)/devtools/share/testng/testng-6.14.3 endif endif TESTNG_HOME := $(call FullPath,$(TESTNG_HOME)) ifndef TESTNG_JAR ifdef TESTNG_HOME - TESTNG_JAR = $(TESTNG_HOME)/testng-6.9.5.jar + TESTNG_JAR = $(TESTNG_HOME)/testng-6.14.3.jar endif endif TESTNG_JAR := $(call FullPath,$(TESTNG_JAR)) diff --git a/make/build-all.sh b/make/build-all.sh --- a/make/build-all.sh +++ b/make/build-all.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. @@ -65,7 +65,7 @@ UNZIP=unzip UNZIP_OPTS="${UNZIP_OPTS:--q} -u" WGET=wget -WGET_OPTS=${WGET_OPTS:--q} +WGET_OPTS=${WGET_OPTS:--q -c} ROOT=$(hg root) BUILD_DIR=${BUILD_DIR:-${ROOT}/build} @@ -220,9 +220,9 @@ JUNIT_DEPS_DIR=${JTREG_DEPS_DIR}/junit mkdir -p ${JUNIT_DEPS_DIR} -JUNIT_JAR=${JUNIT_DEPS_DIR}/junit-4.10.jar -WGet ${MAVEN_REPO_URL}/junit/junit/4.10/junit-4.10.jar ${JUNIT_JAR} -echo "e4f1766ce7404a08f45d859fb9c226fc9e41a861 ${JUNIT_JAR}" | ${SHASUM} --check - +JUNIT_JAR=${JUNIT_DEPS_DIR}/junit-4.12.jar +WGet ${MAVEN_REPO_URL}/junit/junit/4.12/junit-4.12.jar ${JUNIT_JAR} +echo "2973d150c0dc1fefe998f834810d68f278ea58ec ${JUNIT_JAR}" | ${SHASUM} --check - ${UNZIP} ${UNZIP_OPTS} ${JUNIT_JAR} LICENSE.txt -d ${JUNIT_DEPS_DIR} JUNIT_LICENSE=${JUNIT_DEPS_DIR}/LICENSE.txt @@ -231,12 +231,12 @@ TESTNG_DEPS_DIR=${JTREG_DEPS_DIR}/testng mkdir -p ${TESTNG_DEPS_DIR} -TESTNG_JAR=${TESTNG_DEPS_DIR}/testng-6.9.5.jar -WGet ${MAVEN_REPO_URL}/org/testng/testng/6.9.5/testng-6.9.5.jar ${TESTNG_JAR} -echo "5d12ea207fc47c3f341a3f8ecc88a3eac396a777 ${TESTNG_JAR}" | ${SHASUM} --check - +TESTNG_JAR=${TESTNG_DEPS_DIR}/testng-6.14.3.jar +WGet ${MAVEN_REPO_URL}/org/testng/testng/6.14.3/testng-6.14.3.jar ${TESTNG_JAR} +echo "d24515dc253e77e54b73df97e1fb2eb7faf34fdd ${TESTNG_JAR}" | ${SHASUM} --check - TESTNG_LICENSE=${TESTNG_DEPS_DIR}/LICENSE.txt -WGet https://raw.githubusercontent.com/cbeust/testng/testng-6.9.5/LICENSE.txt ${TESTNG_LICENSE} +WGet https://raw.githubusercontent.com/cbeust/testng/testng-6.14.3/LICENSE.txt ${TESTNG_LICENSE} JCOMMANDER_JAR=${TESTNG_DEPS_DIR}/jcommander-1.72.jar WGet ${MAVEN_REPO_URL}/com/beust/jcommander/1.72/jcommander-1.72.jar ${JCOMMANDER_JAR} diff --git a/make/build.properties b/make/build.properties --- a/make/build.properties +++ b/make/build.properties @@ -40,11 +40,11 @@ jhall.jar = ${javahelp.home}/javahelp/lib/jhall.jar jh.jar = ${javahelp.home}/javahelp/lib/jh.jar -# JUnit (should be 4.10 or better) -junit.jar = ${jtreg.build.resources}/junit/4.10/junit-4.10.jar +# JUnit (should be 4.12 or better) +junit.jar = ${jtreg.build.resources}/junit/4.12/junit-4.12.jar -# TestNG (should be 6.9.5 or better) -testng.jar = ${jtreg.build.resources}/testng/6.9.5/testng-6.9.5.jar +# TestNG (should be 6.14.3 or better) +testng.jar = ${jtreg.build.resources}/testng/6.14.3/testng-6.14.3.jar # JCommander (should be recent, e.g. 1.48 or better) # This is required by TestNG; if it is already included in testng.jar diff --git a/make/jtreg.gmk b/make/jtreg.gmk --- a/make/jtreg.gmk +++ b/make/jtreg.gmk @@ -285,11 +285,6 @@ $(RM) $@ $(MKDIR) -p $(@D) $(CP) $(TESTNG_JAR) $@ - jquery=`$(JAR) tf $@ | $(GREP) 'jquery.*.js'` ; \ - if [ -n "$$jquery" ]; then \ - $(RM) $(BUILDDIR)/$$jquery ; $(TOUCH) $(BUILDDIR)/$$jquery ; \ - $(JAR) uf $@ -C $(BUILDDIR) $$jquery ; \ - fi TARGETS.ZIP.jtreg += $(JTREG_IMAGEJARDIR)/testng.jar diff --git a/src/share/classes/com/sun/javatest/regtest/agent/TestNGRunner.java b/src/share/classes/com/sun/javatest/regtest/agent/TestNGRunner.java --- a/src/share/classes/com/sun/javatest/regtest/agent/TestNGRunner.java +++ b/src/share/classes/com/sun/javatest/regtest/agent/TestNGRunner.java @@ -89,7 +89,7 @@ testng.setDefaultSuiteName(testName); testng.setTestClasses(new Class[]{mainClass}); testng.addListener((ITestNGListener) listener); // recognizes both ITestListener and IConfigurationListener - testng.addListener(new XMLReporter()); + testng.addListener((ITestNGListener)(new XMLReporter())); testng.setOutputDirectory(new File(".").getPath()); // current dir, i.e. scratch dir testng.run(); if (listener.configFailureCount > 0 || listener.failureCount > 0) { From jonathan.gibbons at oracle.com Fri Aug 3 23:03:47 2018 From: jonathan.gibbons at oracle.com (jonathan.gibbons at oracle.com) Date: Fri, 03 Aug 2018 23:03:47 +0000 Subject: hg: code-tools/jtreg: 7902259: AgentVMThreadgroup.cleanup needs to adjust the cleanup timeout based on timeoutFactor Message-ID: <201808032303.w73N3ldT029087@aojmv0008.oracle.com> Changeset: fdfb9ee98733 Author: jjg Date: 2018-08-03 16:03 -0700 URL: http://hg.openjdk.java.net/code-tools/jtreg/rev/fdfb9ee98733 7902259: AgentVMThreadgroup.cleanup needs to adjust the cleanup timeout based on timeoutFactor ! src/share/classes/com/sun/javatest/regtest/agent/AgentServer.java ! src/share/classes/com/sun/javatest/regtest/agent/MainActionHelper.java From jonathan.gibbons at oracle.com Mon Aug 6 22:51:44 2018 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Mon, 6 Aug 2018 15:51:44 -0700 Subject: RFR: update testing frameworks In-Reply-To: <3b3e523c-ea28-7041-207e-077935209990@gmail.com> References: <3b3e523c-ea28-7041-207e-077935209990@gmail.com> Message-ID: Hi, While there may be newer versions of these frameworks available, we do not always go to the "latest and greatest". If there is not a compelling reason to update these files, stability is preferred.? There is an implicit cost to making changes like this, in that? we have to ensure there are no issues caused by the update. -- Jon On 8/1/18 12:35 AM, qudongfang wrote: > Hi, there > > I found that the testing framework versions are out of date. > I'd like to update them to the latest stable version. > Could someone help me with this? > > webrev file link stored in google drive > > From jonathan.gibbons at oracle.com Tue Aug 7 20:44:33 2018 From: jonathan.gibbons at oracle.com (jonathan.gibbons at oracle.com) Date: Tue, 07 Aug 2018 20:44:33 +0000 Subject: hg: code-tools/jtreg: IDE-assisted code cleanup Message-ID: <201808072044.w77KiX75005838@aojmv0008.oracle.com> Changeset: 398a52ff1de6 Author: jjg Date: 2018-08-07 13:44 -0700 URL: http://hg.openjdk.java.net/code-tools/jtreg/rev/398a52ff1de6 IDE-assisted code cleanup ! src/share/classes/com/sun/javatest/diff/SimpleReporter.java ! src/share/classes/com/sun/javatest/regtest/CheckFiles.java ! src/share/classes/com/sun/javatest/regtest/agent/AStatus.java ! src/share/classes/com/sun/javatest/regtest/agent/JUnitRunner.java ! src/share/classes/com/sun/javatest/regtest/agent/JavaTestSecurityManager.java ! src/share/classes/com/sun/javatest/regtest/agent/ModuleHelper.java ! src/share/classes/com/sun/javatest/regtest/agent/RegressionCompileCommand.java ! src/share/classes/com/sun/javatest/regtest/agent/RegressionSecurityManager.java ! src/share/classes/com/sun/javatest/regtest/agent/TestNGRunner.java ! src/share/classes/com/sun/javatest/regtest/config/GroupManager.java ! src/share/classes/com/sun/javatest/regtest/config/Locations.java ! src/share/classes/com/sun/javatest/regtest/config/RegressionTestFinder.java ! src/share/classes/com/sun/javatest/regtest/config/TestProperties.java ! src/share/classes/com/sun/javatest/regtest/exec/Action.java ! src/share/classes/com/sun/javatest/regtest/exec/CompileAction.java ! src/share/classes/com/sun/javatest/regtest/exec/RegressionScript.java ! src/share/classes/com/sun/javatest/regtest/exec/TimeoutHandlerProvider.java ! src/share/classes/com/sun/javatest/regtest/report/TestStats.java ! src/share/classes/com/sun/javatest/regtest/report/VerboseHandler.java ! src/share/classes/com/sun/javatest/regtest/tool/Tool.java ! src/share/classes/com/sun/javatest/regtest/util/NaturalComparator.java From jonathan.gibbons at oracle.com Wed Aug 8 22:27:19 2018 From: jonathan.gibbons at oracle.com (jonathan.gibbons at oracle.com) Date: Wed, 08 Aug 2018 22:27:19 +0000 Subject: hg: code-tools/jtreg: remove vestiges of samevm mode Message-ID: <201808082227.w78MRJTo003788@aojmv0008.oracle.com> Changeset: f4b2d766822d Author: jjg Date: 2018-08-08 15:27 -0700 URL: http://hg.openjdk.java.net/code-tools/jtreg/rev/f4b2d766822d remove vestiges of samevm mode ! src/share/classes/com/sun/javatest/regtest/config/ExecMode.java ! src/share/classes/com/sun/javatest/regtest/tool/Tool.java ! src/share/classes/com/sun/javatest/regtest/tool/i18n.properties From jonathan.gibbons at oracle.com Fri Aug 10 18:00:01 2018 From: jonathan.gibbons at oracle.com (jonathan.gibbons at oracle.com) Date: Fri, 10 Aug 2018 18:00:01 +0000 Subject: hg: code-tools/jtreg: Revive FAQ, now in Markdown format Message-ID: <201808101800.w7AI01Pc026097@aojmv0008.oracle.com> Changeset: 3291fca42176 Author: jjg Date: 2018-08-10 10:59 -0700 URL: http://hg.openjdk.java.net/code-tools/jtreg/rev/3291fca42176 Revive FAQ, now in Markdown format ! make/Defs.gmk ! make/jtreg.gmk + src/share/doc/javatest/regtest/faq-intro.html + src/share/doc/javatest/regtest/faq-local-style.html + src/share/doc/javatest/regtest/faq.md From jonathan.gibbons at oracle.com Fri Aug 10 18:58:58 2018 From: jonathan.gibbons at oracle.com (jonathan.gibbons at oracle.com) Date: Fri, 10 Aug 2018 18:58:58 +0000 Subject: hg: code-tools/jtreg: Fix broken links and other minor issues Message-ID: <201808101858.w7AIwweG012545@aojmv0008.oracle.com> Changeset: a2f3d8397e28 Author: jjg Date: 2018-08-10 11:58 -0700 URL: http://hg.openjdk.java.net/code-tools/jtreg/rev/a2f3d8397e28 Fix broken links and other minor issues ! src/share/doc/javatest/regtest/faq.md ! src/share/doc/javatest/regtest/tag-spec.html From jonathan.gibbons at oracle.com Tue Aug 14 21:18:08 2018 From: jonathan.gibbons at oracle.com (jonathan.gibbons at oracle.com) Date: Tue, 14 Aug 2018 21:18:08 +0000 Subject: hg: code-tools/jtreg: 4 new changesets Message-ID: <201808142118.w7ELI8Of016834@aojmv0008.oracle.com> Changeset: fb7f46b9fb7c Author: jjg Date: 2018-08-10 13:37 -0700 URL: http://hg.openjdk.java.net/code-tools/jtreg/rev/fb7f46b9fb7c Workaround display issues on OpenJDK website ! make/jtreg.gmk Changeset: e6b716673a35 Author: jjg Date: 2018-08-10 14:17 -0700 URL: http://hg.openjdk.java.net/code-tools/jtreg/rev/e6b716673a35 Minor reorg prior to new content; fix trailing whitespace ! src/share/doc/javatest/regtest/faq.md Changeset: 86fe47abead4 Author: jjg Date: 2018-08-14 13:41 -0700 URL: http://hg.openjdk.java.net/code-tools/jtreg/rev/86fe47abead4 Fix references to "sameVM" in resource files ! src/share/classes/com/sun/javatest/regtest/tool/i18n.properties Changeset: 0085a480195e Author: jjg Date: 2018-08-14 14:15 -0700 URL: http://hg.openjdk.java.net/code-tools/jtreg/rev/0085a480195e Big update of FAQ ! src/share/doc/javatest/regtest/faq.md From jonathan.gibbons at oracle.com Wed Aug 15 23:16:08 2018 From: jonathan.gibbons at oracle.com (jonathan.gibbons at oracle.com) Date: Wed, 15 Aug 2018 23:16:08 +0000 Subject: hg: code-tools/jtreg: More updates to FAQ, include Q on shell tests, and on test organization Message-ID: <201808152316.w7FNG9m4013315@aojmv0008.oracle.com> Changeset: 5a6a2e74371f Author: jjg Date: 2018-08-15 16:16 -0700 URL: http://hg.openjdk.java.net/code-tools/jtreg/rev/5a6a2e74371f More updates to FAQ, include Q on shell tests, and on test organization ! src/share/doc/javatest/regtest/faq.md From jonathan.gibbons at oracle.com Thu Aug 16 23:27:26 2018 From: jonathan.gibbons at oracle.com (jonathan.gibbons at oracle.com) Date: Thu, 16 Aug 2018 23:27:26 +0000 Subject: hg: code-tools/jtreg: 5 new changesets Message-ID: <201808162327.w7GNRReT012485@aojmv0008.oracle.com> Changeset: 023a99e46c2d Author: jjg Date: 2018-08-16 11:10 -0700 URL: http://hg.openjdk.java.net/code-tools/jtreg/rev/023a99e46c2d FAQ: When should I update the `@bug` entry in a test description? ! src/share/doc/javatest/regtest/faq.md Changeset: a85ecb3fe9c2 Author: jjg Date: 2018-08-16 11:56 -0700 URL: http://hg.openjdk.java.net/code-tools/jtreg/rev/a85ecb3fe9c2 FAQ: tiered testing, intermittent, randomness ! src/share/doc/javatest/regtest/faq.md Changeset: 18c35cc0bd89 Author: jjg Date: 2018-08-16 14:02 -0700 URL: http://hg.openjdk.java.net/code-tools/jtreg/rev/18c35cc0bd89 FAQ: fix errata and other minor suggestions ! src/share/doc/javatest/regtest/faq.md Changeset: b295dbef0500 Author: jjg Date: 2018-08-16 15:29 -0700 URL: http://hg.openjdk.java.net/code-tools/jtreg/rev/b295dbef0500 FAQ: Update info for TestNG and UNit tests ! src/share/doc/javatest/regtest/faq.md Changeset: 025cf3b5278c Author: jjg Date: 2018-08-16 16:22 -0700 URL: http://hg.openjdk.java.net/code-tools/jtreg/rev/025cf3b5278c FAQ: @modules, @requires, jtreg.SkippedException ! src/share/doc/javatest/regtest/faq.md From jonathan.gibbons at oracle.com Fri Aug 17 00:21:20 2018 From: jonathan.gibbons at oracle.com (jonathan.gibbons at oracle.com) Date: Fri, 17 Aug 2018 00:21:20 +0000 Subject: hg: code-tools/jtreg: FAQ: move 'Can I put more than one test in a file' to 'Writing a test'; added more examples; @comment Message-ID: <201808170021.w7H0LKQw025896@aojmv0008.oracle.com> Changeset: 20683719e90c Author: jjg Date: 2018-08-16 17:21 -0700 URL: http://hg.openjdk.java.net/code-tools/jtreg/rev/20683719e90c FAQ: move 'Can I put more than one test in a file' to 'Writing a test'; added more examples; @comment ! src/share/doc/javatest/regtest/faq.md From jonathan.gibbons at oracle.com Fri Aug 17 00:38:04 2018 From: jonathan.gibbons at oracle.com (jonathan.gibbons at oracle.com) Date: Fri, 17 Aug 2018 00:38:04 +0000 Subject: hg: code-tools/jtreg: FAQ: Can I run tests differently, depending on the circumstances? Message-ID: <201808170038.w7H0c4Cr029702@aojmv0008.oracle.com> Changeset: 79e033a570b0 Author: jjg Date: 2018-08-16 17:37 -0700 URL: http://hg.openjdk.java.net/code-tools/jtreg/rev/79e033a570b0 FAQ: Can I run tests differently, depending on the circumstances? ! src/share/doc/javatest/regtest/faq.md From jonathan.gibbons at oracle.com Fri Aug 17 21:32:28 2018 From: jonathan.gibbons at oracle.com (jonathan.gibbons at oracle.com) Date: Fri, 17 Aug 2018 21:32:28 +0000 Subject: hg: code-tools/jtreg: 2 new changesets Message-ID: <201808172132.w7HLWScs010027@aojmv0008.oracle.com> Changeset: 042c2a51a672 Author: jjg Date: 2018-08-17 12:00 -0700 URL: http://hg.openjdk.java.net/code-tools/jtreg/rev/042c2a51a672 FAQ: Can I test a JRE? ! src/share/doc/javatest/regtest/faq.md Changeset: 0967f54ded71 Author: jjg Date: 2018-08-17 14:32 -0700 URL: http://hg.openjdk.java.net/code-tools/jtreg/rev/0967f54ded71 FAQ: more on test cleanup, threads and timeouts ! src/share/doc/javatest/regtest/faq.md From jonathan.gibbons at oracle.com Fri Aug 17 21:50:44 2018 From: jonathan.gibbons at oracle.com (jonathan.gibbons at oracle.com) Date: Fri, 17 Aug 2018 21:50:44 +0000 Subject: hg: code-tools/jtreg: FAQ: minor wordsmithing Message-ID: <201808172150.w7HLoiG6014584@aojmv0008.oracle.com> Changeset: 6701f558600c Author: jjg Date: 2018-08-17 14:50 -0700 URL: http://hg.openjdk.java.net/code-tools/jtreg/rev/6701f558600c FAQ: minor wordsmithing ! src/share/doc/javatest/regtest/faq.md From jonathan.gibbons at oracle.com Sat Aug 18 17:42:48 2018 From: jonathan.gibbons at oracle.com (jonathan.gibbons at oracle.com) Date: Sat, 18 Aug 2018 17:42:48 +0000 Subject: hg: code-tools/jtreg: FAQ: fix typos Message-ID: <201808181742.w7IHgn3W014290@aojmv0008.oracle.com> Changeset: cd8d31e00cfb Author: jjg Date: 2018-08-18 10:36 -0700 URL: http://hg.openjdk.java.net/code-tools/jtreg/rev/cd8d31e00cfb FAQ: fix typos ! src/share/doc/javatest/regtest/faq.md From jonathan.gibbons at oracle.com Mon Aug 20 23:14:23 2018 From: jonathan.gibbons at oracle.com (jonathan.gibbons at oracle.com) Date: Mon, 20 Aug 2018 23:14:23 +0000 Subject: hg: code-tools/jtreg: FAQ: Combo tests; how long can a test take; how much output can it write? Message-ID: <201808202314.w7KNEN0Y027416@aojmv0008.oracle.com> Changeset: 4fa8e9d01ae6 Author: jjg Date: 2018-08-20 16:14 -0700 URL: http://hg.openjdk.java.net/code-tools/jtreg/rev/4fa8e9d01ae6 FAQ: Combo tests; how long can a test take; how much output can it write? ! src/share/doc/javatest/regtest/faq.md From jonathan.gibbons at oracle.com Wed Aug 29 21:35:53 2018 From: jonathan.gibbons at oracle.com (jonathan.gibbons at oracle.com) Date: Wed, 29 Aug 2018 21:35:53 +0000 Subject: hg: code-tools/jtreg: FAQ: Should I, and how do I, test a test? Message-ID: <201808292135.w7TLZr1E028509@aojmv0008.oracle.com> Changeset: 5b5c68dac306 Author: jjg Date: 2018-08-29 14:35 -0700 URL: http://hg.openjdk.java.net/code-tools/jtreg/rev/5b5c68dac306 FAQ: Should I, and how do I, test a test? ! src/share/doc/javatest/regtest/faq.md From aoqi at loongson.cn Thu Aug 30 12:36:38 2018 From: aoqi at loongson.cn (Ao Qi) Date: Thu, 30 Aug 2018 20:36:38 +0800 Subject: [Patch] When the order of the parameters is different, the behavior of jtdiff is different. Message-ID: Hi all, I do not know if some one uses jtdiff. When I use this tool, I think I found a bug. When the order of the parameters is different, the behavior is different. $ jtdiff -s results/ -o tmp/ Error: Bad directory argument for "super" mode $ jtdiff -o tmp/ -s results/ Differences found. I found it is because when there are more then one args which start with "-", jtdiff do not set inFiles = false. I made a small patch to fix this. I did not test this patch very much. diff -r fdfb9ee98733 src/share/classes/com/sun/javatest/regtest/tool/OptionDecoder.java --- a/src/share/classes/com/sun/javatest/regtest/tool/OptionDecoder.java Fri Aug 03 16:03:18 2018 -0700 +++ b/src/share/classes/com/sun/javatest/regtest/tool/OptionDecoder.java Thu Aug 30 20:26:49 2018 +0800 @@ -81,6 +81,8 @@ throw new BadArgs(i18n, "opt.empty"); if (!arg.startsWith("-")) inFiles = true; + else + inFiles = false; if (inFiles) { fileOption.process(null, arg); } else In addition, $ jtdiff -h Compare Options --r | --reason Include the reason string in the comparison, as well as the type (i.e. Passed, Failed, etc.) --s | --super Perform a "super-diff" looking for result sets within a directory hierarchy. The hierarchy must be arranged as follows: PATH/PLATFORM/YEAR/DAY_OF_YEAR/TEST_RESULTS, where ... However, it should be "-s", not "--s". Thanks, Ao Qi From jonathan.gibbons at oracle.com Thu Aug 30 18:07:08 2018 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Thu, 30 Aug 2018 11:07:08 -0700 Subject: [Patch] When the order of the parameters is different, the behavior of jtdiff is different. In-Reply-To: References: Message-ID: <5B88324C.5060003@oracle.com> Hi, Thank you for your interest, and the report, but jtdiff is behaving as expected, and no update is necessary (apart from fixing the help info, which I will take care of). In the case when the error is reported, your command line is invalid, because you are mixing options and files, when the command line help indicates that options should occur before any positional file arguments. So, to be clear: -s is an option that no arguments -o is an option that takes a directory as an argument results/ looks like the directory you are wanting to compare, and should be the first (and in this case, only) positional argument Look at your commands: $ jtdiff -s results/ -o tmp/ Error: Bad directory argument for "super" mode The positional file args will be all 3 of "results/", "-o", "/tmp" and you'll get an error message because -o does not exist as a file or directory. $ jtdiff -o tmp/ -s results/ Differences found. Yes, "-s" is specified correcttly as a single no-arg option, and "results/" is the first positional file arg If you wanted to swap -s and -o options, this would be the way to do it: $ jtdiff -s -o tmp/ results/ -- Jon On 08/30/2018 05:36 AM, Ao Qi wrote: > Hi all, > > I do not know if some one uses jtdiff. When I use this tool, I think I > found a bug. When the order of the parameters is different, the > behavior is different. > > $ jtdiff -s results/ -o tmp/ > Error: Bad directory argument for "super" mode > > $ jtdiff -o tmp/ -s results/ > Differences found. > > I found it is because when there are more then one args which start > with "-", jtdiff do not set inFiles = false. I made a small patch to > fix this. I did not test this patch very much. > > diff -r fdfb9ee98733 > src/share/classes/com/sun/javatest/regtest/tool/OptionDecoder.java > --- a/src/share/classes/com/sun/javatest/regtest/tool/OptionDecoder.java > Fri Aug 03 16:03:18 2018 -0700 > +++ b/src/share/classes/com/sun/javatest/regtest/tool/OptionDecoder.java > Thu Aug 30 20:26:49 2018 +0800 > @@ -81,6 +81,8 @@ > throw new BadArgs(i18n, "opt.empty"); > if (!arg.startsWith("-")) > inFiles = true; > + else > + inFiles = false; > if (inFiles) { > fileOption.process(null, arg); > } else > > In addition, > > $ jtdiff -h > Compare Options > > --r | --reason Include the reason string in the comparison, as well as the > type (i.e. Passed, Failed, etc.) > --s | --super Perform a "super-diff" looking for result sets within a > directory hierarchy. The hierarchy must be arranged as > follows: PATH/PLATFORM/YEAR/DAY_OF_YEAR/TEST_RESULTS, where > ... > > However, it should be "-s", not "--s". > > Thanks, > Ao Qi From jonathan.gibbons at oracle.com Thu Aug 30 18:17:39 2018 From: jonathan.gibbons at oracle.com (jonathan.gibbons at oracle.com) Date: Thu, 30 Aug 2018 18:17:39 +0000 Subject: hg: code-tools/jtreg: jtdiff: fix command-line help Message-ID: <201808301817.w7UIHeHE000997@aojmv0008.oracle.com> Changeset: 47820c88bcda Author: jjg Date: 2018-08-30 11:17 -0700 URL: http://hg.openjdk.java.net/code-tools/jtreg/rev/47820c88bcda jtdiff: fix command-line help ! src/share/classes/com/sun/javatest/diff/Help.java ! src/share/classes/com/sun/javatest/diff/Main.java