1
var path = require('path'),
5
var createTestRunnerPage = function(dir, exclude, testSuiteName, dir2) {
6
var output = '<html><head>\n';
8
fs.readdirSync(path.join("test", dir, 'less', dir2 || "")).forEach(function (file) {
9
if (! /\.less/.test(file)) { return; }
11
var name = path.basename(file, '.less'),
12
id = (dir ? dir + '-' : "") + 'less-' + (dir2 ? dir2 + "-" : "") + name;
14
if (exclude && name.match(exclude)) { return; }
16
output += '<link id="original-less:' + id + '" rel="stylesheet/less" type="text/css" href="/' + path.join(dir, 'less', dir2 || "", name) + '.less' +'">\n';
17
output += '<link id="expected-less:' + id + '" rel="stylesheet" type="text/css" href="/' + path.join(dir, 'css', dir2 || "", name) + '.css' + '">\n';
20
output += String(fs.readFileSync(path.join('test/browser', 'template.htm'))).replace("{runner-name}", testSuiteName);
22
fs.writeFileSync(path.join('test/browser', 'test-runner-'+testSuiteName+'.htm'), output);
25
createTestRunnerPage("", /javascript|urls/, "main");
26
createTestRunnerPage("", null, "legacy", "legacy");
27
createTestRunnerPage("", /javascript/, "errors", "errors");
28
createTestRunnerPage("browser", null, "browser");
29
createTestRunnerPage("browser", null, "relative-urls", "relative-urls");
30
createTestRunnerPage("browser", null, "rootpath", "rootpath");
31
createTestRunnerPage("browser", null, "rootpath-relative", "rootpath-relative");
32
createTestRunnerPage("browser", null, "production");
b'\\ No newline at end of file'