source: Dev/trunk/src/client/util/less/test/browser-test-prepare.js @ 483

Last change on this file since 483 was 483, checked in by hendrikvanantwerpen, 11 years ago

Added Dojo 1.9.3 release.

File size: 1.4 KB
Line 
1var path = require('path'),
2    fs = require('fs'),
3    sys = require('util');
4
5var createTestRunnerPage = function(dir, exclude, testSuiteName, dir2) {
6    var output = '<html><head>\n';
7
8    fs.readdirSync(path.join("test", dir, 'less', dir2 || "")).forEach(function (file) {
9        if (! /\.less/.test(file)) { return; }
10       
11        var name = path.basename(file, '.less'),
12            id = (dir ? dir + '-' : "") + 'less-' + (dir2 ? dir2 + "-" : "") + name;
13       
14        if (exclude && name.match(exclude)) { return; }
15       
16        output += '<link id="original-less:' + id + '" rel="stylesheet/less" type="text/css" href="http://localhost:8081/' + path.join(dir, 'less', dir2 || "", name) + '.less' +'">\n';
17        output += '<link id="expected-less:' + id + '" rel="stylesheet"  type="text/css" href="http://localhost:8081/' + path.join(dir, 'css', dir2 || "", name) + '.css' + '">\n';
18    });
19
20    output += String(fs.readFileSync(path.join('test/browser', 'template.htm'))).replace("{runner-name}", testSuiteName);
21
22    fs.writeFileSync(path.join('test/browser', 'test-runner-'+testSuiteName+'.htm'), output);
23};
24
25createTestRunnerPage("", /javascript|urls/, "main");
26createTestRunnerPage("browser", null, "browser");
27createTestRunnerPage("browser", null, "relative-urls", "relative-urls");
28createTestRunnerPage("browser", null, "rootpath", "rootpath");
29createTestRunnerPage("browser", null, "rootpath-relative", "rootpath-relative");
Note: See TracBrowser for help on using the repository browser.