<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div class="moz-cite-prefix">On 10/28/2024 8:49 AM, Alan Snyder
wrote:<br>
</div>
<blockquote type="cite" cite="mid:4B0CE760-AEE0-46E6-A479-961A7AD22D59@cbfiddle.com">
<pre class="moz-quote-pre" wrap="">I’m curious to know how the javac -target option is tested. I can think of several possibilities, but am wondering what actually is done.</pre>
</blockquote>
<p><br>
</p>
<p>You can satisfy your curiosity by looking the the javac
regressions tests in the OpenJDK repo. Under<br>
<br>
<a class="moz-txt-link-freetext" href="https://github.com/openjdk/jdk">https://github.com/openjdk/jdk</a><br>
<br>
see the test/langtools/tools/javac directory hierarchy.<br>
</p>
<p><br>
</p>
<blockquote type="cite" cite="mid:4B0CE760-AEE0-46E6-A479-961A7AD22D59@cbfiddle.com">
<pre class="moz-quote-pre" wrap="">
(I did not find any discussion of this issue in the online project docs.)
A few questions:
* Is javac -target required to generate the same byte code as the target javac?
</pre>
</blockquote>
<p>No.<br>
</p>
<blockquote type="cite" cite="mid:4B0CE760-AEE0-46E6-A479-961A7AD22D59@cbfiddle.com">
<pre class="moz-quote-pre" wrap="">
* Is javac -target required to generate the same error messages as the target javac?</pre>
</blockquote>
<p>No.</p>
<blockquote type="cite" cite="mid:4B0CE760-AEE0-46E6-A479-961A7AD22D59@cbfiddle.com">
<pre class="moz-quote-pre" wrap="">
* Are there negative tests to verify that language features introduced in later releases are rejected?</pre>
</blockquote>
<p>Yes.</p>
<p><span style="white-space: pre-wrap">
</span></p>
<blockquote type="cite" cite="mid:4B0CE760-AEE0-46E6-A479-961A7AD22D59@cbfiddle.com">
<pre class="moz-quote-pre" wrap="">
* How frequently are the tests typically run?</pre>
</blockquote>
<p>All the time. The javac tests are part of the "tier 1" tests of
OpenJDK and are run by the CI systems for (effectively) every
push.<br>
</p>
-Joe<span style="white-space: pre-wrap">
</span>
</body>
</html>