public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: Re: [LTP] [RFC PATCH 0/3] C API: print LTP version
Date: Tue, 4 Jul 2023 11:39:00 +0200	[thread overview]
Message-ID: <20230704093900.GB470707@pevik> (raw)
In-Reply-To: <20230704092424.497903-1-pvorel@suse.cz>

Hi,

I also wonder, how to print LTP version for C API without requiring
LTPROOT environment variable.

In shell, it could be changed

if [ -z "$LTPROOT" ]; then
-	export LTPROOT="$PWD"
+	export LTPROOT="$(cd "$(dirname "$0")/../.." && pwd)
-	export TST_DATAROOT="$LTPROOT/datafiles"
else
	export TST_DATAROOT="$LTPROOT/testcases/data/$TST_ID"
fi

But that could broke some tests which are using datafiles/ directory inside git
tree.

I was also thinking about replacing LTPROOT in C API with #define generated by
configure script based on prefix. But again, how to have it in shell?
I don't want to have stub (tst_test.sh.in), thus maybe the way would be to
expect "Version" file is in ../../, e.g.

. ../../Version
But with the LTPROOT change above, it could be
. $LTPROOT/Version

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

      reply	other threads:[~2023-07-04  9:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-04  9:24 [LTP] [RFC PATCH 0/3] C API: print LTP version Petr Vorel
2023-07-04  9:39 ` Petr Vorel [this message]

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=20230704093900.GB470707@pevik \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    /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