dsoumis commented on code in PR #970:
URL: https://github.com/apache/tomcat/pull/970#discussion_r3107297034


##########
build.xml:
##########
@@ -2134,6 +2134,48 @@
         </and>
       </or>
     </condition>
+    <echo message="OpenSSL is not available. OpenSSL-related tests will be 
skipped or may fail." level="warning" unless:set="test.openssl.exists"/>
+  </target>
+
+  <target name="test-tcnative-exists" description="Verifies tomcat-native 
library can be loaded">
+    <!-- Check if main classes are built -->
+    <available file="${test.run.classes}/org/apache/tomcat/jni/Library.class"
+               property="tomcat.classes.available"/>
+
+    <!-- If main classes don't exist, compile just what we need -->
+    <mkdir dir="${test.run.classes}" unless:set="tomcat.classes.available"/>
+    <javac srcdir="java" destdir="${test.run.classes}"
+           
includes="org/apache/tomcat/jni/Library.java,org/apache/tomcat/jni/LibraryNotFoundError.java"
+           debug="${compile.debug}"
+           includeantruntime="false"
+           encoding="UTF-8"
+           unless:set="tomcat.classes.available">
+      <compilerarg line="-Xlint:-options"/>
+    </javac>
+
+    <!-- Compile the test class -->
+    <mkdir dir="${test.classes}"/>
+    <javac srcdir="test" destdir="${test.classes}"
+           includes="org/apache/tomcat/jni/TesterLibraryLoad.java"
+           debug="${compile.debug}"
+           includeantruntime="false"
+           encoding="UTF-8">
+      <classpath>
+        <pathelement location="${test.run.classes}"/>
+        <pathelement location="${junit.jar}"/>
+      </classpath>
+    </javac>
+
+    <!-- Run test - it will check both test.apr.loc and system library paths 
-->
+    <junit printsummary="no" fork="yes" showoutput="false" 
haltonfailure="false"
+           failureproperty="test.tcnative.error" logfailedtests="false">
+      <jvmarg value="${runtests.librarypath}"/>
+      <jvmarg value="--enable-native-access=ALL-UNNAMED"/>

Review Comment:
   can replace with ${native.nativeaccess} for consistency



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to