@@ -141,6 +141,16 @@ public abstract class AbstractTestMojo extends AbstractMojo {
141
141
@ Parameter (property = "debugPort" )
142
142
private int debugPort ;
143
143
144
+ /**
145
+ * if set to a non-null value, the platform is put in debug mode. If the value is a non-empty
146
+ * string it is interpreted as the location of the .options file. This file indicates what debug
147
+ * points are available for a plug-in and whether or not they are enabled. for a list of
148
+ * available options see <a href=
149
+ * "https://git.eclipse.org/c/equinox/rt.equinox.framework.git/plain/bundles/org.eclipse.osgi/.options">https://git.eclipse.org/c/equinox/rt.equinox.framework.git/plain/bundles/org.eclipse.osgi/.options</a>
150
+ */
151
+ @ Parameter (property = "osgi.debug" )
152
+ private String debugOptions ;
153
+
144
154
/**
145
155
* List of patterns (separated by commas) used to specify the tests that should be included in
146
156
* testing. When not specified and when the <code>test</code> parameter is not specified, the
@@ -205,11 +215,17 @@ public abstract class AbstractTestMojo extends AbstractMojo {
205
215
private String excludedGroups ;
206
216
207
217
/**
208
- * Enables -debug - consolelog for the test OSGi runtime
218
+ * Enables -consolelog for the test OSGi runtime
209
219
*/
210
220
@ Parameter (property = "tycho.showEclipseLog" , defaultValue = "false" )
211
221
private boolean showEclipseLog ;
212
222
223
+ /**
224
+ * prints all loaded bundles
225
+ */
226
+ @ Parameter (property = "tycho.printBundles" , defaultValue = "false" )
227
+ private boolean printBundles ;
228
+
213
229
/**
214
230
* Set this to "true" to redirect the unit test standard output to a file (found in
215
231
* reportsDirectory/testName-output.txt).
@@ -893,6 +909,7 @@ protected PropertiesWrapper createSurefireProperties(TestFrameworkProvider provi
893
909
wrapper .setProperty ("trimStackTrace" , String .valueOf (trimStackTrace ));
894
910
wrapper .setProperty ("skipAfterFailureCount" , String .valueOf (skipAfterFailureCount ));
895
911
wrapper .setProperty ("rerunFailingTestsCount" , String .valueOf (rerunFailingTestsCount ));
912
+ wrapper .setProperty ("printBundles" , String .valueOf (printBundles ));
896
913
Properties mergedProviderProperties = getMergedProviderProperties ();
897
914
mergedProviderProperties .putAll (provider .getProviderSpecificProperties ());
898
915
ScanResult scanResult = scanForTests ();
@@ -1133,11 +1150,16 @@ private EquinoxLaunchConfiguration createCommandLine(EquinoxInstallation testRun
1133
1150
for (Map .Entry <String , String > entry : getMergedSystemProperties ().entrySet ()) {
1134
1151
cli .addVMArguments ("-D" + entry .getKey () + "=" + entry .getValue ());
1135
1152
}
1136
-
1153
+ if (debugOptions != null || getLog ().isDebugEnabled ()) {
1154
+ if (debugOptions == null || debugOptions .isBlank ()) {
1155
+ cli .addProgramArguments ("-debug" );
1156
+ } else {
1157
+ cli .addProgramArguments ("-debug" , new File (debugOptions ).getAbsolutePath ());
1158
+ }
1159
+ }
1137
1160
if (getLog ().isDebugEnabled () || showEclipseLog ) {
1138
- cli .addProgramArguments ("-debug" , "- consolelog" );
1161
+ cli .addProgramArguments ("-consolelog" );
1139
1162
}
1140
-
1141
1163
addProgramArgs (cli , "-data" , osgiDataDirectory .getAbsolutePath (), //
1142
1164
"-install" , testRuntime .getLocation ().getAbsolutePath (), //
1143
1165
"-configuration" , testRuntime .getConfigurationLocation ().getAbsolutePath (), //
0 commit comments