test.js 763 B

12345678910111213141516171819202122232425
  1. #!/usr/bin/env node
  2. "use strict";
  3. const TEST_RELEASE_BUILD = +process.env.TEST_RELEASE_BUILD;
  4. const fs = require("fs");
  5. var V86 = require(`../../build/${TEST_RELEASE_BUILD ? "libv86" : "libv86-debug"}.js`).V86;
  6. process.on("unhandledRejection", exn => { throw exn; });
  7. const emulator = new V86({
  8. bios: { url: __dirname + "/../../bios/seabios.bin" },
  9. vga_bios: { url: __dirname + "/../../bios/vgabios.bin" },
  10. fda: { url: __dirname + "/../../images/freedos722.img", async: true },
  11. network_relay_url: "<UNUSED>",
  12. autostart: true,
  13. memory_size: 32 * 1024 * 1024,
  14. filesystem: {},
  15. log_level: -641,
  16. disable_jit: +process.env.DISABLE_JIT,
  17. });
  18. setInterval(() => {
  19. console.log(emulator.screen_adapter.get_text_screen());
  20. }, 500);