Skip to content

Commit 8c1fcf8

Browse files
erakaxic
authored andcommitted
Use smoke test with CLI
And not the DAO sources
1 parent 54e9352 commit 8c1fcf8

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

test/cli.js

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
const tape = require('tape');
22
const spawn = require('tape-spawn');
33
const pkg = require('../package.json');
4-
const semver = require('semver');
5-
6-
var daodir;
7-
if (semver.lt(pkg.version, '0.5.0')) {
8-
daodir = 'DAO040';
9-
} else {
10-
daodir = 'DAO';
11-
}
124

135
tape('CLI', function (t) {
146
t.test('--version', function (st) {
@@ -25,13 +17,13 @@ tape('CLI', function (t) {
2517
});
2618

2719
t.test('no mode specified', function (st) {
28-
var spt = spawn(st, './solcjs test/' + daodir + '/Token.sol');
20+
var spt = spawn(st, './solcjs test/contracts/Smoke.sol');
2921
spt.stderr.match(/^Invalid option selected/);
3022
spt.end();
3123
});
3224

3325
t.test('--bin', function (st) {
34-
var spt = spawn(st, './solcjs --bin test/' + daodir + '/Token.sol');
26+
var spt = spawn(st, './solcjs --bin test/contracts/Smoke.sol');
3527
spt.stderr.empty();
3628
spt.succeeds();
3729
spt.end();
@@ -50,14 +42,14 @@ tape('CLI', function (t) {
5042
});
5143

5244
t.test('--abi', function (st) {
53-
var spt = spawn(st, './solcjs --abi test/' + daodir + '/Token.sol');
45+
var spt = spawn(st, './solcjs --abi test/contracts/Smoke.sol');
5446
spt.stderr.empty();
5547
spt.succeeds();
5648
spt.end();
5749
});
5850

5951
t.test('--bin --abi', function (st) {
60-
var spt = spawn(st, './solcjs --bin --abi test/' + daodir + '/Token.sol');
52+
var spt = spawn(st, './solcjs --bin --abi test/contracts/Smoke.sol');
6153
spt.stderr.empty();
6254
spt.succeeds();
6355
spt.end();

test/contracts/Smoke.sol

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
contract C {
2+
function f() public returns (uint) {
3+
return 0;
4+
}
5+
}

0 commit comments

Comments
 (0)