[Git][java-team/css-validator][with-testsuite] 2 commits: Refresh patches through gbp pq (and harmonize with PR at upstream)

bastif (@bastif) gitlab at salsa.debian.org
Tue Mar 10 08:08:38 GMT 2026



bastif pushed to branch with-testsuite at Debian Java Maintainers / css-validator


Commits:
563955fe by Fab Stz at 2026-03-10T08:25:13+01:00
Refresh patches through gbp pq (and harmonize with PR at upstream)

- - - - -
12098d2d by Fab Stz at 2026-03-10T09:06:22+01:00
d/tests: build autotest with -Dprepare.run=false

- - - - -


10 changed files:

- debian/patches/0015-allow-running-autotest-towards-jar-instead-of-web-se-PART2.patch
- debian/patches/0015-allow-running-autotest-towards-jar-instead-of-web-se-PART3.patch
- debian/patches/0015-allow-running-autotest-towards-jar-instead-of-web-se.patch
- − debian/patches/autotest-clean.patch
- − debian/patches/autotest.build.patch
- debian/patches/debian-adapt-tests.patch
- debian/patches/fixCssValidator-warning-param.patch
- debian/patches/series
- debian/tests/cli-validate-testsuite.sh
- debian/tests/webapp_validate_testsuite.sh


Changes:

