Skip to content
Snippets Groups Projects
Commit 543758f6 authored by Janis Daniel Dähne's avatar Janis Daniel Dähne
Browse files

- updated some documentation

parent 78b66986
Branches
No related tags found
No related merge requests found
......@@ -106,7 +106,7 @@ function do_blackBoxTest($mainFileNameWithExtension, $test, $fullWorkingDirPath,
$pipesDescriptor = array(
0 => array('pipe', 'r'), # stdin is a pipe that the child will read from
1 => array('pipe', 'w'), # stdout is a pipe that the child will write to
2 => array("pipe", "w")
2 => array("pipe", "w") # stderr
);
......@@ -117,6 +117,9 @@ function do_blackBoxTest($mainFileNameWithExtension, $test, $fullWorkingDirPath,
# without bypass_shell it won't work on windows
$process = proc_open($longCmd, $pipesDescriptor, $pipes, NULL, NULL, array('bypass_shell' => TRUE));
// $state = proc_get_status($process);
// warn('open pid: ' . $state['pid']);
if (is_resource($process)) {
fwrite($pipes[0], $testContent);
fclose($pipes[0]);
......
......@@ -21,7 +21,7 @@ we change the dirs every changeDirIntervalInS s so in case some run is not fully
* The Server receives a request
* Check if all required parameters are set
* Check if max parallel tests are reached
* true: throw error
* true: throw error (send back error)
* Start a transaction (create a row in the db)
* Get the correct command to execute from the database (if needed)
* Execute the test
......@@ -174,7 +174,7 @@ the next lines contains the test results for every file
all other lines (meaning different by the first character):
* '**<**' indicating a line that was inputted to the users program
* '**>**' indicating a line that was read from the users program
* '**>***' indicating a line that was read from the users program but ignored (matches every user program output)
* '**>***' indicating a line that was read from the users program but matched anything (matches every user program output)
but needs at least the empty string System.out.println("")
* '**EOT**' indicates that the test ended here (written after the program terminated)
this is useful when some output is received after the test has finished
......@@ -489,10 +489,10 @@ Test content is an array of strings, the lines are NOT trimmed so all spaces are
If the first line with text starts with a '**$**' sign then the following text in this string are the console arguments that should be injected when the user program is called (escaping is the via "..." like in the normal shell/cmd).
* A line starting with a '**<**' in meant to be written to the user programs stdin (input stream), so input text starts at position 2 (position 1 is the **<**).
* A line starting with a '**>**' is expected to be outputted from the users program (stdout, output stream), so input text starts at position 2 (position 1 is the **>**).
* A line containing just a '**\***' is used as a wildcard that matches every output except no output (so the user program needs to output at least one character)
A line starting with a '**e**' interpreted as the expected program exit code, e.g. e5 would expect the user program to return 5
- A line starting with a '**<**' in meant to be written to the user programs stdin (input stream), so input text starts at position 2 (position 1 is the **<**).
- A line starting with a '**>**' is expected to be outputted from the users program (stdout, output stream), so input text starts at position 2 (position 1 is the **>**).
- A line containing just a '>*'' is used as a wildcard that matches every output except no output (so the user program needs to output at least one character)
- A line starting with a '**e**' interpreted as the expected program exit code, e.g. e5 would expect the user program to return 5
**Note**: Both **e** and **$** can slow down testing because we need two full iterations through the test content to check if there are lines with these starting strings (**$** needs to be the first line (the first line with text) the performance impact is not that big as **e**).
......
......@@ -11,7 +11,7 @@ include_once './sqlHelper.php';
* @param $config object the config to know the transaction table
* @param $rootDirName int the root dir of the current iteration (this could be used to remove old transactions in the future)
* @param $testType string the test type (just as info)
* @param $requestDistinctionString a unique string (MUST BE A VALID FILE NAME) to help the this server to separate two requests in case they arrive at the same time (and micro time would return the same value)
* @param $requestDistinctionString {string} unique string (MUST BE A VALID FILE NAME) to help the this server to separate two requests in case they arrive at the same time (and micro time would return the same value)
* @return int the timestamp used (to end/close the transaction)
*/
function startTransaction($conn, $config, $rootDirName, $testType, $requestDistinctionString)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment