public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Petri Latvala <petri.latvala@intel.com>
To: Lyude <lyude@redhat.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t] lib/tests/igt_describe: Use __FILE__ in JUST_C_OUTPUT and DESCRIBE_ALL_OUTPUT
Date: Fri, 20 Mar 2020 14:22:57 +0200	[thread overview]
Message-ID: <20200320122257.GT9497@platvala-desk.ger.corp.intel.com> (raw)
In-Reply-To: <20200316160452.29636-1-lyude@redhat.com>

On Mon, Mar 16, 2020 at 12:04:52PM -0400, Lyude wrote:
> From: Lyude Paul <lyude@redhat.com>
> 
> We currently manually specify the name of the source file by-hand here,
> however this causes problems if the user tries to build with compile
> flags like -fdebug-prefix-map since the source file names will then
> differ from what's hardcoded here - causing tests to fail.
> 
> So, fix that by using __FILE__ instead.
> 
> Signed-off-by: Lyude Paul <lyude@redhat.com>

This also fixes building when the build directory is not directly in
source root.


Reviewed-by: Petri Latvala <petri.latvala@intel.com>


> ---
>  lib/tests/igt_describe.c | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/lib/tests/igt_describe.c b/lib/tests/igt_describe.c
> index 6f3a4319..94d42fbe 100644
> --- a/lib/tests/igt_describe.c
> +++ b/lib/tests/igt_describe.c
> @@ -101,33 +101,33 @@ static void fake_main(int argc, char **argv) {
>  static const char DESCRIBE_ALL_OUTPUT[] = \
>  	"the top level description\n"
>  	"\n"
> -	"SUB A ../lib/tests/igt_describe.c:36:\n"
> +	"SUB A " __FILE__ ":36:\n"
>  	"  Basic A\n"
>  	"\n"
> -	"SUB B ../lib/tests/igt_describe.c:45:\n"
> +	"SUB B " __FILE__ ":45:\n"
>  	"  Group with B, C & D\n"
>  	"\n"
>  	"  Basic B\n"
>  	"\n"
> -	"SUB C ../lib/tests/igt_describe.c:54:\n"
> +	"SUB C " __FILE__ ":54:\n"
>  	"  Group with B, C & D\n"
>  	"\n"
>  	"  Group with C & D\n"
>  	"\n"
>  	"  Basic C\n"
>  	"\n"
> -	"SUB D ../lib/tests/igt_describe.c:58:\n"
> +	"SUB D " __FILE__ ":58:\n"
>  	"  Group with B, C & D\n"
>  	"\n"
>  	"  Group with C & D\n"
>  	"\n"
> -	"SUB E ../lib/tests/igt_describe.c:66:\n"
> +	"SUB E " __FILE__ ":66:\n"
>  	"  NO DOCUMENTATION!\n"
>  	"\n"
> -	"SUB F ../lib/tests/igt_describe.c:71:\n"
> +	"SUB F " __FILE__ ":71:\n"
>  	"  NO DOCUMENTATION!\n"
>  	"\n"
> -	"SUB G ../lib/tests/igt_describe.c:80:\n"
> +	"SUB G " __FILE__ ":80:\n"
>  	"  this description should be so long that it wraps itself nicely in the terminal this\n"
>  	"  description should be so long that it wraps itself nicely in the terminal this description\n"
>  	"  should be so long that it wraps itself nicely in the terminal this description should be so\n"
> @@ -135,17 +135,17 @@ static const char DESCRIBE_ALL_OUTPUT[] = \
>  	"  wraps itself nicely in the terminal this description should be so long that it wraps itself\n"
>  	"  nicely in the terminal\n"
>  	"\n"
> -	"SUB F ../lib/tests/igt_describe.c:87:\n"
> +	"SUB F " __FILE__ ":87:\n"
>  	"  verylongwordthatshoudlbeprintedeventhoughitspastthewrppinglimitverylongwordthatshoudlbeprintedeventhoughitspastthewrappinglimit\n"
>  	"  verylongwordthatshoudlbeprintedeventhoughitspastthewrappinglimitverylongwordthatshoudlbeprintedeventhoughitspastthewrappinglimit\n"
>  	"\n"
> -	"SUB G ../lib/tests/igt_describe.c:91:\n"
> +	"SUB G " __FILE__ ":91:\n"
>  	"  Subtest with dynamic subsubtests\n\n";
>  
>  static const char JUST_C_OUTPUT[] = \
>  	"the top level description\n"
>  	"\n"
> -	"SUB C ../lib/tests/igt_describe.c:54:\n"
> +	"SUB C " __FILE__ ":54:\n"
>  	"  Group with B, C & D\n"
>  	"\n"
>  	"  Group with C & D\n"
> -- 
> 2.24.1
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2020-03-20 12:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-16 16:04 [igt-dev] [PATCH i-g-t] lib/tests/igt_describe: Use __FILE__ in JUST_C_OUTPUT and DESCRIBE_ALL_OUTPUT Lyude
2020-03-16 17:44 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2020-03-17  1:23 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2020-03-19 18:29 ` [igt-dev] ✗ Fi.CI.BAT: failure for lib/tests/igt_describe: Use __FILE__ in JUST_C_OUTPUT and DESCRIBE_ALL_OUTPUT (rev2) Patchwork
2020-03-20  9:54   ` Petri Latvala
2020-03-20 10:20     ` Vudum, Lakshminarayana
2020-03-20 10:17 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2020-03-20 11:18 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2020-03-20 11:20   ` Petri Latvala
2020-03-20 12:22 ` Petri Latvala [this message]
2020-03-20 14:07 ` Patchwork
2020-03-20 14:44 ` [igt-dev] ✓ Fi.CI.IGT: success " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200320122257.GT9497@platvala-desk.ger.corp.intel.com \
    --to=petri.latvala@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=lyude@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox