-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathparse_tree_dot.php
More file actions
44 lines (36 loc) · 841 Bytes
/
Copy pathparse_tree_dot.php
File metadata and controls
44 lines (36 loc) · 841 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
/*
* phc -- the open source PHP compiler
* See doc/license/README.license for licensing information
*
* Unit test for dot output. Checks for syntax errors
*/
array_push($tests, new ParseTreeDot ());
class ParseTreeDot extends AsyncTest
{
function get_test_subjects ()
{
return get_all_scripts ();
}
function get_dependent_test_names ()
{
return array ("BasicParseTest");
}
function check_prerequisites ()
{
global $graphviz_gc;
return check_for_program ($graphviz_gc);
}
function run_test ($subject)
{
global $phc;
global $graphviz_gc;
$async = new AsyncBundle ($this, $subject);
$async->commands[0] = "$phc --dump-parse-tree $subject | $graphviz_gc";
// there is output. Dont fail.
$async->err_handlers[0] = "fail_on_output";
$async->final = "async_success";
$async->start ();
}
}
?>