[icedtea-web] RFC: Change test output format to be more jtreg-like
Dr Andrew John Hughes
ahughes at redhat.com
Wed Mar 9 16:52:04 PST 2011
On 17:27 Tue 08 Mar , Omair Majid wrote:
> Hi,
>
> The attached patch changes the output format of "make
> check-pack-functions" to be more jtreg like:
>
> $ make check
> make check-local
> make[1]: Entering directory `/home/omajid/workspace/icedtea-web/build'
> ./jrunscript
> /home/omajid/workspace/icedtea-web/build/../tests/netx/pac/pac-funcs-test.js
> \
> $(readlink -f
> /home/omajid/workspace/icedtea-web/build/../netx/net/sourceforge/jnlp/runtime/pac-funcs.js)
> loading needed files
>
> finished loaded needed files
>
> Passed: isPlainHostName(icedtea.classpath.org)
> Passed: isPlainHostName(classpath.org)
> Passed: isPlainHostName(org)
> ... snip....
> Passed: timeRange(17, 25, -7, 17, 25, 3)
> Passed: timeRange(17, 25, 3, 17, 24, 3)
> Test results: passed: 193; failed: 0;
>
> This should make it easier for the buildbot to parse the test results.
>
> Any thoughts or comments?
>
> Cheers,
> Omair
Fine by me if it makes life easier for the build bot.
If we split out jtreg from IcedTea6 as proposed, you may even be able to use it in IcedTea-Web.
> diff -r 07924a054c63 tests/netx/pac/pac-funcs-test.js
> --- a/tests/netx/pac/pac-funcs-test.js Mon Mar 07 17:09:22 2011 -0500
> +++ b/tests/netx/pac/pac-funcs-test.js Tue Mar 08 17:23:13 2011 -0500
> @@ -25,17 +25,15 @@
> testDateRange();
> testTimeRange();
>
> - java.lang.System.out.println(testsFailed + " of " + (testsFailed + testsPassed) + " tests failed");
> + java.lang.System.out.println("Test results: passed: " + testsPassed + "; failed: " + testsFailed + ";");
> }
>
> function runTests(name, tests) {
> - java.lang.System.out.println("Testing: " + name.name);
>
> var undefined_var;
>
> for ( var i = 0; i < tests.length; i++) {
>
> - java.lang.System.out.print("Test " + (i + 1) + ": ");
> var expectedVal = tests[i][0];
> var args = tests[i].slice(1);
> var returnVal;
> @@ -45,12 +43,11 @@
> returnVal = e;
> }
> if (returnVal === expectedVal) {
> - java.lang.System.out.println("Passed.");
> + java.lang.System.out.println("Passed: " + name.name + "(" + args.join(", ") + ")");
> testsPassed++;
> } else {
> - java.lang.System.out.println("FAILED.");
> - java.lang.System.out.println(name.name + "(" + args.join(", ") + ")");
> - java.lang.System.out.println("Expected '" + expectedVal + "' but got '" + returnVal + "'");
> + java.lang.System.out.println("FAILED: " + name.name + "(" + args.join(", ") + ")");
> + java.lang.System.out.println(" Expected '" + expectedVal + "' but got '" + returnVal + "'");
> testsFailed++;
> }
> }
--
Andrew :)
Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)
Support Free Java!
Contribute to GNU Classpath and IcedTea
http://www.gnu.org/software/classpath
http://icedtea.classpath.org
PGP Key: F5862A37 (https://keys.indymedia.org/)
Fingerprint = EA30 D855 D50F 90CD F54D 0698 0713 C3ED F586 2A37
More information about the distro-pkg-dev
mailing list