Skip to contentSkip to conversation

doc/developers: document tst_/tse_/tso_ library namespaces

PATCH In review Li Wang via ltp 2 participants 4 messages Feb 2 – Feb 24

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 doc/developers: document tst_/tse_/tso_ library namespaces

This helps contributors choose the correct layer when adding new library code and clarifies expectations around legacy components.

Follow-up: eef750db28 ("libs: adopt tse_ prefix for extended (non-core) library")
Follow-up: 751df4fa64 ("include/old: rename legacy headers to tso_* namespace")

---
 doc/developers/ltp_library.rst | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
doc/developers/ltp_library.rst +28 -0
index f76cbb75e..bb2677622 100644
@@ -15,6 +15,34 @@ for :doc:`writing tests <../developers/writing_tests>`
 #. Do not add new API functions to the old API. Add new functions to
    ``tst_.[ch]`` files.
 
+Library naming and scope
+------------------------
+
+To keep the library API easy to navigate and to make layering explicit, LTP
+library components follow these naming rules:
+
+- **tst_**: Core LTP library API (located in ``lib/``).
+
+  - Stable, widely used interfaces intended for general consumption by tests.
+  - New public APIs should normally live here (in ``tst_*.h`` / ``tst_*.c``).
+
+- **tse_**: Non-core / extended library code (located in ``libs/``).
+
+  - Optional or specialized helpers that are not part of the core API.
+  - May have narrower scope or fewer stability guarantees than ``tst_``.
+  - Can be promoted to ``tst_`` later if it becomes broadly useful and stable.
+
+- **tso_**: Legacy / old library code.
+
+  - Kept for backward compatibility.
+  - No new features should be added; only minimal fixes are acceptable (e.g. build fixes, correctness fixes, security fixes).
+  - New code should not depend on ``tso_`` unless strictly necessary.
+
+**Notes:**
+
+- Prefer adding new code to ``tst_`` or ``tse_``; avoid introducing new ``tso_`` components.
+- When adding a new public interface, document where it belongs (``tst_`` vs ``tse_``) and why.
+
 Shell API
 ---------
 
Signature · 5 lines
2.52.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Reviewed-by on v1 1/1
#1 lore raw

Hi Li,

Quoted 15 lines

This helps contributors choose the correct layer when adding new library code and clarifies expectations around legacy components.

Follow-up: eef750db28 ("libs: adopt tse_ prefix for extended (non-core) library")
Follow-up: 751df4fa64 ("include/old: rename legacy headers to tso_* namespace")

---
 doc/developers/ltp_library.rst | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
doc/developers/ltp_library.rst +0 -0
index f76cbb75e..bb2677622 100644

doc/developers/ltp_library.rst for :doc:`writing tests <../developers/writing_tests>` · line 24

Quoted 10 lines
doc/developers/ltp_library.rst +7 -0
@@ -15,6 +15,34 @@ for :doc:`writing tests <../developers/writing_tests>`
 #. Do not add new API functions to the old API. Add new functions to
    ``tst_.[ch]`` files.
 
+Library naming and scope
+------------------------
+
+To keep the library API easy to navigate and to make layering explicit, LTP
+library components follow these naming rules:
+
+- **tst_**: Core LTP library API (located in ``lib/``).

nit: maybe also use :master: for lib/ to make it clickable?

doc/developers/ltp_library.rst for :doc:`writing tests <../developers/writing_tests>` · line 29

Quoted 5 lines
doc/developers/ltp_library.rst +5 -0
+
+  - Stable, widely used interfaces intended for general consumption by tests.
+  - New public APIs should normally live here (in ``tst_*.h`` / ``tst_*.c``).
+
+- **tse_**: Non-core / extended library code (located in ``libs/``).

nit: and here as well?

doc/developers/ltp_library.rst for :doc:`writing tests <../developers/writing_tests>` · line 38

Quoted 9 lines
doc/developers/ltp_library.rst +9 -0
+
+  - Optional or specialized helpers that are not part of the core API.
+  - May have narrower scope or fewer stability guarantees than ``tst_``.
+  - Can be promoted to ``tst_`` later if it becomes broadly useful and stable.
+
+- **tso_**: Legacy / old library code.
+
+  - Kept for backward compatibility.
+  - No new features should be added; only minimal fixes are acceptable (e.g. build fixes, correctness fixes, security fixes).

