8000 Adding travis. `npm test` now runs benchmark.js · shelljs/benchmarks@5a2c658 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5a2c658

Browse files
committed
Adding travis. npm test now runs benchmark.js
1 parent 3449552 commit 5a2c658

File tree

5 files changed

+24
-10
lines changed

5 files changed

+24
-10
lines changed

.travis.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
language: node_js
2+
sudo: false
3+
node_js: "5"
4+
os:
5+
- linux
6+
7+
# blacklist
8+
branches:
9+
except:
10+
- gh-pages
11+
12+
install:
13+
- node --version
14+
- npm install

benchmark.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function printSystemInfo() {
4242
writeLog(' - V8: ' + process.versions.v8);
4343
writeLog();
4444
writeLog('## Shell Information:');
45-
writeLog(' - name: `' + exec('bash -c \'echo ${SHELL}\'', {silent: true}).stdout + '`');
45+
writeLog(' - name: `' + exec('bash -c \'echo ${SHELL}\'', {silent: true}).stdout.trim() + '`');
4646
writeLog(' - version: ' + exec('bash --version', {silent: true}).stdout.replace(/\n+/g, '\n'));
4747
}
4848

@@ -76,13 +76,13 @@ ls().forEach(function (dir) {
7676
config.silent = true;
7777

7878
start_time = new Date().getTime();
79-
js_output = exec('node ' + jsfile).output;
79+
js_output = exec('node ' + jsfile).stdout;
8080
end_time = new Date().getTime();
8181
js_time = end_time - start_time;
8282
writeLog(' - [ShellJS] took `' + js_time + '` milliseconds', prefix + '/' + jsfile);
8383

8484
start_time = new Date().getTime();
85-
shell_output = exec('bash ' + shfile).output;
85+
shell_output = exec('bash ' + shfile).stdout;
8686
end_time = new Date().getTime();
8787
shell_time = end_time - start_time;
8888
writeLog(' - [Bash] took `' + shell_time + '` milliseconds', prefix + '/' + shfile);

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
2-
"name": "jsbench",
2+
"name": "shelljsbenchmarks",
33
"version": "0.0.1",
44
"description": "Benchmark ShellJS scripts",
55
"main": "index.js",
66
"scripts": {
7-
"test": "echo \"Error: no test specified\" && exit 1"
7+
"test": "node benchmark.js"
88
},
99
"repository": {
1010
"type": "git",
11-
"url": "git+https://github.com/IvantheDugtrio/ShellJSBench.git"
11+
"url": "git+https://github.com/shelljs/benchmarks.git"
1212
},
1313
"keywords": [
1414
"ShellJS",
@@ -18,9 +18,9 @@
1818
"author": "",
1919
"license": "MIT",
2020
"bugs": {
21-
"url": "https://github.com/IvantheDugtrio/ShellJSBench/issues"
21+
"url": "https://github.com/shelljs/benchmarks/issues"
2222
},
23-
"homepage": "https://github.com/IvantheDugtrio/ShellJSBench#readme",
23+
"homepage": "https://github.com/shelljs/benchmarks#readme",
2424
"bin": {
2525
"benchmark": "./benchmark.js"
2626
},

scripts/envVariable/envVar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
require('shelljs/global');
2-
for (var k=0; k<100000; k++)
2+
for (var k=0; k<10000; k++)
33
echo(env.PATH);

scripts/envVariable/envVar.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/bash
2-
for k in `seq 100000`; do
2+
for k in `seq 10000`; do
33
echo "$PATH"
44
done

0 commit comments

Comments
 (0)
0