diff options
Diffstat (limited to 'src/test/java/com/google/devtools/build/skydoc/testdata/attribute_types_test')
-rw-r--r-- | src/test/java/com/google/devtools/build/skydoc/testdata/attribute_types_test/golden.txt | 147 | ||||
-rw-r--r-- | src/test/java/com/google/devtools/build/skydoc/testdata/attribute_types_test/input.bzl | 22 |
2 files changed, 169 insertions, 0 deletions
diff --git a/src/test/java/com/google/devtools/build/skydoc/testdata/attribute_types_test/golden.txt b/src/test/java/com/google/devtools/build/skydoc/testdata/attribute_types_test/golden.txt new file mode 100644 index 0000000000..746e3fe229 --- /dev/null +++ b/src/test/java/com/google/devtools/build/skydoc/testdata/attribute_types_test/golden.txt @@ -0,0 +1,147 @@ +<a name="#my_rule"></a> +## my_rule + +<pre> +my_rule(name, a, b, c, d, e, f, g, h, i, j, k, l, m) +</pre> + +This is my rule. It does stuff. + +### Attributes + +<table class="params-table"> + <colgroup> + <col class="col-param" /> + <col class="col-description" /> + </colgroup> + <tbody> + <tr id="#my_rule_name"> + <td><code>name</code></td> + <td> + String; required + <p> + A unique name for this rule. + </p> + </td> + </tr> + <tr id="#my_rule_a"> + <td><code>a</code></td> + <td> + Boolean; required + <p> + Some bool + </p> + </td> + </tr> + <tr id="#my_rule_b"> + <td><code>b</code></td> + <td> + Integer; required + <p> + Some int + </p> + </td> + </tr> + <tr id="#my_rule_c"> + <td><code>c</code></td> + <td> + List of integers; required + <p> + Some int_list + </p> + </td> + </tr> + <tr id="#my_rule_d"> + <td><code>d</code></td> + <td> + Label; required + <p> + Some label + </p> + </td> + </tr> + <tr id="#my_rule_e"> + <td><code>e</code></td> + <td> + Dictionary: Label -> String; required + <p> + Some label_keyed_string_dict + </p> + </td> + </tr> + <tr id="#my_rule_f"> + <td><code>f</code></td> + <td> + List of labels; required + <p> + Some label_list + </p> + </td> + </tr> + <tr id="#my_rule_g"> + <td><code>g</code></td> + <td> + List of strings; optional + <p> + Some license + </p> + </td> + </tr> + <tr id="#my_rule_h"> + <td><code>h</code></td> + <td> + Label; optional + <p> + Some output + </p> + </td> + </tr> + <tr id="#my_rule_i"> + <td><code>i</code></td> + <td> + List of labels; optional + <p> + Some output_list + </p> + </td> + </tr> + <tr id="#my_rule_j"> + <td><code>j</code></td> + <td> + String; required + <p> + Some string + </p> + </td> + </tr> + <tr id="#my_rule_k"> + <td><code>k</code></td> + <td> + Dictionary: String -> String; required + <p> + Some string_dict + </p> + </td> + </tr> + <tr id="#my_rule_l"> + <td><code>l</code></td> + <td> + List of strings; required + <p> + Some string_list + </p> + </td> + </tr> + <tr id="#my_rule_m"> + <td><code>m</code></td> + <td> + Dictionary: String -> List of strings; optional + <p> + Some string_list_dict + </p> + </td> + </tr> + </tbody> +</table> + + diff --git a/src/test/java/com/google/devtools/build/skydoc/testdata/attribute_types_test/input.bzl b/src/test/java/com/google/devtools/build/skydoc/testdata/attribute_types_test/input.bzl new file mode 100644 index 0000000000..edcef5f043 --- /dev/null +++ b/src/test/java/com/google/devtools/build/skydoc/testdata/attribute_types_test/input.bzl @@ -0,0 +1,22 @@ +def my_rule_impl(ctx): + return struct() + +my_rule = rule( + implementation = my_rule_impl, + doc = "This is my rule. It does stuff.", + attrs = { + "a": attr.bool(mandatory = True, doc = "Some bool"), + "b": attr.int(mandatory = True, doc = "Some int"), + "c": attr.int_list(mandatory = True, doc = "Some int_list"), + "d": attr.label(mandatory = True, doc = "Some label"), + "e": attr.label_keyed_string_dict(mandatory = True, doc = "Some label_keyed_string_dict"), + "f": attr.label_list(mandatory = True, doc = "Some label_list"), + "g": attr.license(mandatory = False, doc = "Some license"), + "h": attr.output(mandatory = False, doc = "Some output"), + "i": attr.output_list(mandatory = False, doc = "Some output_list"), + "j": attr.string(mandatory = True, doc = "Some string"), + "k": attr.string_dict(mandatory = True, doc = "Some string_dict"), + "l": attr.string_list(mandatory = True, doc = "Some string_list"), + "m": attr.string_list_dict(mandatory = False, doc = "Some string_list_dict"), + }, +) |