All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [RFC PATCH 0/3] C API: print LTP version
@ 2023-07-04  9:24 Petr Vorel
  2023-07-04  9:39 ` Petr Vorel
  0 siblings, 1 reply; 2+ messages in thread
From: Petr Vorel @ 2023-07-04  9:24 UTC (permalink / raw)
  To: ltp

NOTE this is a correct cover letter (I'm sorry for the confusion).
RFC is mainly due first patch.

Kind regards,
Petr

Petr Vorel (3):
  Makefile: Add C header with generated LTP version
  lib/C-API: Add option -V to print LTP version
  lib/C-API: Print LTP version at test start

 .gitignore     | 1 +
 lib/Makefile   | 4 ++++
 lib/tst_test.c | 8 ++++++++
 3 files changed, 13 insertions(+)

-- 
2.40.1


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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [LTP] [RFC PATCH 0/3] C API: print LTP version
  2023-07-04  9:24 [LTP] [RFC PATCH 0/3] C API: print LTP version Petr Vorel
@ 2023-07-04  9:39 ` Petr Vorel
  0 siblings, 0 replies; 2+ messages in thread
From: Petr Vorel @ 2023-07-04  9:39 UTC (permalink / raw)
  To: ltp

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-07-04  9:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.