json: only attempt python & node schema conversion tests if their bins are present
Tests introduced in https://github.com/ggerganov/llama.cpp/pull/5978 disabled in https://github.com/ggerganov/llama.cpp/pull/6198
This commit is contained in:
parent
f372c49ccd
commit
3c8a37a05f
1 changed files with 22 additions and 12 deletions
|
@ -803,18 +803,28 @@ int main() {
|
|||
tc.verify_status(FAILURE);
|
||||
}
|
||||
});
|
||||
//test_all("Python", [](const TestCase & tc) {
|
||||
// write("test-json-schema-input.tmp", tc.schema);
|
||||
// tc.verify_status(std::system(
|
||||
// "python ./examples/json-schema-to-grammar.py test-json-schema-input.tmp > test-grammar-output.tmp") == 0 ? SUCCESS : FAILURE);
|
||||
// tc.verify(read("test-grammar-output.tmp"));
|
||||
//});
|
||||
//test_all("JavaScript", [](const TestCase & tc) {
|
||||
// write("test-json-schema-input.tmp", tc.schema);
|
||||
// tc.verify_status(std::system(
|
||||
// "node ./tests/run-json-schema-to-grammar.mjs test-json-schema-input.tmp > test-grammar-output.tmp") == 0 ? SUCCESS : FAILURE);
|
||||
// tc.verify(read("test-grammar-output.tmp"));
|
||||
//});
|
||||
|
||||
if (std::system("python --version") == 0) {
|
||||
test_all("Python", [](const TestCase & tc) {
|
||||
write("test-json-schema-input.tmp", tc.schema);
|
||||
tc.verify_status(std::system(
|
||||
"python ./examples/json-schema-to-grammar.py test-json-schema-input.tmp > test-grammar-output.tmp") == 0 ? SUCCESS : FAILURE);
|
||||
tc.verify(read("test-grammar-output.tmp"));
|
||||
});
|
||||
} else {
|
||||
fprintf(stderr, "#\n# WARNING: Python not found, skipping Python JSON schema -> grammar tests!\n#\n");
|
||||
}
|
||||
|
||||
if (std::system("node --version") == 0) {
|
||||
test_all("JavaScript", [](const TestCase & tc) {
|
||||
write("test-json-schema-input.tmp", tc.schema);
|
||||
tc.verify_status(std::system(
|
||||
"node ./tests/run-json-schema-to-grammar.mjs test-json-schema-input.tmp > test-grammar-output.tmp") == 0 ? SUCCESS : FAILURE);
|
||||
tc.verify(read("test-grammar-output.tmp"));
|
||||
});
|
||||
} else {
|
||||
fprintf(stderr, "#\n# WARNING: Node not found, skipping JavaScript JSON schema -> grammar tests!\n#\n");
|
||||
}
|
||||
|
||||
test_all("Check Expectations Validity", [](const TestCase & tc) {
|
||||
if (tc.expected_status == SUCCESS) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue