Test.hx 650 B

123456789101112131415161718
  1. class Test {
  2. static function error(msg, code) {
  3. Sys.stderr().writeString(msg);
  4. Sys.exit(code);
  5. }
  6. static function main() {
  7. var proc = new sys.io.Process("haxe", ["--display", "Main.hx@62@toplevel"]);
  8. var stderr = proc.stderr.readAll().toString();
  9. var exit = proc.exitCode();
  10. if (exit != 0)
  11. error(stderr, exit);
  12. else if (stderr.indexOf("<il>") != 0)
  13. error("Invalid toplevel completion output\n", 1);
  14. else if (stderr.indexOf("_Main.A_Impl_") != -1)
  15. error("Abstract implementation class is included in the output:\n\n" + stderr, 1);
  16. }
  17. }