integration.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. window.__karma__.loaded = function () { };
  2. // Loading tests
  3. var xhr = new XMLHttpRequest();
  4. xhr.open("GET", "/tests/validation/config.json", true);
  5. xhr.addEventListener("load", function () {
  6. if (xhr.status === 200) {
  7. config = JSON.parse(xhr.responseText);
  8. describe("Validation Tests", function () {
  9. before(function (done) {
  10. this.timeout(180000);
  11. require = null;
  12. BABYLONDEVTOOLS.Loader
  13. .require('/tests/validation/validation.js')
  14. .useDist()
  15. .load(function () {
  16. var info = engine.getGlInfo();
  17. console.log("Webgl Version: " + info.version);
  18. console.log("Webgl Vendor: " + info.vendor);
  19. console.log("Webgl Renderer: " + info.renderer);
  20. done();
  21. });
  22. });
  23. // Run tests
  24. for (let index = 0; index < config.tests.length; index++) {
  25. var test = config.tests[index];
  26. if (test.onlyVisual || test.excludeFromAutomaticTesting) {
  27. continue;
  28. }
  29. it(test.title, function (done) {
  30. this.timeout(240000);
  31. try {
  32. runTest(index, function(result, screenshot) {
  33. try {
  34. expect(result).to.be.true;
  35. done();
  36. }
  37. catch (e) {
  38. if (screenshot) {
  39. console.error(screenshot);
  40. }
  41. done(e);
  42. }
  43. });
  44. }
  45. catch (e) {
  46. done(e);
  47. }
  48. });
  49. };
  50. });
  51. window.__karma__.start();
  52. }
  53. }, false);
  54. xhr.send();