Commit: e1ee4627704131b7a93d1893468a182bd9b9f9a7
Author: Matt Ficken <v-maf...@microsoft.com> Mon, 12 Aug 2013
14:21:34 -0700
Parents: bd4eeb66c1ee9626aa6c3b1eec85e74fe44f8152
Branches: master
Link:
http://git.php.net/?p=pftt2.git;a=commitdiff;h=e1ee4627704131b7a93d1893468a182bd9b9f9a7
Log:
fix required-extensions smoke test
Changed paths:
M src/com/mostc/pftt/main/PfttMain.java
M src/com/mostc/pftt/model/core/PhpBuild.java
M src/com/mostc/pftt/model/core/PhpIni.java
M src/com/mostc/pftt/model/core/ReadOnlyPhpIni.java
M src/com/mostc/pftt/model/smoke/RequiredExtensionsSmokeTest.java
M src/com/mostc/pftt/model/smoke/RequiredFeaturesSmokeTest.java
M src/com/mostc/pftt/results/LocalConsoleManager.java
M src/com/mostc/pftt/results/PhpResultPackWriter.java
diff --git a/src/com/mostc/pftt/main/PfttMain.java
b/src/com/mostc/pftt/main/PfttMain.java
index 584b5f4..64ea5c0 100644
--- a/src/com/mostc/pftt/main/PfttMain.java
+++ b/src/com/mostc/pftt/main/PfttMain.java
@@ -454,6 +454,7 @@ public class PfttMain {
System.out.println();
System.out.println(" === Test Times ===");
System.out.println(new AlignedTable(2, 85)
+ .addRow("-max_run_time_millis <N>", "milliseconds to
run each ScenarioSet for")
.addRow("-run_test_pack <N>", "runs entire test-pack N
times")
.addRow("-run_group_times_all <N>", "runs all groups of
tests N times (in same order every time, unless -randomize used)")
.addRow("-run_group_times_list <N> <list file>", "just
like run_group_times_all and run_test_times_list (but for groups of tests)")
@@ -624,16 +625,18 @@ public class PfttMain {
// on Windows, missing .DLLs
from a php build will cause a blocking winpop dialog msg to appear
// in such a case, the test
will timeout after 1 minute and then fail (stopping at that point is important)
// @see
PhpBuild#getExtensionList
- if (test.test(build, cm, host,
SAPIScenario.getSAPIScenario(scenario_set).getSAPIType())==ESmokeTestStatus.FAIL)
{
+ if (test.test(build, cm, host,
SAPIScenario.getSAPIScenario(scenario_set).getSAPIType(),
tmgr)==ESmokeTestStatus.FAIL) {
// if this test fails,
RequiredFeaturesSmokeTest will fail for sure
cm.println(EPrintType.CANT_CONTINUE, "Main", "Failed smoke test:
"+test.getName());
+
break;
}
}
{
RequiredFeaturesSmokeTest test
= new RequiredFeaturesSmokeTest();
- if (test.test(build, cm,
host)==ESmokeTestStatus.FAIL) {
+ if (test.test(build, cm, host,
tmgr)==ESmokeTestStatus.FAIL) {
cm.println(EPrintType.CANT_CONTINUE, "Main", "Failed smoke test:
"+test.getName());
+
break;
}
}
@@ -654,6 +657,8 @@ public class PfttMain {
PhptTestCountsMatchSmokeTest test = new
PhptTestCountsMatchSmokeTest();
if
(test.test(tmgr)==ESmokeTestStatus.FAIL) {
cm.println(EPrintType.CANT_CONTINUE, "Main", "Failed smoke test:
"+test.getName());
+
+
tmgr.notifyFailedSmokeTest(test.getName(), "");
}
}
//
@@ -682,15 +687,17 @@ public class PfttMain {
if (!cm.isSkipSmokeTests()) {
{
RequiredExtensionsSmokeTest
test = new RequiredExtensionsSmokeTest();
- if (test.test(build, cm, host,
SAPIScenario.getSAPIScenario(scenario_set).getSAPIType())==ESmokeTestStatus.FAIL)
{
+ if (test.test(build, cm, host,
SAPIScenario.getSAPIScenario(scenario_set).getSAPIType(),
tmgr)==ESmokeTestStatus.FAIL) {
cm.println(EPrintType.CANT_CONTINUE, "Main", "Failed smoke test:
"+test.getName());
+
break;
}
}
{
RequiredFeaturesSmokeTest test
= new RequiredFeaturesSmokeTest();
- if (test.test(build, cm,
host)==ESmokeTestStatus.FAIL) {
+ if (test.test(build, cm, host,
tmgr)==ESmokeTestStatus.FAIL) {
cm.println(EPrintType.CANT_CONTINUE, "Main", "Failed smoke test:
"+test.getName());
+
break;
}
}
@@ -719,6 +726,8 @@ public class PfttMain {
PhptTestCountsMatchSmokeTest test = new
PhptTestCountsMatchSmokeTest();
if
(test.test(tmgr)==ESmokeTestStatus.FAIL) {
cm.println(EPrintType.CANT_CONTINUE, "Main", "Failed smoke test:
"+test.getName());
+
+
tmgr.notifyFailedSmokeTest(test.getName(), "");
}
}
//
@@ -1114,6 +1123,9 @@ public class PfttMain {
} else {
cm.println(EPrintType.CLUE, PfttMain.class,
"Build: "+build);
build = new PhpBuild(host.getPhpSdkDir() + "/"
+ path);
+ // open all builds now to ensure they exist
(rather than finding out
+ // later when build is used (because that
could be hours away if running
+ // several scenario sets and several builds))
if (build.open(cm, host)) {
builds.add(build);
} else {
@@ -1251,6 +1263,7 @@ public class PfttMain {
Config config = null;
boolean is_uac = false, debug = false, randomize_order = false,
no_result_file_for_pass_xskip_skip = false, pftt_debug = false, show_gui =
false, overwrite = false, disable_debug_prompt = false, results_only = false,
dont_cleanup_test_pack = false, phpt_not_in_place = false, thread_safety =
true, skip_smoke_tests = false, pause = false, restart_each_test_all = false,
no_restart_all = false, ignore_unknown_option = false, ini_actual_all = false;
+ long max_run_time_millis = 0;
int run_test_times_all = 1, run_test_pack = 1, delay_between_ms
= 0, run_test_times_list_times = 1, run_group_times_all = 1,
run_group_times_list_times = 1, max_test_read_count = 0, thread_count = 0,
run_count = 0, suspend_seconds = 0;
LinkedList<String> debug_list = new LinkedList<String>();
LinkedList<String> run_test_times_list = new
LinkedList<String>();
@@ -1359,6 +1372,9 @@ public class PfttMain {
no_restart_all = true;
} else if (args[args_i].equals("-ini_actual_all")) {
ini_actual_all = true;
+ } else if (args[args_i].equals("-max_run_time_millis"))
{
+ args_i++;
+ max_run_time_millis =
Long.parseLong(args[args_i]);
} else if (args[args_i].equals("-delay_between_ms")) {
args_i++;
delay_between_ms =
Integer.parseInt(args[args_i]);
@@ -1429,7 +1445,7 @@ public class PfttMain {
} else if (args[args_i].equals("-uac")) {
// ignore: intercepted and handled by
bin/pftt.cmd batch script
is_uac = true;
- } else if (args[args_i].equals("-pftt-profile")) {
+ } else if (args[args_i].equals("-pftt_profile")) {
// ignore: intercepted and handled by
bin/pftt.cmd batch script
} else if (args[args_i].equals("-pftt_debug")) {
pftt_debug = true;
@@ -1491,7 +1507,7 @@ public class PfttMain {
cm = new LocalConsoleManager(source_pack, debug_pack,
overwrite, debug, results_only, show_gui, disable_debug_prompt,
dont_cleanup_test_pack, phpt_not_in_place, pftt_debug,
no_result_file_for_pass_xskip_skip, randomize_order, run_test_times_all,
run_test_pack,
thread_safety, run_test_times_list_times,
run_group_times_all, run_group_times_list_times, debug_list,
run_test_times_list, run_group_times_list, skip_list,
skip_smoke_tests, max_test_read_count,
thread_count, restart_each_test_all, no_restart_all, delay_between_ms,
- run_count, suspend_seconds, ini_actual_all);
+ run_count, suspend_seconds, ini_actual_all,
max_run_time_millis);
p.cm = cm;
if (command!=null) {
diff --git a/src/com/mostc/pftt/model/core/PhpBuild.java
b/src/com/mostc/pftt/model/core/PhpBuild.java
index f5f37aa..0f47cd5 100644
--- a/src/com/mostc/pftt/model/core/PhpBuild.java
+++ b/src/com/mostc/pftt/model/core/PhpBuild.java
@@ -37,16 +37,17 @@ import com.mostc.pftt.util.StringUtil2;
public class PhpBuild extends SAPIManager {
private String build_path, php_exe, php_cgi_exe;
private WeakHashMap<PhpIni,WeakHashMap<String,Boolean>> ext_enable_map;
+ private WeakHashMap<PhpIni,String[]> ext_available_map;
private SoftReference<String> php_info;
private SoftReference<PhpIni> php_ini;
private String version_str, revision;
private EBuildBranch branch;
- private SoftReference<String[]> module_list;
private int major, minor, release;
public PhpBuild(String build_path) {
this.build_path = new File(build_path).getAbsolutePath();
- ext_enable_map = new
WeakHashMap<PhpIni,WeakHashMap<String,Boolean>>();
+ ext_enable_map = new
WeakHashMap<PhpIni,WeakHashMap<String,Boolean>>(3);
+ ext_available_map = new WeakHashMap<PhpIni,String[]>(3);
}
/** checks if given OpenSSL version is compatible with this PHP Build
@@ -567,33 +568,24 @@ public class PhpBuild extends SAPIManager {
WeakHashMap<String,Boolean> map = ext_enable_map.get(ini);
if (map!=null) {
Boolean b = map.get(ext_name);
- //return b == null ? false : b.booleanValue();
- return true;
+ return b == null ? false : b.booleanValue();
}
map = new WeakHashMap<String,Boolean>();
ext_enable_map.put(ini, map);
-
- if (ini!=null) {
- String[] extensions = ini.getExtensions();
- if (extensions!=null) {
- for (String module:extensions) {
- if
(module.toLowerCase().contains(ext_name)) {
- map.put(ext_name, true);
- return true;
- }
- }
- }
- }
- for (String module:getExtensionList(cm, host, ini)) {
- if (module.toLowerCase().contains(ext_name)) {
- map.put(ext_name, true);
+ String[] available_extensions = getLoadableExtensionList(cm,
host, ini);
+ for (String available_ext_name:available_extensions)
+ // cache as FOUND for next time
+ map.put(available_ext_name, Boolean.TRUE);
+
+ for (String available_ext_name:available_extensions) {
+ if (ext_name.equals(available_ext_name))
return true;
- }
}
- map.put(ext_name, false);
+ // cache as NOT FOUND
+ map.put(ext_name, Boolean.FALSE);
return false;
} // end public boolean isExtensionEnabled
@@ -782,8 +774,8 @@ public class PhpBuild extends SAPIManager {
}
} // end public static class PHPOutput
- public String[] getExtensionList(ConsoleManager cm, AHost host,
ESAPIType type) throws Exception {
- return getExtensionList(cm, host, getDefaultPhpIni(cm, host,
type));
+ public String[] getLoadableExtensionList(ConsoleManager cm, AHost host,
ESAPIType type) throws Exception {
+ return getLoadableExtensionList(cm, host, getDefaultPhpIni(cm,
host, type));
}
/** gets the static builtin extensions for this build build and the
dynamic extensions the
@@ -798,29 +790,28 @@ public class PhpBuild extends SAPIManager {
* @param ini
* @return
* @throws Exception
+ * @see PhpIni#getEnabledExtensions
*/
- public String[] getExtensionList(ConsoleManager cm, AHost host, PhpIni
ini) throws Exception {
- String[] module_list;
- if (this.module_list!=null) {
- module_list = this.module_list.get();
- if (module_list!=null)
- return module_list;
- }
+ public String[] getLoadableExtensionList(ConsoleManager cm, AHost host,
PhpIni ini) throws Exception {
+ String[] module_list = ext_available_map.get(ini);
+ if (module_list!=null)
+ return module_list;
String ini_settings = ini==null?null:ini.toCliArgString(host);
- ExecOutput output =
host.execOut(php_exe+(ini_settings==null?"":" "+ini_settings)+" -m",
Host.ONE_MINUTE);
+ String php_cmd = php_exe+(ini_settings==null?"":"
"+ini_settings)+" -m";
+ ExecOutput output = host.execOut(php_cmd, Host.ONE_MINUTE);
output.printOutputIfCrash(Host.toContext(getClass(),
"getExtensionList"), cm);
ArrayList<String> list = new ArrayList<String>();
for (String module : output.getLines()) {
- if (!module.startsWith("[") && module.length() > 0)
+ if (!module.startsWith("[") &&
!module.contains("Unknown") && !module.contains("Warning") && module.length() >
0)
list.add(module.toLowerCase());
}
module_list = (String[]) list.toArray(new String[list.size()]);
- this.module_list = new SoftReference<String[]>(module_list);
+ ext_available_map.put(ini, module_list);
return module_list;
}
diff --git a/src/com/mostc/pftt/model/core/PhpIni.java
b/src/com/mostc/pftt/model/core/PhpIni.java
index 9210a5d..fb0803b 100644
--- a/src/com/mostc/pftt/model/core/PhpIni.java
+++ b/src/com/mostc/pftt/model/core/PhpIni.java
@@ -281,6 +281,12 @@ public class PhpIni {
* @see #setExtensionDir
*/
public void putSingle(String directive, String value) {
+ doPutSingle(directive, value);
+ }
+
+ protected void doPutSingle(String directive, String value) {
+ if (value==null)
+ value = "";
ArrayList<String> values = new ArrayList<String>(1);
values.add(value);
ini_map.put(directive, values);
@@ -304,9 +310,14 @@ public class PhpIni {
public void putMulti(String directive, String value) {
ArrayList<String> values = ini_map.get(directive);
if (values==null) {
+ if (value==null)
+ value = "";
values = new ArrayList<String>(1);
values.add(value);
ini_map.put(directive, values);
+ } else if (value==null) {
+ // allow at most 1 blank value
+ return;
} else if (!values.contains(value)) {
values.add(value);
}
@@ -368,7 +379,7 @@ public class PhpIni {
* @return
*/
@Nullable
- public String[] getExtensions() {
+ public String[] getEnabledExtensions() {
return getMulti(EXTENSION);
}
@@ -531,7 +542,7 @@ public class PhpIni {
this.ext_ini = ext_ini.ext_ini = new
SoftReference<PhpIni>(ext_ini);
String ext_dir = get(EXTENSION_DIR);
if (ext_dir!=null)
- ext_ini.putSingle(EXTENSION_DIR, ext_dir);
+ ext_ini.doPutSingle(EXTENSION_DIR, ext_dir);
ArrayList<String> values = ini_map.get(EXTENSION);
if (values!=null)
ext_ini.ini_map.put(EXTENSION,
(ArrayList<String>)values.clone());
@@ -555,23 +566,24 @@ public class PhpIni {
//
StringBuilder sb = new StringBuilder(256);
for ( String directive : getDirectives()) {
- String value = get(directive);
- if (value==null)
- continue; // allow "" empty values though
-
- // CRITICAL: escape these characters in the INI
- value = StringUtil.replaceAll(PAT_bs, "\\\\\"",
StringUtil.replaceAll(PAT_amp, "\\\\&", StringUtil.replaceAll(PAT_pipe,
"\\\\|", value)));
-
- // CRITICAL: in a windows batch script % is replaced
with the command to execute.
- // need to escape this value.
- if (host.isWindows())
- value = StringUtil.replaceAll(PAT_per,
"\\%\\%", value);
-
- sb.append(" -d \"");
- sb.append(directive);
- sb.append("=");
- sb.append(value);
- sb.append("\"");
+ for ( String value : getMulti(directive) ) {
+ if (value==null)
+ continue; // allow "" empty values
though
+
+ // CRITICAL: escape these characters in the INI
+ value = StringUtil.replaceAll(PAT_bs, "\\\\\"",
StringUtil.replaceAll(PAT_amp, "\\\\&", StringUtil.replaceAll(PAT_pipe,
"\\\\|", value)));
+
+ // CRITICAL: in a windows batch script % is
replaced with the command to execute.
+ // need to escape this value.
+ if (host.isWindows())
+ value = StringUtil.replaceAll(PAT_per,
"\\%\\%", value);
+
+ sb.append(" -d \"");
+ sb.append(directive);
+ sb.append("=");
+ sb.append(value);
+ sb.append("\"");
+ }
}
String cli_arg_str = sb.toString();
cli_arg = new SoftReference<String>(cli_arg_str);
diff --git a/src/com/mostc/pftt/model/core/ReadOnlyPhpIni.java
b/src/com/mostc/pftt/model/core/ReadOnlyPhpIni.java
index b056707..5a00101 100644
--- a/src/com/mostc/pftt/model/core/ReadOnlyPhpIni.java
+++ b/src/com/mostc/pftt/model/core/ReadOnlyPhpIni.java
@@ -9,15 +9,19 @@ package com.mostc.pftt.model.core;
*/
public class ReadOnlyPhpIni extends PhpIni {
+ @Override
public void putSingle(String directive, String value) {
}
+ @Override
public void putMulti(String directive, String value) {
}
+ @Override
public void replaceAll(PhpIni ini) {
}
+ @Override
public void remove(String directive) {
}
diff --git a/src/com/mostc/pftt/model/smoke/RequiredExtensionsSmokeTest.java
b/src/com/mostc/pftt/model/smoke/RequiredExtensionsSmokeTest.java
index b9aee73..2321200 100644
--- a/src/com/mostc/pftt/model/smoke/RequiredExtensionsSmokeTest.java
+++ b/src/com/mostc/pftt/model/smoke/RequiredExtensionsSmokeTest.java
@@ -3,12 +3,12 @@ package com.mostc.pftt.model.smoke;
import com.github.mattficken.io.StringUtil;
import com.mostc.pftt.host.AHost;
import com.mostc.pftt.host.Host;
-import com.mostc.pftt.model.core.EBuildBranch;
import com.mostc.pftt.model.core.ESAPIType;
import com.mostc.pftt.model.core.PhpBuild;
import com.mostc.pftt.model.core.PhpIni;
import com.mostc.pftt.results.ConsoleManager;
import com.mostc.pftt.results.EPrintType;
+import com.mostc.pftt.results.PhpResultPackWriter;
/** Smoke test that verifies a PHP Build has all the required extensions.
*
@@ -83,20 +83,28 @@ public class RequiredExtensionsSmokeTest extends SmokeTest {
"zlib"
};
- public ESmokeTestStatus test(PhpBuild build, ConsoleManager cm, AHost
host, ESAPIType type) {
+ public ESmokeTestStatus test(PhpBuild build, ConsoleManager cm, AHost
host, ESAPIType type, PhpResultPackWriter tmgr) {
if (!host.isWindows())
// non-Windows PHP builds can have whatever extensions
they want
return ESmokeTestStatus.XSKIP;
try {
// Windows PHP builds must have these extensions to
pass this test
+ ESmokeTestStatus status = ESmokeTestStatus.PASS;
+ StringBuilder out = new StringBuilder();
for ( String ext_name : windows_required_extensions ) {
// this will timeout in .DLL is missing on
Windows - must fail test in that case
if (!build.isExtensionEnabled(cm, host, type,
ext_name)) {
+ out.append("Missing Required Extension:
"+ext_name);
+ out.append('\n');
cm.println(EPrintType.COMPLETED_OPERATION, getName(), "Missing Required
Extension: "+ext_name);
- return ESmokeTestStatus.FAIL;
+ status = ESmokeTestStatus.FAIL;
+ // continue checking all extensions
}
}
- return ESmokeTestStatus.PASS;
+ if (status==ESmokeTestStatus.FAIL)
+ tmgr.notifyFailedSmokeTest(getName(),
out.toString());
+
+ return status;
} catch ( Exception ex ) {
cm.addGlobalException(EPrintType.CANT_CONTINUE,
getClass(), "test", ex, "");
return ESmokeTestStatus.INTERNAL_EXCEPTION;
diff --git a/src/com/mostc/pftt/model/smoke/RequiredFeaturesSmokeTest.java
b/src/com/mostc/pftt/model/smoke/RequiredFeaturesSmokeTest.java
index 9c122c0..6d21719 100644
--- a/src/com/mostc/pftt/model/smoke/RequiredFeaturesSmokeTest.java
+++ b/src/com/mostc/pftt/model/smoke/RequiredFeaturesSmokeTest.java
@@ -4,6 +4,7 @@ import com.mostc.pftt.host.AHost;
import com.mostc.pftt.model.core.PhpBuild;
import com.mostc.pftt.results.ConsoleManager;
import com.mostc.pftt.results.EPrintType;
+import com.mostc.pftt.results.PhpResultPackWriter;
/** tests that a build has all required features
*
@@ -1196,7 +1197,7 @@ public class RequiredFeaturesSmokeTest extends SmokeTest {
nts_parts = required_nts_features_str.split("%s");
} // end static
- public ESmokeTestStatus test(PhpBuild build, ConsoleManager cm, AHost
host) {
+ public ESmokeTestStatus test(PhpBuild build, ConsoleManager cm, AHost
host, PhpResultPackWriter tmgr) {
if (!host.isWindows())
return ESmokeTestStatus.XSKIP;
@@ -1210,15 +1211,20 @@ public class RequiredFeaturesSmokeTest extends
SmokeTest {
String info = build.getPhpInfo(cm, host);
int i = 0, j;
ESmokeTestStatus status = ESmokeTestStatus.PASS;
+ StringBuilder out = new StringBuilder();
for ( String part : parts ) {
j = info.indexOf(part, i);
if (j==-1) {
cm.println(EPrintType.COMPLETED_OPERATION, getName(), "Missing required info:
`"+part+"`");
+ out.append("Missing required info:
`"+part+"`");
+ out.append('\n');
status = ESmokeTestStatus.FAIL;
} else {
i = j+1;
}
}
+ if (status==ESmokeTestStatus.FAIL)
+ tmgr.notifyFailedSmokeTest(getName(),
out.toString());
return status;
} catch ( Exception ex ) {
cm.addGlobalException(EPrintType.CANT_CONTINUE,
getClass(), "test", ex, "");
diff --git a/src/com/mostc/pftt/results/LocalConsoleManager.java
b/src/com/mostc/pftt/results/LocalConsoleManager.java
index 686e0f6..6345884 100644
--- a/src/com/mostc/pftt/results/LocalConsoleManager.java
+++ b/src/com/mostc/pftt/results/LocalConsoleManager.java
@@ -27,6 +27,7 @@ import com.mostc.pftt.util.ErrorUtil;
public class LocalConsoleManager implements ConsoleManager {
protected final boolean overwrite, debug_all, results_only, show_gui,
disable_debug_prompt, dont_cleanup_test_pack, phpt_not_in_place, pftt_debug,
no_result_file_for_pass_xskip_skip, randomize_order, thread_safety,
skip_smoke_tests, restart_each_test_all, no_restart_all, ini_actual_all;
protected final int run_test_times_all, run_test_pack,
run_test_times_list_times, run_group_times, run_group_times_list_times,
max_test_read_count, thread_count, delay_between_ms, suspend_seconds, run_count;
+ protected final long max_run_time_millis;
protected String source_pack;
protected PhpDebugPack debug_pack;
protected PhptDebuggerFrame phpt_gui;
@@ -35,10 +36,10 @@ public class LocalConsoleManager implements ConsoleManager {
protected List<String> debug_list, run_test_times_list,
run_group_times_list, skip_list;
public LocalConsoleManager() {
- this(null, null, false, false, false, false, true, false, true,
false, true, false, 1, 1, true, 1, 1, 1, null, null, null, null, true, 0, 0,
false, false, 0, 0, 0, false);
+ this(null, null, false, false, false, false, true, false, true,
false, true, false, 1, 1, true, 1, 1, 1, null, null, null, null, false, 0, 0,
false, false, 0, 0, 0, false, 0);
}
- public LocalConsoleManager(String source_pack, PhpDebugPack debug_pack,
boolean overwrite, boolean debug_all, boolean results_only, boolean show_gui,
boolean disable_debug_prompt, boolean dont_cleanup_test_pack, boolean
phpt_not_in_place, boolean pftt_debug, boolean
no_result_file_for_pass_xskip_skip, boolean randomize_order, int
run_test_times_all, int run_test_pack, boolean thread_safety, int
run_test_times_list_times, int run_group_times, int run_group_times_list_times,
List<String> debug_list, List<String> run_test_times_list, List<String>
run_group_times_list, List<String> skip_list, boolean skip_smoke_tests, int
max_test_read_count, int thread_count, boolean restart_each_test_all, boolean
no_restart_all, int delay_between_ms, int run_count, int suspend_seconds,
boolean ini_actual_all) {
+ public LocalConsoleManager(String source_pack, PhpDebugPack debug_pack,
boolean overwrite, boolean debug_all, boolean results_only, boolean show_gui,
boolean disable_debug_prompt, boolean dont_cleanup_test_pack, boolean
phpt_not_in_place, boolean pftt_debug, boolean
no_result_file_for_pass_xskip_skip, boolean randomize_order, int
run_test_times_all, int run_test_pack, boolean thread_safety, int
run_test_times_list_times, int run_group_times, int run_group_times_list_times,
List<String> debug_list, List<String> run_test_times_list, List<String>
run_group_times_list, List<String> skip_list, boolean skip_smoke_tests, int
max_test_read_count, int thread_count, boolean restart_each_test_all, boolean
no_restart_all, int delay_between_ms, int run_count, int suspend_seconds,
boolean ini_actual_all, long max_run_time_millis) {
this.source_pack = source_pack;
this.debug_pack = debug_pack;
this.overwrite = overwrite;
@@ -70,6 +71,7 @@ public class LocalConsoleManager implements ConsoleManager {
this.run_count = run_count;
this.suspend_seconds = suspend_seconds;
this.ini_actual_all = ini_actual_all;
+ this.max_run_time_millis = max_run_time_millis;
}
public void showGUI(LocalPhptTestPackRunner test_pack_runner) {
@@ -396,5 +398,10 @@ public class LocalConsoleManager implements ConsoleManager
{
public boolean isGetActualIniAll() {
return ini_actual_all;
}
+
+ @Override
+ public long getMaxRunTimeMillis() {
+ return max_run_time_millis;
+ }
} // end public class ConsoleManager
diff --git a/src/com/mostc/pftt/results/PhpResultPackWriter.java
b/src/com/mostc/pftt/results/PhpResultPackWriter.java
index 2aedc7a..7075bc9 100644
--- a/src/com/mostc/pftt/results/PhpResultPackWriter.java
+++ b/src/com/mostc/pftt/results/PhpResultPackWriter.java
@@ -1024,5 +1024,20 @@ public class PhpResultPackWriter extends PhpResultPack
implements ITestResultRec
out.add(s.getScenarioSet());
return out;
}
+
+ public void notifyFailedSmokeTest(String name, String output) {
+ try {
+ FileWriter fw = new FileWriter(new File(telem_dir,
"SMOKE"), true); // append
+ PrintWriter pw = new PrintWriter(fw);
+ pw.println(name);
+ fw.close();
+
+ fw = new FileWriter(new File(telem_dir, "SMOKE_"+name));
+ fw.write(output);
+ fw.close();
+ } catch ( Exception ex ) {
+ ex.printStackTrace();
+ }
+ }
} // end public class PhpResultPackWriter
--
PHP Quality Assurance Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php