Skip to content

Commit f1b389e

Browse files
committed
update the test cases to not use bsb any more
1 parent 8271f74 commit f1b389e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+366
-426
lines changed

Diff for: jscomp/build_tests/bs_dependencies_node_path_override/overridden_node_modules/liba/package.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: jscomp/build_tests/bs_dependencies_node_path_override/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"name": "bs_dependencies_node_path_override",
33
"version": "0.1.0",
44
"scripts": {
5-
"clean": "bsb -clean-world",
6-
"build": "bsb -make-world",
7-
"watch": "bsb -make-world -w"
5+
"clean": "rescript clean -with-deps",
6+
"build": "rescript",
7+
"watch": "rescript build -w"
88
},
99
"keywords": [
1010
"rescript"

Diff for: jscomp/build_tests/bs_dependencies_node_path_override/testcase.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
var assert = require('assert')
33
var path = require('path')
44
var p = require('child_process')
5-
p.execSync(`bsb -make-world`, {cwd:__dirname,shell:true,encoding:'utf8',stdio:"inherit"})
5+
p.execSync(`rescript`, {cwd:__dirname,shell:true,encoding:'utf8',stdio:"inherit"})
66
var u = require("./examples/test.js")
77
assert.equal(path.basename(u.v),'demo.mldemo.ml')

Diff for: jscomp/build_tests/bucklescript-tea/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Then in your current Bucklescript project just use this as a dependency add this
4747
"bs-dependencies" : ["bucklescript-tea"]
4848
```
4949

50-
_If you install it via any other method make sure that `bucklescript-tea` is a dependency in your npm's package.json file as `bsb` uses that for lookup._
50+
_If you install it via any other method make sure that `bucklescript-tea` is a dependency in your npm's package.json file as `rescript` uses that for lookup._
5151

5252
## Usage
5353

Diff for: jscomp/build_tests/bucklescript-tea/input.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
var p = require("child_process");
22
const { assert } = require("console");
33

4-
var o = p.spawnSync(`bsb`);
4+
var o = p.spawnSync(`rescript`);
55

66
console.log(o.stderr + "");
77
console.log("-----");

Diff for: jscomp/build_tests/bucklescript-tea/package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
"description": "TEA for Bucklescript",
55
"main": "index.js",
66
"scripts": {
7-
"clean": "bsb clean",
8-
"clean:all": "bsb -clean-world",
9-
"build": "bsb",
10-
"build:all": "bsb -make-world",
11-
"watch": "bsb -w",
7+
"clean": "rescript clean",
8+
"clean:all": "rescript clean -with-deps",
9+
"build": "rescript",
10+
"build:all": "rescript",
11+
"watch": "rescript build -w",
1212
"build:test:client": "browserify --standalone=Test_client --outfile=lib/js/test/app_test_client.js lib/js/test/test_client.js",
1313
"watch:test:client": "watchify --standalone=Test_client --outfile=lib/js/test/app_test_client.js lib/js/test/test_client.js",
1414
"watch:test": "run-p watch watch:test:*",

Diff for: jscomp/build_tests/case/input.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
var p = require('child_process')
44
var assert = require('assert')
5-
var o = p.spawnSync(`bsb`,{encoding: 'utf8',cwd : __dirname})
5+
var o = p.spawnSync(`rescript`,{encoding: 'utf8',cwd : __dirname})
66

77

88
assert.ok(o.stderr.match(/different cases/).length > 0 )

Diff for: jscomp/build_tests/case/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"name": "case",
33
"version": "0.1.0",
44
"scripts": {
5-
"clean": "bsb -clean-world",
6-
"build": "bsb -make-world",
7-
"watch": "bsb -make-world -w"
5+
"clean": "rescript clean -with-deps",
6+
"build": "rescript build",
7+
"watch": "rescript build -w"
88
},
99
"keywords": [
1010
"rescript"

Diff for: jscomp/build_tests/case2/input.js

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1+
var p = require("child_process");
2+
var assert = require("assert");
3+
var o = p.spawnSync(`rescript`, { encoding: "utf8", cwd: __dirname });
14

2-
3-
var p = require('child_process')
4-
var assert = require('assert')
5-
var o = p.spawnSync(`bsb`,{encoding: 'utf8',cwd : __dirname})
6-
7-
8-
assert.ok(o.stderr.match(/different cases/).length > 0 )
5+
assert.ok(o.stderr.match(/different cases/).length > 0);

Diff for: jscomp/build_tests/case2/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"name": "case2",
33
"version": "0.1.0",
44
"scripts": {
5-
"clean": "bsb -clean-world",
6-
"build": "bsb -make-world",
7-
"watch": "bsb -make-world -w"
5+
"clean": "rescript clean -with-deps",
6+
"build": "rescript build",
7+
"watch": "rescript build -w"
88
},
99
"keywords": [
1010
"BuckleScript"

Diff for: jscomp/build_tests/case3/input.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@ var p = require("child_process");
44
var fs = require("fs");
55
var path = require("path");
66
var assert = require("assert");
7-
p.spawnSync(`bsb`, {
7+
p.spawnSync(`rescript`, {
88
encoding: "utf8",
99
cwd: __dirname,
10-
stdio: [0, 1, 2]
10+
stdio: [0, 1, 2],
1111
});
1212

1313
var o = fs.readFileSync(path.join(__dirname, "src", "hello.bs.js"), "ascii");
14-
assert.ok(/HelloGen.f/.test(o))
15-
16-
14+
assert.ok(/HelloGen.f/.test(o));

Diff for: jscomp/build_tests/case3/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"name": "case3",
33
"version": "0.1.0",
44
"scripts": {
5-
"clean": "bsb -clean-world",
6-
"build": "bsb -make-world",
7-
"watch": "bsb -make-world -w"
5+
"clean": "rescript clean -with-deps",
6+
"build": "rescript build",
7+
"watch": "rescript build -w"
88
},
99
"keywords": [
1010
"BuckleScript"

Diff for: jscomp/build_tests/custom_namespace/input.js

+12-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
var child_process = require('child_process')
2-
var fs = require('fs')
3-
var path = require('path')
4-
var assert = require('assert')
1+
var child_process = require("child_process");
2+
var fs = require("fs");
3+
var path = require("path");
4+
var assert = require("assert");
55

6-
child_process.execSync(`bsb -clean-world && bsb -make-world`, {cwd:__dirname, stdio:[0,1,2]})
6+
child_process.execSync(`rescript clean -with-deps && rescript build`, {
7+
cwd: __dirname,
8+
stdio: [0, 1, 2],
9+
});
710

8-
var x = require('./src/demo.bs.js')
9-
assert.equal(x.v, 42 )
11+
var x = require("./src/demo.bs.js");
12+
assert.equal(x.v, 42);
1013

11-
var merlin = fs.readFileSync(path.join(__dirname,'.merlin'), 'utf8')
12-
assert.ok(merlin.includes('-open Foo_bar'))
14+
var merlin = fs.readFileSync(path.join(__dirname, ".merlin"), "utf8");
15+
assert.ok(merlin.includes("-open Foo_bar"));

Diff for: jscomp/build_tests/custom_namespace/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"name": "namespace",
33
"version": "0.1.0",
44
"scripts": {
5-
"clean": "bsb -clean-world",
6-
"build": "bsb -make-world",
7-
"watch": "bsb -make-world -w"
5+
"clean": "rescript clean -with-deps",
6+
"build": "rescript build",
7+
"watch": "rescript build -w"
88
},
99
"keywords": [
1010
"BuckleScript"

Diff for: jscomp/build_tests/customize_namespace/input.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
21
//@ts-check
32

4-
var cp = require('child_process')
5-
var assert = require('assert')
6-
cp.execSync(`bsb -make-world`, {cwd : __dirname, encoding : 'utf8'})
3+
var cp = require("child_process");
4+
var assert = require("assert");
5+
cp.execSync(`rescript build`, { cwd: __dirname, encoding: "utf8" });
76

8-
assert.equal(require('./src/demo.bs').v,5)
7+
assert.equal(require("./src/demo.bs").v, 5);

Diff for: jscomp/build_tests/customize_namespace/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"name": "a0003",
33
"version": "0.1.0",
44
"scripts": {
5-
"clean": "bsb -clean-world",
6-
"build": "bsb -make-world",
7-
"watch": "bsb -make-world -w"
5+
"clean": "rescript clean -with-deps",
6+
"build": "rescript build",
7+
"watch": "rescript build -w"
88
},
99
"keywords": [
1010
"BuckleScript"

Diff for: jscomp/build_tests/cycle/input.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
var cp = require("child_process");
33
var assert = require("assert");
44

5-
var output = cp.spawnSync(`bsb`, { encoding: "utf8" ,shell:true});
5+
var output = cp.spawnSync(`rescript`, { encoding: "utf8", shell: true });
66

7-
8-
assert(/dependency cycle/.test(output.stdout))
7+
assert(/dependency cycle/.test(output.stdout));

Diff for: jscomp/build_tests/cycle/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"name": "cycle",
33
"version": "0.1.0",
44
"scripts": {
5-
"clean": "bsb -clean-world",
6-
"build": "bsb -make-world",
7-
"watch": "bsb -make-world -w"
5+
"clean": "rescript clean -with-deps",
6+
"build": "rescript build",
7+
"watch": "rescript build -w"
88
},
99
"keywords": [
1010
"BuckleScript"

Diff for: jscomp/build_tests/dev/input.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@ts-check
2-
var assert = require('assert')
3-
var path = require('path')
4-
var p = require('child_process')
5-
p.execSync(`bsb -make-world`, {cwd:__dirname,shell:true,encoding:'utf8'})
6-
var u = require("./examples/test.js")
7-
assert.equal(path.basename(u.v),'demo.mldemo.ml')
2+
var assert = require("assert");
3+
var path = require("path");
4+
var p = require("child_process");
5+
p.execSync(`rescript build`, { cwd: __dirname, shell: true, encoding: "utf8" });
6+
var u = require("./examples/test.js");
7+
assert.equal(path.basename(u.v), "demo.mldemo.ml");

Diff for: jscomp/build_tests/dev/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"name": "dev",
33
"version": "0.1.0",
44
"scripts": {
5-
"clean": "bsb -clean-world",
6-
"build": "bsb -make-world",
7-
"watch": "bsb -make-world -w"
5+
"clean": "rescript clean -with-deps",
6+
"build": "rescript build",
7+
"watch": "rescript build -w"
88
},
99
"keywords": [
1010
"BuckleScript"

Diff for: jscomp/build_tests/devdeps/input.js

+20-18
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,26 @@ var assert = require("assert");
55
var targetOne = `test/test.cmj`;
66
var targetTwo = `src/demo.cmj`;
77

8-
cp.exec(`bsb -- -t commands ${targetOne}`, { encoding: "ascii" }, function(
9-
err,
10-
output
11-
) {
12-
if (err !== null) {
13-
console.error("unexpected");
14-
throw err;
8+
cp.exec(
9+
`rescript build -- -t commands ${targetOne}`,
10+
{ encoding: "ascii" },
11+
function (err, output) {
12+
if (err !== null) {
13+
console.error("unexpected");
14+
throw err;
15+
}
16+
assert(output.split("\n").some((x) => x.includes("weird")));
1517
}
16-
assert(output.split("\n").some(x => x.includes("weird")));
17-
});
18+
);
1819

19-
cp.exec(`bsb -- -t commands ${targetTwo}`, { encoding: "ascii" }, function(
20-
err,
21-
output
22-
) {
23-
if (err !== null) {
24-
console.error("unexpected");
25-
throw err;
20+
cp.exec(
21+
`rescript build -- -t commands ${targetTwo}`,
22+
{ encoding: "ascii" },
23+
function (err, output) {
24+
if (err !== null) {
25+
console.error("unexpected");
26+
throw err;
27+
}
28+
assert(output.split("\n").some((x) => x.includes("weird")) === false);
2629
}
27-
assert(output.split("\n").some(x => x.includes("weird")) === false);
28-
});
30+
);

Diff for: jscomp/build_tests/devdeps/node_modules/weird/bsconfig.json

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: jscomp/build_tests/devdeps/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"name": "devdeps",
33
"version": "0.1.0",
44
"scripts": {
5-
"clean": "bsb -clean-world",
6-
"build": "bsb -make-world",
7-
"watch": "bsb -make-world -w"
5+
"clean": "rescript clean -with-deps",
6+
"build": "rescript build",
7+
"watch": "rescript build -w"
88
},
99
"keywords": [
1010
"BuckleScript"

Diff for: jscomp/build_tests/devonly/input.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
21
//@ts-check
32
var cp = require("child_process");
43

5-
cp.execSync(`bsb`,{cwd:__dirname,encoding:'utf8'})
4+
cp.execSync(`rescript`, { cwd: __dirname, encoding: "utf8" });

Diff for: jscomp/build_tests/devonly/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"name": "devonly",
33
"version": "0.1.0",
44
"scripts": {
5-
"clean": "bsb -clean-world",
6-
"build": "bsb -make-world",
7-
"watch": "bsb -make-world -w"
5+
"clean": "rescript clean -with-deps",
6+
"build": "rescript build",
7+
"watch": "rescript build -w"
88
},
99
"keywords": [
1010
"BuckleScript"

Diff for: jscomp/build_tests/duplicated_symlinked_packages/a/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"name": "a",
33
"version": "0.1.0",
44
"scripts": {
5-
"build": "bsb -make-world",
6-
"start": "bsb -make-world -w",
7-
"clean": "bsb -clean-world"
5+
"build": "rescript build",
6+
"start": "rescript build -w",
7+
"clean": "rescript clean -with-deps"
88
},
99
"keywords": [
1010
"BuckleScript"

Diff for: jscomp/build_tests/duplicated_symlinked_packages/b/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"name": "b",
33
"version": "0.1.0",
44
"scripts": {
5-
"build": "bsb -make-world",
6-
"start": "bsb -make-world -w",
7-
"clean": "bsb -clean-world"
5+
"build": "rescript build",
6+
"start": "rescript build -w",
7+
"clean": "rescript clean -with-deps"
88
},
99
"keywords": [
1010
"BuckleScript"

Diff for: jscomp/build_tests/duplicated_symlinked_packages/c/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"name": "z",
33
"version": "0.1.0",
44
"scripts": {
5-
"build": "bsb -make-world",
6-
"start": "bsb -make-world -w",
7-
"clean": "bsb -clean-world"
5+
"build": "rescript build",
6+
"start": "rescript build -w",
7+
"clean": "rescript clean -with-deps"
88
},
99
"keywords": [
1010
"BuckleScript"

Diff for: jscomp/build_tests/duplicated_symlinked_packages/input.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function postProcessErrorOutput (output) {
1212
return output
1313
}
1414

15-
child_process.exec('bsb -clean -make-world', {cwd: __dirname}, (err, stdout, stderr) => {
15+
child_process.exec('rescript clean -with-deps && rescript', {cwd: __dirname}, (err, stdout, stderr) => {
1616
const actualErrorOutput = postProcessErrorOutput(stderr.toString())
1717
if (updateTests) {
1818
fs.writeFileSync(expectedFilePath, actualErrorOutput)

0 commit comments

Comments
 (0)