=====================================
debian/patches/0015-allow-running-autotest-towards-jar-instead-of-web-se-PART2.patch
=====================================
@@ -1,6 +1,62 @@
+From: Fab Stz <fabstz-it at yahoo.fr>
+Date: Tue, 10 Mar 2026 07:17:54 +0100
+Subject: more refinement to autotest classes
+
+Properly manage when the CLI errors out (instead of test failure)
+
+Write also the outcome of CLI tests to result.html file
+
+Display more information in the console, esp. the errors.
+
+Forwarded: https://github.com/w3c/css-validator/pull/486
+---
+ autotest/AutoTest.java               |  14 ++-
+ autotest/AutoTestContentHandler.java | 172 ++++++++++++++++++++++++++++++++---
+ 2 files changed, 171 insertions(+), 15 deletions(-)
+
+diff --git a/autotest/AutoTest.java b/autotest/AutoTest.java
+index a63997c..9d74156 100644
+--- a/autotest/AutoTest.java
++++ b/autotest/AutoTest.java
+@@ -85,23 +85,29 @@ public class AutoTest {
+ 			AutoTest parser = new AutoTest(instance);
+ 			parser.parse(uri);
+ 			if (parser.autoTestContentHandler.hasErrors()) {
+-				System.err.println("\tTest outcome:" +
++				System.err.println("\tTests outcome:" +
+ 					" " +
+ 					parser.autoTestContentHandler.getTestSuccessCount() +
+ 					" success(es)." +
+ 					" " +
+ 					parser.autoTestContentHandler.getTestFailCount() +
+-					" failure(s)."
++					" failure(s)." +
++					" " +
++					parser.autoTestContentHandler.getTestErrorCount() +
++					" error(s)."
+ 					);
+ 				System.exit(1);
+ 			} else {
+-				System.out.println("\tTest outcome:" +
++				System.out.println("\tTests outcome:" +
+ 					" " +
+ 					parser.autoTestContentHandler.getTestSuccessCount() +
+ 					" success(es)." +
+ 					" " +
+ 					parser.autoTestContentHandler.getTestFailCount() +
+-					" failure(s)."
++					" failure(s)." +
++					" " +
++					parser.autoTestContentHandler.getTestErrorCount() +
++					" error(s)."
+ 					);
+ 			}
+ 		} catch (Throwable t) {
+diff --git a/autotest/AutoTestContentHandler.java b/autotest/AutoTestContentHandler.java
+index de8ef24..9ac0223 100644
 --- a/autotest/AutoTestContentHandler.java
 +++ b/autotest/AutoTestContentHandler.java
-@@ -11,10 +11,13 @@
+@@ -11,10 +11,13 @@ import org.xml.sax.Locator;
  import org.xml.sax.SAXException;
  
  import java.io.BufferedWriter;
@@ -14,7 +70,7 @@
  import java.net.HttpURLConnection;
  import java.net.MalformedURLException;
  import java.net.URL;
-@@ -65,6 +68,8 @@
+@@ -65,6 +68,8 @@ public class AutoTestContentHandler implements ContentHandler {
  	boolean inWarnings = false;
  	int testFailCount = 0;
  	int testSuccessCount = 0;
@@ -23,7 +79,7 @@
  	String urlString = "";
  	String file = "";
  	String desc = "";
-@@ -74,6 +79,7 @@
+@@ -74,6 +79,7 @@ public class AutoTestContentHandler implements ContentHandler {
  	String warning;
  	String medium;
  	String testInstance = "servlet";
@@ -31,7 +87,7 @@
  	
  	/**
  	 * Default Constructor.
-@@ -194,7 +200,13 @@
+@@ -194,7 +200,13 @@ public class AutoTestContentHandler implements ContentHandler {
  			desc = "";
  			result = new Result();
  
@@ -46,7 +102,7 @@
  			profile = null;
  			medium = null;
  			for (int i = 0; i < attributs.getLength(); i++) {
-@@ -234,6 +246,61 @@
+@@ -234,6 +246,61 @@ public class AutoTestContentHandler implements ContentHandler {
  		}
  	}
  
@@ -108,7 +164,7 @@
  	/**
  	 * @see org.xml.sax.ContentHandler#endElement(java.lang.String,
  	 *      java.lang.String, java.lang.String)
-@@ -265,6 +332,8 @@
+@@ -265,6 +332,8 @@ public class AutoTestContentHandler implements ContentHandler {
  				System.err.println(e.getMessage());
  			}
  		} else if (element == TEST) {
@@ -117,7 +173,7 @@
  			System.out.print(urlString + "... ");
  			String validURL = createValidURL(urlString);
  			String val;
-@@ -290,7 +359,11 @@
+@@ -290,7 +359,11 @@ public class AutoTestContentHandler implements ContentHandler {
  
  			if (warning != null) {
  				val += "&warning=" + warning;
@@ -130,16 +186,7 @@
  			}
  			if (profile != null) {
  				val += "&profile=" + profile;
-@@ -314,7 +387,7 @@
- 				InputStream res = null;
- 				if (testInstance.equals("servlet")) {
- 					conn = (HttpURLConnection) new URL(val).openConnection();
--					// System.out.println(val);
-+					//System.out.println(val);
- 					// Get the reply input stream that contains the actual data:
- 					res = conn.getInputStream();
- 				} else if (testInstance.equals("jar")) {
-@@ -325,12 +398,14 @@
+@@ -325,12 +398,14 @@ public class AutoTestContentHandler implements ContentHandler {
  					Map<String, String> env = pb.environment();
  					env.put("CLASSPATH", env.get("CLASSPATH") + ":css-validator.jar");
  					Process p = pb.start();
@@ -154,7 +201,7 @@
  					res = p.getInputStream();
  				} else {
  					System.err.println("Unsupported operation. Invalid instance or instance not set: " + testInstance);
-@@ -344,15 +419,26 @@
+@@ -344,15 +419,26 @@ public class AutoTestContentHandler implements ContentHandler {
  				}
  
  				if (testInstance.equals("servlet") && conn.getResponseCode() == 500) { // Internal Server Error
@@ -181,7 +228,7 @@
  				} else {
  					result = new Result();
  					int begin = buf.indexOf("<m:validity>");
-@@ -381,11 +467,31 @@
+@@ -381,11 +467,31 @@ public class AutoTestContentHandler implements ContentHandler {
  				}
  
  			} catch (MalformedURLException e) {
@@ -217,7 +264,7 @@
  			}
  
  			isFile = false;
-@@ -402,6 +508,16 @@
+@@ -402,6 +508,16 @@ public class AutoTestContentHandler implements ContentHandler {
  		}
  	}
  
@@ -234,7 +281,7 @@
  	/**
  	 * @see org.xml.sax.ContentHandler#characters(char[], int, int)
  	 */
-@@ -516,7 +632,6 @@
+@@ -516,7 +632,6 @@ public class AutoTestContentHandler implements ContentHandler {
  	 *            the validator page result
  	 */
  	private void printResultToConsole(String urlString) {
@@ -242,7 +289,7 @@
  		if (isValidEqual() && isWarningsEqual() && isErrorsEqual()) {
  			testSuccessCount++;
  			System.out.println(" Success");
-@@ -546,19 +661,50 @@
+@@ -546,18 +661,49 @@ public class AutoTestContentHandler implements ContentHandler {
  	private void printError(String validatorPage, String message) {
  
  		validatorPage = validatorPage.replaceAll("&", "&");
@@ -282,7 +329,7 @@
  		print("    </div>");
  	}
  
- 	/**
++	/**
 +	 * Used when an error occurs. Prints to console.
 +	 *
 +	 */
@@ -292,11 +339,10 @@
 +		System.err.println(errorSb.toString().indent(4)); // String.indent() requires java >= 12.
 +	}
 +
-+	/**
+ 	/**
  	 * Replaces all URL special chars in a String with their matching URL
  	 * entities
- 	 * 
-@@ -601,7 +747,7 @@
+@@ -601,7 +747,7 @@ public class AutoTestContentHandler implements ContentHandler {
  	}
  
  	public boolean hasErrors() {
@@ -305,7 +351,7 @@
  			return true;
  		}
  		return false;
-@@ -615,4 +761,8 @@
+@@ -615,4 +761,8 @@ public class AutoTestContentHandler implements ContentHandler {
  		return testSuccessCount;
  	}
  
@@ -314,39 +360,3 @@
 +	}
 +
  }
---- a/autotest/AutoTest.java
-+++ b/autotest/AutoTest.java
-@@ -85,23 +85,29 @@
- 			AutoTest parser = new AutoTest(instance);
- 			parser.parse(uri);
- 			if (parser.autoTestContentHandler.hasErrors()) {
--				System.err.println("\tTest outcome:" +
-+				System.err.println("\tTests outcome:" +
- 					" " +
- 					parser.autoTestContentHandler.getTestSuccessCount() +
- 					" success(es)." +
- 					" " +
- 					parser.autoTestContentHandler.getTestFailCount() +
--					" failure(s)."
-+					" failure(s)." +
-+					" " +
-+					parser.autoTestContentHandler.getTestErrorCount() +
-+					" error(s)."
- 					);
- 				System.exit(1);
- 			} else {
--				System.out.println("\tTest outcome:" +
-+				System.out.println("\tTests outcome:" +
- 					" " +
- 					parser.autoTestContentHandler.getTestSuccessCount() +
- 					" success(es)." +
- 					" " +
- 					parser.autoTestContentHandler.getTestFailCount() +
--					" failure(s)."
-+					" failure(s)." +
-+					" " +
-+					parser.autoTestContentHandler.getTestErrorCount() +
-+					" error(s)."
- 					);
- 			}
- 		} catch (Throwable t) {


=====================================
debian/patches/0015-allow-running-autotest-towards-jar-instead-of-web-se-PART3.patch
=====================================
@@ -1,6 +1,20 @@
+From: Fab Stz <fabstz-it at yahoo.fr>
+Date: Tue, 10 Mar 2026 08:06:00 +0100
+Subject: =?utf-8?q?support_=27=C3=A0=27_char=2C_set_default_value_of_params?=
+
+Same default value as the javascript test processor
+
+Forwarded: https://github.com/w3c/css-validator/pull/486
+---
+ autotest/AutoTestContentHandler.java | 26 ++++++++++++++++++--------
+ build.xml                            |  1 +
+ 2 files changed, 19 insertions(+), 8 deletions(-)
+
+diff --git a/autotest/AutoTestContentHandler.java b/autotest/AutoTestContentHandler.java
+index 9ac0223..467a477 100644
 --- a/autotest/AutoTestContentHandler.java
 +++ b/autotest/AutoTestContentHandler.java
-@@ -12,6 +12,7 @@
+@@ -12,6 +12,7 @@ import org.xml.sax.SAXException;
  
  import java.io.BufferedWriter;
  import java.io.BufferedReader;
@@ -8,7 +22,7 @@
  import java.io.File;
  import java.io.FileWriter;
  import java.io.IOException;
-@@ -200,15 +201,17 @@
+@@ -200,15 +201,17 @@ public class AutoTestContentHandler implements ContentHandler {
  			desc = "";
  			result = new Result();
  
@@ -32,7 +46,7 @@
  			for (int i = 0; i < attributs.getLength(); i++) {
  				String currentAttr = attributs.getLocalName(i);
  				if (currentAttr.equals("warning")) {
-@@ -347,8 +350,13 @@
+@@ -347,8 +350,13 @@ public class AutoTestContentHandler implements ContentHandler {
  						.getClassLoader()
  						.getResourceAsStream(urlString);
  					byte[] textBytes = new byte[content.available()];
@@ -48,7 +62,7 @@
  				} catch (IOException e) {
  					System.err.println(e.getMessage());
  				}
-@@ -743,6 +751,8 @@
+@@ -743,6 +751,8 @@ public class AutoTestContentHandler implements ContentHandler {
  		res = res.replaceAll("~'", "%7E");
  		res = res.replaceAll("\\\n", "");
  		res = res.replaceAll("\\\r", "");
@@ -57,3 +71,15 @@
  		return res;
  	}
  
+diff --git a/build.xml b/build.xml
+index 9e75791..a2bc0a7 100644
+--- a/build.xml
++++ b/build.xml
+@@ -161,6 +161,7 @@
+            classpathref="build.class.path"
+            classpath="."
+            debug="yes"
++           encoding="UTF-8"
+            includeantruntime="false"/>
+   </target>
+ 


=====================================
debian/patches/0015-allow-running-autotest-towards-jar-instead-of-web-se.patch
=====================================
@@ -6,12 +6,14 @@ Permit to build autotest without running the tests.
 This add a 2nd argument to the AutoTest.main which is the engine to use for tests.
 It can be either 'servlet' (URL to css-validator servlet at jigsaw.w3.org)
 or 'jar' (the presently built css-validator.jar) or 'cli' (a command line wrapper script called css-validator'
+
+Forwarded: https://github.com/w3c/css-validator/pull/486
 ---
  autotest/AutoTest.java               |  46 +++++++++++--
  autotest/AutoTestContentHandler.java | 127 ++++++++++++++++++++++++++++++++---
  autotest/autotest.sh                 |   2 +-
- build.xml                            |  13 ++--
- 4 files changed, 168 insertions(+), 20 deletions(-)
+ build.xml                            |  20 ++++--
+ 4 files changed, 175 insertions(+), 20 deletions(-)
 
 diff --git a/autotest/AutoTest.java b/autotest/AutoTest.java
 index 11b967c..a63997c 100644
@@ -326,24 +328,27 @@ index 1ebfa06..4c0af83 100755
 -java -cp css-validator.jar autotest.AutoTest "$1"
 +java -cp css-validator.jar autotest.AutoTest "$1" "${ENGINE:-servlet}"
 diff --git a/build.xml b/build.xml
-index 494f241..d8c1b8b 100644
+index 494f241..9e75791 100644
 --- a/build.xml
 +++ b/build.xml
-@@ -156,7 +156,12 @@
+@@ -156,7 +156,15 @@
      </war>
    </target>
  
 -  <target name="autotest" depends="jar">
-+  <target name="autotest.build">
-+    <javac srcdir="autotest" classpath="." debug="yes"
-+      includeantruntime="false"/>
++  <target name="autotest.build" depends="prepare">
++    <javac srcdir="autotest"
++           classpathref="build.class.path"
++           classpath="."
++           debug="yes"
++           includeantruntime="false"/>
 +  </target>
 +
 +  <target name="autotest" depends="autotest.build,jar">
      <fail message="&#xa0;${line.separator}${line.separator}
    Usage: ant autotest -Dtestfile=testsuite/xml/FILENAME.xml">
        <condition>
-@@ -165,10 +170,10 @@
+@@ -165,10 +173,10 @@
          </not>
        </condition>
      </fail>
@@ -357,3 +362,14 @@ index 494f241..d8c1b8b 100644
      </java>
    </target>
  
+@@ -200,6 +208,10 @@
+     <delete dir="./build"/>
+     <delete dir="./javadoc"/>
+     <delete dir="./tmp"/>
++    <delete file="autotest/results/results.html"/>
++    <delete>
++      <fileset dir="autotest" includes="*.class"/>
++    </delete>
+   </target>
+ 
+ </project>


=====================================
debian/patches/autotest-clean.patch deleted
=====================================
@@ -1,12 +0,0 @@
---- a/build.xml
-+++ b/build.xml
-@@ -200,7 +200,9 @@
-     <delete file="${war.file}"/>
-     <delete>
-       <fileset dir="." includes="validator.html.*"/>
-+      <fileset dir="autotest" includes="*.class"/>
-     </delete>
-+    <delete file="autotest/results/results.html"/>
-     <delete file="translations.html"/>
-     <delete dir="./build"/>
-     <delete dir="./javadoc"/>


=====================================
debian/patches/autotest.build.patch deleted
=====================================
@@ -1,10 +0,0 @@
---- a/build.xml
-+++ b/build.xml
-@@ -158,6 +158,7 @@
- 
-   <target name="autotest.build">
-     <javac srcdir="autotest" classpath="." debug="yes"
-+           encoding="UTF-8"
-       includeantruntime="false"/>
-   </target>
- 


=====================================
debian/patches/debian-adapt-tests.patch
=====================================
@@ -2,16 +2,17 @@ From: Fab Stz <fabstz-it at yahoo.fr>
 Date: Sat, 7 Mar 2026 13:53:20 +0100
 Subject: Adapt autotest for debian package
 
+Forwarded: not-needed
 ---
  autotest/AutoTestContentHandler.java | 2 +-
- build.xml                            | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
+ build.xml                            | 5 ++---
+ 2 files changed, 3 insertions(+), 4 deletions(-)
 
 diff --git a/autotest/AutoTestContentHandler.java b/autotest/AutoTestContentHandler.java
-index de8ef24..452c70c 100644
+index 467a477..1e8971c 100644
 --- a/autotest/AutoTestContentHandler.java
 +++ b/autotest/AutoTestContentHandler.java
-@@ -37,7 +37,7 @@ import java.util.Map;
+@@ -41,7 +41,7 @@ import java.util.Map;
  public class AutoTestContentHandler implements ContentHandler {
  
  	public static final String CLI_PARAMS = "--output=soap12";
@@ -21,10 +22,20 @@ index de8ef24..452c70c 100644
  	public static final int TESTSUITE = "testsuite".hashCode();
  	public static final int TEST = "test".hashCode();
 diff --git a/build.xml b/build.xml
-index d8c1b8b..44803d0 100644
+index a2bc0a7..99e9936 100644
 --- a/build.xml
 +++ b/build.xml
-@@ -171,7 +171,7 @@
+@@ -158,8 +158,7 @@
+ 
+   <target name="autotest.build" depends="prepare">
+     <javac srcdir="autotest"
+-           classpathref="build.class.path"
+-           classpath="."
++           classpath="${classpath}:."
+            debug="yes"
+            encoding="UTF-8"
+            includeantruntime="false"/>
+@@ -175,7 +174,7 @@
        </condition>
      </fail>
      <property name="autotest.engine" value="jar"/>


=====================================
debian/patches/fixCssValidator-warning-param.patch
=====================================
@@ -1,3 +1,24 @@
+From: Fab Stz <fabstz-it at yahoo.fr>
+Date: Tue, 10 Mar 2026 07:17:54 +0100
+Subject: Define warning and medium args properly in CLI
+
+Compared to how parameters are passed to the servlet and their default values,
+there is a difference with CLI which was causing different results when
+running the test suite.
+
+This will consider the warning argument properly, so that the count of warning
+is correct depending on the value of the parameter
+
+This will also pass the 'medium' argument properly as well, because it should
+not be considered for CSS1 (like the servlet does)
+
+Forwarded: https://github.com/w3c/css-validator/pull/486
+---
+ org/w3c/css/css/CssValidator.java | 13 +++++++++++--
+ 1 file changed, 11 insertions(+), 2 deletions(-)
+
+diff --git a/org/w3c/css/css/CssValidator.java b/org/w3c/css/css/CssValidator.java
+index 26cbdf3..1e92d78 100644
 --- a/org/w3c/css/css/CssValidator.java
 +++ b/org/w3c/css/css/CssValidator.java
 @@ -10,6 +10,7 @@
@@ -8,7 +29,7 @@
  import org.w3c.css.util.HTTPURL;
  import org.w3c.css.util.Messages;
  import org.w3c.css.util.Util;
-@@ -79,13 +80,21 @@
+@@ -79,13 +80,21 @@ public class CssValidator {
          String profile = params.get("profile");
          ac.setCssVersionAndProfile(profile);
  


=====================================
debian/patches/series
=====================================
@@ -13,9 +13,7 @@ install_scripts_only_js.patch
 0011-Replace-w3c-image-and-url-by-debian-s-part1.patch
 0012-Replace-w3c-image-and-url-by-debian-s-part2.patch
 0015-allow-running-autotest-towards-jar-instead-of-web-se.patch
-debian-adapt-tests.patch
-autotest-clean.patch
 0015-allow-running-autotest-towards-jar-instead-of-web-se-PART2.patch
 fixCssValidator-warning-param.patch
 0015-allow-running-autotest-towards-jar-instead-of-web-se-PART3.patch
-autotest.build.patch
+debian-adapt-tests.patch


=====================================
debian/tests/cli-validate-testsuite.sh
=====================================
@@ -19,7 +19,7 @@ FAILED_ONCE=0
 # TODO: TEMPORARY HACK. REMOVE ME WHEN THE TESTSUITE IS IN ORIGTAR
 if [ ! -e testsuite/xml/ -a -d testsuite ] && [ -e debian/testsuite ] || [ ! -e testsuite ]; then rmdir testsuite 2>&1 || true; ln -s debian/testsuite .; fi
 
-ant autotest.build
+ant -Dprepare.run=false autotest.build
 
 prefix="cli"
 


=====================================
debian/tests/webapp_validate_testsuite.sh
=====================================
@@ -19,7 +19,7 @@ FAILED_ONCE=0
 # TODO: TEMPORARY HACK. REMOVE ME WHEN THE TESTSUITE IS IN ORIGTAR
 if [ ! -e testsuite/xml/ -a -d testsuite ] && [ -e debian/testsuite ] || [ ! -e testsuite ]; then rmdir testsuite 2>&1 || true; ln -s debian/testsuite .; fi
 
-ant autotest.build
+ant -Dprepare.run=false autotest.build
 
 prefix="${server}"
 



View it on GitLab: https://salsa.debian.org/java-team/css-validator/-/compare/6af88e36e527fb03dde23b5de4db751e066950da...12098d2d963b3281718805ea34f5c5004aa6313f

-- 
View it on GitLab: https://salsa.debian.org/java-team/css-validator/-/compare/6af88e36e527fb03dde23b5de4db751e066950da...12098d2d963b3281718805ea34f5c5004aa6313f
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20260310/d427bd0f/attachment.htm>


More information about the pkg-java-commits mailing list