test.js 787 B

1234567891011121314151617181920212223242526
  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. screen_dummy: true,
  18. });
  19. setInterval(() => {
  20. console.log(emulator.screen_adapter.get_text_screen());
  21. }, 500);