Files
prometeu-studio/prometeu-app/src/test/java/p/studio/app/compiler/InstalledKnowledgeTest.java
T
bquarkz 603ed01227 feat(compiler): port runtime catalogs and enforce target ABI (AGD77)
Import both runtime catalogs and provenance, port all intrinsic metadata and exact constants, and validate target signatures and carriers through the common pipeline. Package matching compiler/SDK resources and add active parity plus production runtime conformance checks.

Validation: 420 compiler/PBS tests passed, with 12 existing skips; provider export, runtime execution and installed catalog checks passed. The pre-existing Gfx.clear typed-metadata failure remains active and assigned to AGD78 under the explicitly accepted scope revision recorded in LSN-0080.
2026-10-15 13:07:49 +01:00

47 lines
2.3 KiB
Java

package p.studio.app.compiler;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import static org.junit.jupiter.api.Assertions.*;
class InstalledKnowledgeTest {
@TempDir Path outsideRepository;
@Test void installedJarsProvideAllReferencesAndCompileTheExampleOutsideTheCheckout() throws Exception {
String log = runProbe();
assertTrue(log.contains("references; example compiled"), log);
assertTrue(log.contains("Packaged external sources verified"), log);
}
@Test void installedCompilerAndSdkCarryTheSameVerifiedCatalog() throws Exception {
String log = runProbe("--catalog-only");
assertTrue(log.contains("Installed compiler/SDK catalog identity verified"), log);
}
private String runProbe(String... arguments) throws Exception {
Path distribution = Path.of(System.getProperty("studio.test.distribution"));
String jars;
try (var files = Files.list(distribution.resolve("lib"))) {
jars = files.filter(file -> file.toString().endsWith(".jar")).sorted()
.map(Path::toString).collect(Collectors.joining(java.io.File.pathSeparator));
}
String probeClasses = Path.of(InstalledKnowledgeProbe.class.getProtectionDomain().getCodeSource().getLocation().toURI()).toString();
Path output = outsideRepository.resolve("probe.log");
var command = new java.util.ArrayList<>(java.util.List.of(distribution.resolve("runtime/bin/java").toString(),
"-cp", jars + java.io.File.pathSeparator + probeClasses, InstalledKnowledgeProbe.class.getName()));
command.addAll(java.util.List.of(arguments));
var process = new ProcessBuilder(command)
.directory(outsideRepository.toFile()).redirectErrorStream(true).redirectOutput(output.toFile()).start();
try {
assertTrue(process.waitFor(45, TimeUnit.SECONDS), "Installed knowledge probe timed out");
String log = Files.readString(output);
assertEquals(0, process.exitValue(), log);
return log;
} finally { if (process.isAlive()) process.destroyForcibly().waitFor(); }
}
}