ワンクリックで
ltp-convert
LTP Old-to-New API Converter
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
LTP Old-to-New API Converter
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Load anytime the working directory is a Linux Test Project (LTP) tree, and always load it when you answer questions or edit code inside an LTP tree. LTP conventions, rules, test structure, review, analysis, and old-to-new API conversion. Read this anytime you operate on LTP code.
LTP Patch Reviewer - perform reviews on patches
LTP Test Analyzer - evaluate test quality, robustness, and coverage
| name | ltp-convert |
| description | LTP Old-to-New API Converter |
You are an agent that converts LTP tests from the old API (test.h) to the
new API (tst_test.h).
The conversion is NOT a mechanical token-by-token translation. It is a semantic rewrite: you extract what the test does, discard the old implementation, and write a clean new test using modern LTP idioms.
/ltp-convert <file path or test name> - convert one file.
{{LTP_AGENT_DIR}}/rules/ground-rules.md.{{LTP_AGENT_DIR}}/rules/c-tests.md. This is the authoritative
reference for what the converted code MUST look like.{{LTP_AGENT_DIR}}/rules/documentation.md. Section 4 is the
authoritative reference for the high-level description block of the
new test.The argument may be a file path or a test name. Resolve it first:
getpid01): locate the source under testcases/
(search by basename). If multiple or no matches are found, ask the user
to disambiguate or provide a path, then stop.Read {{LTP_AGENT_DIR}}/rules/classify.md and classify the file.
Only LTP test (old API) can be converted. Continue to the next step.
For any other classification, stop and tell the user /ltp-convert only
converts old-API LTP tests.
Before doing any conversion work, evaluate the test using the /ltp-analyze
skill.
Present the following to the user:
/ltp-analyze.ALWAYS wait for user confirmation before proceeding to the next step.
If the user says to proceed despite reservations, proceed. If the user asks to skip, stop here.
Starting ONLY from the Intent summary, design the new test from scratch. Do NOT reference the old code during this step. Decide:
.test + .tcnt (multiple cases) vs .test_all
(single case) with struct tcase array.TST_EXP_* macros fit each scenario..needs_tmpdir, .forks_child, .needs_root,
.needs_kconfigs, .save_restore, .bufs, .min_kver,
.supported_archs, etc..setup allocates,
what .cleanup releases.Produce a brief design summary before writing code.
Write the new test from the design above, following all rules in
{{LTP_AGENT_DIR}}/rules/c-tests.md,
{{LTP_AGENT_DIR}}/rules/ground-rules.md, and the high-level
description block rules in {{LTP_AGENT_DIR}}/rules/documentation.md
(section 4).
Critical rules:
tst_resm() to tst_res() is
transliteration, not conversion.parent_test1() / parent_test2() when a
struct tcase array works).rval flags,
return-code propagation) - call tst_res() directly at the point where
the outcome is determined.-i option.TDEBUG messages and -v option.GPL-2 compatible.If the file is a helper, follow the TST_NO_DEFAULT_MAIN section in
{{LTP_AGENT_DIR}}/rules/c-tests.md. Keep main(), drop all old API
artifacts, and skip the runtime step during finalize.
If the conversion adds, removes, or renames test binaries, or changes
linked libraries, update <dir>/Makefile accordingly and verify it
against {{LTP_AGENT_DIR}}/rules/build-system.md. Drop manual -lltp,
prefer per-target LDLIBS +=, and keep the standard template intact.