Skip to content

Commit 33565ce

Browse files
committed
Add support for running tests on OSX and Windows
Modify the copy-dependencies plugin configuration to copy dlls, dylibs, and .so's to the test-lib directory so that tests can be run on more platforms. Switch the phase to test-compile, since the libs aren't a compilation requirement. Update the maven surefire dependency and disable the system classloader for tests for this bug in some versions of the JDK (like on ubuntu right now): https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=911925
1 parent ee5fb8a commit 33565ce

File tree

2 files changed

+29
-17
lines changed

2 files changed

+29
-17
lines changed

Diff for: .gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
cleanup.sh
22
release.sh
33
target
4+
.idea/
5+
*.iml

Diff for: pom.xml

+27-17
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,26 @@
8383
</dependency>
8484

8585
<dependency>
86-
<groupId>com.almworks.sqlite4java</groupId>
87-
<artifactId>sqlite4java</artifactId>
88-
<version>${sqlite4java.version}</version>
89-
<scope>test</scope>
86+
<groupId>com.almworks.sqlite4java</groupId>
87+
<artifactId>sqlite4java</artifactId>
88+
<version>${sqlite4java.version}</version>
89+
<scope>test</scope>
90+
</dependency>
91+
92+
<dependency>
93+
<groupId>com.almworks.sqlite4java</groupId>
94+
<artifactId>libsqlite4java-osx</artifactId>
95+
<version>${sqlite4java.version}</version>
96+
<type>dylib</type>
97+
<scope>test</scope>
98+
</dependency>
99+
100+
<dependency>
101+
<groupId>com.almworks.sqlite4java</groupId>
102+
<artifactId>sqlite4java-win32-x64</artifactId>
103+
<version>${sqlite4java.version}</version>
104+
<type>dll</type>
105+
<scope>test</scope>
90106
</dependency>
91107

92108
<dependency>
@@ -136,21 +152,14 @@
136152
<executions>
137153
<execution>
138154
<id>copy</id>
139-
<phase>compile</phase>
155+
<phase>test-compile</phase>
140156
<goals>
141-
<goal>copy</goal>
157+
<goal>copy-dependencies</goal>
142158
</goals>
143159
<configuration>
144-
<artifactItems>
145-
<artifactItem>
146-
<groupId>com.almworks.sqlite4java</groupId>
147-
<artifactId>libsqlite4java-linux-amd64</artifactId>
148-
<version>${sqlite4java.version}</version>
149-
<type>so</type>
150-
<overWrite>true</overWrite>
151-
<outputDirectory>${project.build.directory}/test-lib</outputDirectory>
152-
</artifactItem>
153-
</artifactItems>
160+
<includeScope>test</includeScope>
161+
<includeTypes>so,dll,dylib</includeTypes>
162+
<outputDirectory>${project.build.directory}/test-lib</outputDirectory>
154163
</configuration>
155164
</execution>
156165
</executions>
@@ -159,8 +168,9 @@
159168
<plugin>
160169
<groupId>org.apache.maven.plugins</groupId>
161170
<artifactId>maven-surefire-plugin</artifactId>
162-
<version>2.19.1</version>
171+
<version>2.22.1</version>
163172
<configuration>
173+
<useSystemClassLoader>false</useSystemClassLoader>
164174
<includes>
165175
<include>**/Test*.java</include>
166176
<include>**/*Test.java</include>

0 commit comments

Comments
 (0)