|
2109 | 2109 | </target> |
2110 | 2110 |
|
2111 | 2111 | <target name="test-nio" description="Runs the JUnit test cases for NIO. Does not stop on errors." |
2112 | | - depends="-test-name-default,setup-jacoco,test-compile,deploy,test-openssl-exists" if="${execute.test.nio}"> |
| 2112 | + depends="-test-name-default,setup-jacoco,test-compile,deploy,test-openssl-exists,test-tcnative-exists" if="${execute.test.nio}"> |
2113 | 2113 | <runtests protocol="org.apache.coyote.http11.Http11NioProtocol" |
2114 | 2114 | extension=".NIO" /> |
2115 | 2115 | </target> |
2116 | 2116 |
|
2117 | 2117 | <target name="test-only-nio" description="Runs the JUnit test cases or NIO without test preparations. Does not stop on errors." |
2118 | | - depends="-test-name-default,setup-jacoco,test-openssl-exists" if="${execute.test.nio}"> |
| 2118 | + depends="-test-name-default,setup-jacoco,test-openssl-exists,test-tcnative-exists" if="${execute.test.nio}"> |
2119 | 2119 | <runtests protocol="org.apache.coyote.http11.Http11NioProtocol" |
2120 | 2120 | extension=".NIO" /> |
2121 | 2121 | </target> |
|
2134 | 2134 | </and> |
2135 | 2135 | </or> |
2136 | 2136 | </condition> |
| 2137 | + <echo message="OpenSSL is not available. OpenSSL-related tests will be skipped or may fail." level="warning" unless:set="test.openssl.exists"/> |
| 2138 | + </target> |
| 2139 | + |
| 2140 | + <target name="test-tcnative-exists" description="Verifies tomcat-native library can be loaded" |
| 2141 | + depends="test-compile"> |
| 2142 | + <!-- Build library path including both test location and system paths --> |
| 2143 | + <condition property="tcnative.library.path" value="${test.apr.loc};C:\Windows\System32"> |
| 2144 | + <os family="windows"/> |
| 2145 | + </condition> |
| 2146 | + <condition property="tcnative.library.path" value="${test.apr.loc}:/usr/local/lib:/opt/homebrew/lib:/usr/lib"> |
| 2147 | + <os family="mac"/> |
| 2148 | + </condition> |
| 2149 | + <property name="tcnative.library.path" value="${test.apr.loc}:/lib:/usr/lib:/lib64:/usr/lib64"/> |
| 2150 | + |
| 2151 | + <!-- Run test - it will check both test.apr.loc and system library paths --> |
| 2152 | + <junit printsummary="no" fork="yes" showoutput="false" haltonfailure="false" |
| 2153 | + failureproperty="test.tcnative.error" logfailedtests="false"> |
| 2154 | + <jvmarg value="-Djava.library.path=${tcnative.library.path}"/> |
| 2155 | + <jvmarg value="--enable-native-access=ALL-UNNAMED"/> |
| 2156 | + <classpath refid="tomcat.test.classpath"/> |
| 2157 | + <test name="org.apache.tomcat.jni.TesterLibraryLoad"/> |
| 2158 | + </junit> |
| 2159 | + |
| 2160 | + <echo message="Tomcat Native is not available. Tomcat Native (JNI) tests will be skipped." if:set="test.tcnative.error" level="warning"/> |
2137 | 2161 | </target> |
2138 | 2162 |
|
2139 | 2163 | <target name="test-httpd-exists" description="Checks for the httpd binary"> |
|
0 commit comments