diff mbox series

[RFC] README.md: Add shortcut to running a single test

Message ID 20180611123607.19390-1-chrubis@suse.cz
State Accepted
Delegated to: Petr Vorel
Headers show
Series [RFC] README.md: Add shortcut to running a single test | expand

Commit Message

Cyril Hrubis June 11, 2018, 12:36 p.m. UTC
Add a shortcut to compiling and running a single test, which is
something that I've been asked for a few times.

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
 README.md | 43 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

Comments

Petr Vorel June 12, 2018, 11:02 a.m. UTC | #1
Hi Cyril,

> Add a shortcut to compiling and running a single test, which is
> something that I've been asked for a few times.

> Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
Reviewed-by: Petr Vorel <pvorel@suse.cz>

Nice idea. LGTM, just 2 typos found.
> ---
>  README.md | 43 +++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 43 insertions(+)

> diff --git a/README.md b/README.md
> index ffa769d73..6c2d203b7 100644
> --- a/README.md
> +++ b/README.md
> @@ -42,6 +42,49 @@ $ git clone https://github.com/linux-test-project/ltp.git
>  $ cd ltp
>  $ make autotools
>  $ ./configure
> +```
> +
> +Now you can continue either with compiling and running a single test or with
> +compling and installing the whole testsuite.
typo ^
compiling and installing the whole testsuite.

...
> +$ cd testcases/open_posix_testsuite/
> +$ make generate-makefiles
> +$ cd conformance/interfaces/foo
> +$ make
> +$ ./foo_1-1.run-test
> +```
> +
> +Copiling and installing all testcases
typo ^
Compiling and installing all testcases


Kind regards,
Petr
Cyril Hrubis June 12, 2018, 12:26 p.m. UTC | #2
Hi!
> Nice idea. LGTM, just 2 typos found.

Pushed with typos fixed, thanks for the review.
Petr Vorel June 12, 2018, 12:38 p.m. UTC | #3
Hi Cyril,

> > Nice idea. LGTM, just 2 typos found.

> Pushed with typos fixed, thanks for the review.
Actually I've noticed, that some shell tests expect to have LTPROOT defined,
like(move_pages.sh in testcases/kernel/syscalls/move_pages (which is going to be
removed anyway).
But we should decide how to handle LTPROOT (if it's needed, we should check for
it to be empty and warn).


Kind regards,
Petr
diff mbox series

Patch

diff --git a/README.md b/README.md
index ffa769d73..6c2d203b7 100644
--- a/README.md
+++ b/README.md
@@ -42,6 +42,49 @@  $ git clone https://github.com/linux-test-project/ltp.git
 $ cd ltp
 $ make autotools
 $ ./configure
+```
+
+Now you can continue either with compiling and running a single test or with
+compling and installing the whole testsuite.
+
+Shortcut to running a single test
+---------------------------------
+
+If you need to execute a single test you actually does not need to compile
+whole LTP, if you want to run a syscall testcase following should work.
+
+```
+$ cd testcases/kernel/syscalls/foo
+$ make
+$ PATH=$PATH:$PWD ./foo01
+```
+
+Shell testcases are a bit more complicated since these need a path to a shell
+library as well as to compiled binary helpers, but generally following should
+work.
+
+```
+$ cd testcases/lib
+$ make
+$ cd ../commands/foo
+$ PATH=$PATH:$PWD:$PWD/../../lib/ ./foo01.sh
+```
+
+Open Posix Testsuite has it's own build system which needs Makefiles to be
+generated first, then compilation should work in subdirectories as well.
+
+```
+$ cd testcases/open_posix_testsuite/
+$ make generate-makefiles
+$ cd conformance/interfaces/foo
+$ make
+$ ./foo_1-1.run-test
+```
+
+Copiling and installing all testcases
+-------------------------------------
+
+```
 $ make
 $ make install
 ```