From 1a66c3bf75df818a9ece62eba96e2eb3f7726138 Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Wed, 14 Aug 2019 18:13:08 -0700 Subject: tests: Don't include "config.h" in installed files These tests get installed, so config.h may not be available. Do the same thing that gimarshallingtests.c and regress.c already do, and include config.h conditionally. --- tests/scanner/Regress-1.0-expected.gir | 306 ++++++++++++++++----------------- tests/scanner/Utility-1.0-expected.gir | 2 +- tests/scanner/WarnLib-1.0-expected.gir | 18 +- tests/scanner/annotation.c | 4 + tests/scanner/drawable.c | 4 + tests/scanner/foo.c | 3 + tests/scanner/utility.c | 4 + tests/scanner/warnlib.c | 3 + 8 files changed, 181 insertions(+), 163 deletions(-) diff --git a/tests/scanner/Regress-1.0-expected.gir b/tests/scanner/Regress-1.0-expected.gir index 949df37b..a589b82c 100644 --- a/tests/scanner/Regress-1.0-expected.gir +++ b/tests/scanner/Regress-1.0-expected.gir @@ -251,14 +251,14 @@ and/or use gtk-doc annotations. --> %NULL always + line="572">%NULL always a #GObject + line="569">a #GObject c:identifier="regress_annotation_object_calleeowns"> This is a test for out arguments; GObject defaults to transfer + line="296">This is a test for out arguments; GObject defaults to transfer an int + line="303">an int a #GObject + line="298">a #GObject transfer-ownership="full"> a #GObject + line="299">a #GObject @@ -303,19 +303,19 @@ and/or use gtk-doc annotations. --> c:identifier="regress_annotation_object_calleesowns"> This is a test for out arguments, one transferred, other not + line="312">This is a test for out arguments, one transferred, other not an int + line="320">an int a #GObject + line="314">a #GObject transfer-ownership="full"> a #GObject + line="315">a #GObject transfer-ownership="none"> a #GObject + line="316">a #GObject @@ -342,7 +342,7 @@ and/or use gtk-doc annotations. --> c:identifier="regress_annotation_object_compute_sum"> Test taking a zero-terminated array + line="422">Test taking a zero-terminated array @@ -351,13 +351,13 @@ and/or use gtk-doc annotations. --> a #GObject + line="424">a #GObject Sequence of numbers + line="425">Sequence of numbers @@ -368,7 +368,7 @@ and/or use gtk-doc annotations. --> c:identifier="regress_annotation_object_compute_sum_n"> Test taking an array with length parameter + line="436">Test taking an array with length parameter @@ -377,13 +377,13 @@ and/or use gtk-doc annotations. --> a #GObject + line="438">a #GObject Sequence of + line="439">Sequence of numbers that are zero-terminated @@ -392,7 +392,7 @@ and/or use gtk-doc annotations. --> Length of number array + line="441">Length of number array @@ -401,7 +401,7 @@ and/or use gtk-doc annotations. --> c:identifier="regress_annotation_object_compute_sum_nz"> Test taking a zero-terminated array with length parameter + line="453">Test taking a zero-terminated array with length parameter @@ -410,13 +410,13 @@ and/or use gtk-doc annotations. --> a #RegressAnnotationObject + line="455">a #RegressAnnotationObject Sequence of numbers that + line="456">Sequence of numbers that are zero-terminated @@ -425,7 +425,7 @@ are zero-terminated Length of number array + line="458">Length of number array @@ -434,19 +434,19 @@ are zero-terminated c:identifier="regress_annotation_object_create_object"> Test returning a caller-owned object + line="396">Test returning a caller-owned object The object + line="402">The object a #GObject + line="398">a #GObject @@ -460,14 +460,14 @@ are zero-terminated %NULL always + line="597">%NULL always a #GObject + line="595">a #GObject @@ -488,7 +488,7 @@ are zero-terminated Test taking a call-scoped callback + line="502">Test taking a call-scoped callback @@ -497,7 +497,7 @@ are zero-terminated a #RegressAnnotationObject + line="504">a #RegressAnnotationObject closure="1"> Callback to invoke + line="505">Callback to invoke @@ -516,7 +516,7 @@ are zero-terminated allow-none="1"> Callback user data + line="506">Callback user data @@ -525,13 +525,13 @@ are zero-terminated c:identifier="regress_annotation_object_get_hash"> This is a test for returning a hash table mapping strings to + line="349">This is a test for returning a hash table mapping strings to objects. hash table + line="356">hash table @@ -541,7 +541,7 @@ objects. a #GObject + line="351">a #GObject @@ -550,14 +550,14 @@ objects. c:identifier="regress_annotation_object_get_objects"> This is a test for returning a list of objects. + line="378">This is a test for returning a list of objects. The list itself should be freed, but not the internal objects, intentionally similar example to gtk_container_get_children list of objects + line="386">list of objects @@ -566,7 +566,7 @@ intentionally similar example to gtk_container_get_children a #GObject + line="380">a #GObject @@ -575,13 +575,13 @@ intentionally similar example to gtk_container_get_children c:identifier="regress_annotation_object_get_strings"> This is a test for returning a list of strings, where + line="331">This is a test for returning a list of strings, where each string needs to be freed. list of strings + line="338">list of strings @@ -590,7 +590,7 @@ each string needs to be freed. a #GObject + line="333">a #GObject @@ -605,7 +605,7 @@ each string needs to be freed. A #RegressAnnotationObject + line="641">A #RegressAnnotationObject @@ -613,25 +613,25 @@ each string needs to be freed. This is a test for in arguments + line="232">This is a test for in arguments an int + line="239">an int a #GObject + line="234">a #GObject This is an argument test + line="235">This is an argument test @@ -639,19 +639,19 @@ each string needs to be freed. This is a test for out arguments + line="248">This is a test for out arguments an int + line="255">an int a #GObject + line="250">a #GObject transfer-ownership="full"> This is an argument test + line="251">This is an argument test @@ -668,19 +668,19 @@ each string needs to be freed. This is a second test for out arguments + line="263">This is a second test for out arguments an int + line="270">an int a #GObject + line="265">a #GObject transfer-ownership="full"> This is an argument test + line="266">This is an argument test @@ -697,19 +697,19 @@ each string needs to be freed. This is a 3th test for out arguments + line="279">This is a 3th test for out arguments an int + line="286">an int a #GObject + line="281">a #GObject allow-none="1"> This is an argument test + line="282">This is an argument test @@ -730,14 +730,14 @@ each string needs to be freed. an int + line="208">an int a #GObject + line="206">a #GObject @@ -747,14 +747,14 @@ each string needs to be freed. An object, not referenced + line="584">An object, not referenced a #GObject + line="582">a #GObject @@ -762,19 +762,19 @@ each string needs to be freed. This is a test for out arguments + line="216">This is a test for out arguments an int + line="223">an int a #GObject + line="218">a #GObject transfer-ownership="full"> This is an argument test + line="219">This is an argument test @@ -792,7 +792,7 @@ each string needs to be freed. c:identifier="regress_annotation_object_parse_args"> Test taking a zero-terminated array with length parameter + line="470">Test taking a zero-terminated array with length parameter @@ -801,7 +801,7 @@ each string needs to be freed. a #RegressAnnotationObject + line="472">a #RegressAnnotationObject transfer-ownership="full"> Length of the argument vector + line="473">Length of the argument vector transfer-ownership="full"> Argument vector + line="474">Argument vector @@ -830,7 +830,7 @@ each string needs to be freed. c:identifier="regress_annotation_object_set_data"> Test taking a guchar * with a length. + line="518">Test taking a guchar * with a length. @@ -839,13 +839,13 @@ each string needs to be freed. a #RegressAnnotationObject + line="520">a #RegressAnnotationObject The data + line="521">The data @@ -853,7 +853,7 @@ each string needs to be freed. Length of the data + line="522">Length of the data @@ -862,7 +862,7 @@ each string needs to be freed. c:identifier="regress_annotation_object_set_data2"> Test taking a gchar * with a length. + line="534">Test taking a gchar * with a length. @@ -871,13 +871,13 @@ each string needs to be freed. a #RegressAnnotationObject + line="536">a #RegressAnnotationObject The data + line="537">The data @@ -885,7 +885,7 @@ each string needs to be freed. Length of the data + line="538">Length of the data @@ -894,7 +894,7 @@ each string needs to be freed. c:identifier="regress_annotation_object_set_data3"> Test taking a gchar * with a length, overriding the array element + line="550">Test taking a gchar * with a length, overriding the array element type. @@ -904,13 +904,13 @@ type. a #RegressAnnotationObject + line="552">a #RegressAnnotationObject The data + line="553">The data @@ -918,7 +918,7 @@ type. Length of the data + line="554">Length of the data @@ -927,19 +927,19 @@ type. c:identifier="regress_annotation_object_string_out"> Test returning a string as an out parameter + line="486">Test returning a string as an out parameter some boolean + line="493">some boolean a #RegressAnnotationObject + line="488">a #RegressAnnotationObject transfer-ownership="full"> string return value + line="489">string return value @@ -963,7 +963,7 @@ type. a #GObject + line="412">a #GObject @@ -977,7 +977,7 @@ type. introspectable="0"> This is here just for the sake of being overriden by its + line="606">This is here just for the sake of being overriden by its regress_annotation_object_watch_full(). @@ -987,13 +987,13 @@ regress_annotation_object_watch_full(). A #RegressAnnotationObject + line="608">A #RegressAnnotationObject The callback + line="609">The callback @@ -1003,7 +1003,7 @@ regress_annotation_object_watch_full(). allow-none="1"> The callback data + line="610">The callback data @@ -1013,7 +1013,7 @@ regress_annotation_object_watch_full(). shadows="watch"> Test overriding via the "Rename To" annotation. + line="622">Test overriding via the "Rename To" annotation. @@ -1022,7 +1022,7 @@ regress_annotation_object_watch_full(). A #RegressAnnotationObject + line="624">A #RegressAnnotationObject destroy="2"> The callback + line="625">The callback @@ -1042,13 +1042,13 @@ regress_annotation_object_watch_full(). allow-none="1"> The callback data + line="626">The callback data Destroy notification + line="627">Destroy notification @@ -1069,7 +1069,7 @@ regress_annotation_object_watch_full(). allow-none="1"> Opaque pointer handle + line="370">Opaque pointer handle @@ -1089,7 +1089,7 @@ regress_annotation_object_watch_full(). transfer-ownership="none"> This is a property which is a string + line="156">This is a property which is a string Use better-string-property instead @@ -1100,7 +1100,7 @@ regress_annotation_object_watch_full(). transfer-ownership="none"> This is a property annotation intentionally indented with a mix + line="181">This is a property annotation intentionally indented with a mix of tabs and strings to test the tab handling capabilities of the scanner. @@ -1110,12 +1110,12 @@ of tabs and strings to test the tab handling capabilities of the scanner. This signal tests a signal with attributes. + line="134">This signal tests a signal with attributes. the return value + line="142">the return value @@ -1123,14 +1123,14 @@ of tabs and strings to test the tab handling capabilities of the scanner. a value + line="137">a value another value + line="138">another value @@ -1138,7 +1138,7 @@ of tabs and strings to test the tab handling capabilities of the scanner. This signal tests an empty document argument (@arg1) + line="118">This signal tests an empty document argument (@arg1) @@ -1154,7 +1154,7 @@ of tabs and strings to test the tab handling capabilities of the scanner. This is a signal which takes a list of strings, but it's not + line="101">This is a signal which takes a list of strings, but it's not known by GObject as it's only marked as G_TYPE_POINTER @@ -1163,7 +1163,7 @@ known by GObject as it's only marked as G_TYPE_POINTER a list of strings + line="104">a list of strings @@ -1177,7 +1177,7 @@ known by GObject as it's only marked as G_TYPE_POINTER deprecated-version="1.2"> This is a signal which has a broken signal handler, + line="81">This is a signal which has a broken signal handler, it says it's pointer but it's actually a string. Use other-signal instead @@ -1187,7 +1187,7 @@ it says it's pointer but it's actually a string. a string + line="84">a string @@ -1865,13 +1865,13 @@ it says it's pointer but it's actually a string. c:identifier="regress_foo_object_get_default"> This function is intended to match clutter_stage_get_default which + line="330">This function is intended to match clutter_stage_get_default which uses a C sugar return type. The global #RegressFooSubobject + line="336">The global #RegressFooSubobject @@ -1885,22 +1885,22 @@ uses a C sugar return type. Read some stuff. + line="291">Read some stuff. - obj + obj - offset + offset - length + length @@ -1923,7 +1923,7 @@ uses a C sugar return type. c:identifier="regress_foo_object_append_new_stack_layer"> This shouldn't be scanned as a constructor. + line="779">This shouldn't be scanned as a constructor. @@ -1954,14 +1954,14 @@ uses a C sugar return type. %NULL always + line="240">%NULL always a #RegressFooObject + line="238">a #RegressFooObject @@ -2012,7 +2012,7 @@ uses a C sugar return type. introspectable="0"> Not sure why this test is here... + line="266">Not sure why this test is here... @@ -2029,22 +2029,22 @@ uses a C sugar return type. Read some stuff. + line="291">Read some stuff. - obj + obj - offset + offset - length + length @@ -2054,14 +2054,14 @@ uses a C sugar return type. introspectable="0"> This is only useful from C. + line="305">This is only useful from C. - obj + obj @@ -2187,19 +2187,19 @@ uses a C sugar return type. - obj + obj offset + line="294">offset length + line="295">length @@ -2252,13 +2252,13 @@ uses a C sugar return type. transfer-ownership="full"> add to this rect + line="559">add to this rect source rectangle + line="560">source rectangle @@ -2268,7 +2268,7 @@ uses a C sugar return type. introspectable="0"> This is a C convenience constructor; we have to (skip) + line="540">This is a C convenience constructor; we have to (skip) it because it's not a boxed type. @@ -5654,14 +5654,14 @@ the introspection client langage. The return value. + line="768">The return value. A #RegressAnnotationObject. + line="765">A #RegressAnnotationObject. @@ -5669,7 +5669,7 @@ the introspection client langage. Some data. + line="766">Some data. @@ -5678,7 +5678,7 @@ the introspection client langage. c:identifier="regress_annotation_custom_destroy"> Test messing up the heuristic of closure/destroy-notification + line="719">Test messing up the heuristic of closure/destroy-notification detection, and fixing it via annotations. @@ -5692,7 +5692,7 @@ detection, and fixing it via annotations. destroy="1"> Destroy notification + line="721">Destroy notification Source file + line="736">Source file @@ -5732,7 +5732,7 @@ detection, and fixing it via annotations. transfer-ownership="full"> The number of args. + line="650">The number of args. transfer-ownership="full"> The arguments. + line="651">The arguments. @@ -5758,7 +5758,7 @@ detection, and fixing it via annotations. some text (e.g. example) or else + line="779">some text (e.g. example) or else @@ -5773,7 +5773,7 @@ detection, and fixing it via annotations. the array + line="756">the array @@ -5786,7 +5786,7 @@ detection, and fixing it via annotations. The return value + line="663">The return value @@ -5798,7 +5798,7 @@ detection, and fixing it via annotations. transfer-ownership="full"> Number of return values + line="661">Number of return values @@ -5809,7 +5809,7 @@ detection, and fixing it via annotations. An annotated filename + line="818">An annotated filename @@ -5823,7 +5823,7 @@ detection, and fixing it via annotations. Source file + line="746">Source file @@ -5832,7 +5832,7 @@ detection, and fixing it via annotations. c:identifier="regress_annotation_space_after_comment_bug631690"> Explicitly test having a space after the ** here. + line="805">Explicitly test having a space after the ** here. @@ -5861,7 +5861,7 @@ detection, and fixing it via annotations. The return value + line="674">The return value @@ -5888,12 +5888,12 @@ detection, and fixing it via annotations. c:identifier="regress_annotation_test_parsing_bug630862"> See https://bugzilla.gnome.org/show_bug.cgi?id=630862 + line="791">See https://bugzilla.gnome.org/show_bug.cgi?id=630862 An object, note the colon:in here + line="796">An object, note the colon:in here @@ -5903,14 +5903,14 @@ detection, and fixing it via annotations. A floating object + line="830">A floating object an object + line="828">an object @@ -6060,7 +6060,7 @@ detection, and fixing it via annotations. c:identifier="regress_foo_not_a_constructor_new"> This should be scanned as a top-level function, and shouldn't cause + line="792">This should be scanned as a top-level function, and shouldn't cause a "Can't find matching type for constructor" warning. @@ -6073,7 +6073,7 @@ a "Can't find matching type for constructor" warning. introspectable="0"> This is a C convenience constructor; we have to (skip) + line="540">This is a C convenience constructor; we have to (skip) it because it's not a boxed type. @@ -6099,7 +6099,7 @@ it because it's not a boxed type. introspectable="0"> Does something that's only interesting from C and should not be + line="719">Does something that's only interesting from C and should not be exposed to language bindings. @@ -6109,7 +6109,7 @@ exposed to language bindings. a #RegressFooSkippable + line="721">a #RegressFooSkippable diff --git a/tests/scanner/Utility-1.0-expected.gir b/tests/scanner/Utility-1.0-expected.gir index 5972d328..81ac436a 100644 --- a/tests/scanner/Utility-1.0-expected.gir +++ b/tests/scanner/Utility-1.0-expected.gir @@ -21,7 +21,7 @@ and/or use gtk-doc annotations. --> - the data + the data diff --git a/tests/scanner/WarnLib-1.0-expected.gir b/tests/scanner/WarnLib-1.0-expected.gir index b7f47997..62290cc3 100644 --- a/tests/scanner/WarnLib-1.0-expected.gir +++ b/tests/scanner/WarnLib-1.0-expected.gir @@ -50,7 +50,7 @@ and/or use gtk-doc annotations. --> Does boo. + line="38">Does boo. @@ -59,13 +59,13 @@ and/or use gtk-doc annotations. --> a WarnLibWhatever + line="40">a WarnLibWhatever x parameter + line="41">x parameter allow-none="1"> y parameter + line="42">y parameter @@ -102,7 +102,7 @@ and/or use gtk-doc annotations. --> Does boo. + line="38">Does boo. @@ -111,7 +111,7 @@ and/or use gtk-doc annotations. --> a WarnLibWhatever + line="40">a WarnLibWhatever @@ -185,13 +185,13 @@ and/or use gtk-doc annotations. --> a WarnLibWhatever + line="40">a WarnLibWhatever x parameter + line="41">x parameter allow-none="1"> y parameter + line="42">y parameter diff --git a/tests/scanner/annotation.c b/tests/scanner/annotation.c index fb8b48f4..253dbd6a 100644 --- a/tests/scanner/annotation.c +++ b/tests/scanner/annotation.c @@ -1,5 +1,9 @@ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ + +/* This file gets installed, so we can't assume config.h is available */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include "annotation.h" diff --git a/tests/scanner/drawable.c b/tests/scanner/drawable.c index 9c58bfed..b4a3ddc0 100644 --- a/tests/scanner/drawable.c +++ b/tests/scanner/drawable.c @@ -1,5 +1,9 @@ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ + +/* This file gets installed, so we can't assume config.h is available */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include "drawable.h" diff --git a/tests/scanner/foo.c b/tests/scanner/foo.c index 2fc8ed9e..19bf848b 100644 --- a/tests/scanner/foo.c +++ b/tests/scanner/foo.c @@ -1,4 +1,7 @@ +/* This file gets installed, so we can't assume config.h is available */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include "foo.h" diff --git a/tests/scanner/utility.c b/tests/scanner/utility.c index c5e48a4e..3af374c1 100644 --- a/tests/scanner/utility.c +++ b/tests/scanner/utility.c @@ -1,5 +1,9 @@ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ + +/* This file gets installed, so we can't assume config.h is available */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include "utility.h" diff --git a/tests/scanner/warnlib.c b/tests/scanner/warnlib.c index 4b92bf66..430e88d2 100644 --- a/tests/scanner/warnlib.c +++ b/tests/scanner/warnlib.c @@ -1,6 +1,9 @@ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ +/* This file gets installed, so we can't assume config.h is available */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif #include "warnlib.h" -- cgit v1.2.1