very nit: maybe split long line?

doc/developers/ltp_library.rst for :doc:`writing tests <../developers/writing_tests>` · line 41

Quoted 3 lines
doc/developers/ltp_library.rst +3 -0
+  - New code should not depend on ``tso_`` unless strictly necessary.
+
+**Notes:**

nit: I'd prefer the standard note (can be changed before merge):

.. note::

doc/developers/ltp_library.rst for :doc:`writing tests <../developers/writing_tests>` · line 44

Quoted 3 lines
doc/developers/ltp_library.rst +3 -0
+
+- Prefer adding new code to ``tst_`` or ``tse_``; avoid introducing new ``tso_`` components.
+- When adding a new public interface, document where it belongs (``tst_`` vs ``tse_``) and why.

LGTM, but I'd prefer more developers acked it.

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
author Reviewed-by Andrea Cervesato
#2 lore raw

Hi!

Quoted 58 lines · Petr Vorel

Hi Li,

Quoted 15 lines

This helps contributors choose the correct layer when adding new library code and clarifies expectations around legacy components.

Follow-up: eef750db28 ("libs: adopt tse_ prefix for extended (non-core) library")
Follow-up: 751df4fa64 ("include/old: rename legacy headers to tso_* namespace")

---
 doc/developers/ltp_library.rst | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
doc/developers/ltp_library.rst +0 -0
index f76cbb75e..bb2677622 100644

doc/developers/ltp_library.rst for :doc:`writing tests <../developers/writing_tests>` · line 24

Quoted 10 lines
doc/developers/ltp_library.rst +7 -0
@@ -15,6 +15,34 @@ for :doc:`writing tests <../developers/writing_tests>`
 #. Do not add new API functions to the old API. Add new functions to
    ``tst_.[ch]`` files.
 
+Library naming and scope
+------------------------
+
+To keep the library API easy to navigate and to make layering explicit, LTP
+library components follow these naming rules:
+
+- **tst_**: Core LTP library API (located in ``lib/``).

nit: maybe also use :master: for lib/ to make it clickable?

doc/developers/ltp_library.rst for :doc:`writing tests <../developers/writing_tests>` · line 29

Quoted 5 lines
doc/developers/ltp_library.rst +5 -0
+
+  - Stable, widely used interfaces intended for general consumption by tests.
+  - New public APIs should normally live here (in ``tst_*.h`` / ``tst_*.c``).
+
+- **tse_**: Non-core / extended library code (located in ``libs/``).

nit: and here as well?

doc/developers/ltp_library.rst for :doc:`writing tests <../developers/writing_tests>` · line 38

Quoted 9 lines
doc/developers/ltp_library.rst +9 -0
+
+  - Optional or specialized helpers that are not part of the core API.
+  - May have narrower scope or fewer stability guarantees than ``tst_``.
+  - Can be promoted to ``tst_`` later if it becomes broadly useful and stable.
+
+- **tso_**: Legacy / old library code.
+
+  - Kept for backward compatibility.
+  - No new features should be added; only minimal fixes are acceptable (e.g. build fixes, correctness fixes, security fixes).

very nit: maybe split long line?

doc/developers/ltp_library.rst for :doc:`writing tests <../developers/writing_tests>` · line 41

Quoted 3 lines
doc/developers/ltp_library.rst +3 -0
+  - New code should not depend on ``tso_`` unless strictly necessary.
+
+**Notes:**

nit: I'd prefer the standard note (can be changed before merge):

.. note::

doc/developers/ltp_library.rst for :doc:`writing tests <../developers/writing_tests>` · line 44

Quoted 3 lines
doc/developers/ltp_library.rst +3 -0
+
+- Prefer adding new code to ``tst_`` or ``tse_``; avoid introducing new ``tso_`` components.
+- When adding a new public interface, document where it belongs (``tst_`` vs ``tse_``) and why.
Quoted 6 lines

LGTM, but I'd prefer more developers acked it.

Kind regards,
Petr

With Petr suggestions,

Signature · 7 lines
Andrea Cervesato
SUSE QE Automation Engineer Linux
[email protected]


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#3 lore raw

Hi Andrea, Petr,

Patch merged (with Petr's suggestions), thanks!

Quoted 92 lines · Andrea Cervesato

Hi!

Quoted 3 lines · Petr Vorel

Hi Li,

Quoted 1 line

This helps contributors choose the correct layer when adding new

library

Quoted 3 lines
Quoted 3 lines

code and clarifies expectations around legacy components.

Follow-up: eef750db28 ("libs: adopt tse_ prefix for extended

(non-core) library")

Quoted 1 line
Quoted 1 line

Follow-up: 751df4fa64 ("include/old: rename legacy headers to tso_*

namespace")

Quoted 6 lines

Review

Quoted 6 lines
---
 doc/developers/ltp_library.rst | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
(quoted diff) +0 -0

b/doc/developers/ltp_library.rst

Quoted 4 lines

doc/developers/ltp_library.rst for :doc:`writing tests

Quoted 4 lines

index f76cbb75e..bb2677622 100644

doc/developers/ltp_library.rst +0 -0
@@ -15,6 +15,34 @@ for :doc:`writing tests

<../developers/writing_tests>`

Quoted 7 lines

doc/developers/ltp_library.rst for :doc:`writing tests <../developers/writing_tests>`

Quoted 7 lines
doc/developers/ltp_library.rst +4 -0
 #. Do not add new API functions to the old API. Add new functions to
    ``tst_.[ch]`` files.
 
+Library naming and scope
+------------------------
+
+To keep the library API easy to navigate and to make layering

explicit, LTP

Quoted 6 lines

doc/developers/ltp_library.rst for :doc:`writing tests <../developers/writing_tests>` · line 24

Quoted 3 lines
doc/developers/ltp_library.rst +3 -0
+library components follow these naming rules:
+
+- **tst_**: Core LTP library API (located in ``lib/``).

nit: maybe also use :master: for lib/ to make it clickable?

Quoted 2 lines
doc/developers/ltp_library.rst +2 -0
+
+  - Stable, widely used interfaces intended for general consumption

by tests.

Quoted 1 line

doc/developers/ltp_library.rst for :doc:`writing tests · line 27

Quoted 1 line
doc/developers/ltp_library.rst +1 -0
+  - New public APIs should normally live here (in ``tst_*.h`` /

``tst_*.c``).

Quoted 7 lines

doc/developers/ltp_library.rst for :doc:`writing tests · line 29

Quoted 2 lines
doc/developers/ltp_library.rst +2 -0
+
+- **tse_**: Non-core / extended library code (located in ``libs/``).

nit: and here as well?

Quoted 3 lines
doc/developers/ltp_library.rst +3 -0
+
+  - Optional or specialized helpers that are not part of the core API.
+  - May have narrower scope or fewer stability guarantees than

``tst_``.

Quoted 1 line

doc/developers/ltp_library.rst for :doc:`writing tests · line 33

Quoted 1 line
doc/developers/ltp_library.rst +1 -0
+  - Can be promoted to ``tst_`` later if it becomes broadly useful

and stable.

Quoted 5 lines

doc/developers/ltp_library.rst for :doc:`writing tests <../developers/writing_tests>`

Quoted 5 lines
doc/developers/ltp_library.rst +5 -0
+
+- **tso_**: Legacy / old library code.
+
+  - Kept for backward compatibility.
+  - No new features should be added; only minimal fixes are

acceptable (e.g. build fixes, correctness fixes, security fixes).

Quoted 12 lines

very nit: maybe split long line?

doc/developers/ltp_library.rst for :doc:`writing tests <../developers/writing_tests>` · line 41

Quoted 3 lines
doc/developers/ltp_library.rst +3 -0
+  - New code should not depend on ``tso_`` unless strictly necessary.
+
+**Notes:**

nit: I'd prefer the standard note (can be changed before merge):

.. note::

Quoted 2 lines
doc/developers/ltp_library.rst +2 -0
+
+- Prefer adding new code to ``tst_`` or ``tse_``; avoid introducing

new ``tso_`` components.

Quoted 1 line

doc/developers/ltp_library.rst for :doc:`writing tests · line 44

Quoted 1 line
doc/developers/ltp_library.rst +1 -0
+- When adding a new public interface, document where it belongs

(``tst_`` vs ``tse_``) and why.

Quoted 7 lines

LGTM, but I'd prefer more developers acked it.

Kind regards,
Petr

With Petr suggestions,

--
Andrea Cervesato
SUSE QE Automation Engineer Linux
[email protected]

Signature · 5 lines
Regards,
Li Wang

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