Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/run_pass/test_fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var fs = require('fs');
var assert = require('assert');


var fileName = "../resources/greeting.txt";
var fileName = "resources/greeting.txt";
var expectedContents = "Hello IoT.js!!";
var flags = "r";
var mode = 438;
Expand Down
4 changes: 2 additions & 2 deletions test/run_pass/test_fs1.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ var fs = require('fs');
var assert = require('assert');


var srcFilePath = "../resources/test1.txt";
var dstFilePath = "../tmp/test_fs1.txt";
var srcFilePath = "resources/test1.txt";
var dstFilePath = "tmp/test_fs1.txt";

try {
var fd1 = fs.openSync(srcFilePath, 'r');
Expand Down
4 changes: 2 additions & 2 deletions test/run_pass/test_fs2.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ var fs = require('fs');
var assert = require('assert');


var srcFilePath = "../resources/test1.txt";
var dstFilePath = "../tmp/test_fs2.txt";
var srcFilePath = "resources/test1.txt";
var dstFilePath = "tmp/test_fs2.txt";

var data;

Expand Down
4 changes: 2 additions & 2 deletions test/run_pass/test_fs_exists.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ var fs = require('fs');
var assert = require('assert');

{
var filePath = "../resources/tobeornottobe.txt";
var filePath = "resources/tobeornottobe.txt";

fs.exists(filePath, function(exists) {
assert.equal(exists, true);
});
}

{
var filePath = "../resources/empty.txt";
var filePath = "resources/empty.txt";

fs.exists(filePath, function(exists) {
assert.equal(exists, false);
Expand Down
4 changes: 2 additions & 2 deletions test/run_pass/test_fs_existssync.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ var fs = require('fs');
var assert = require('assert');

{
var filePath = "../resources/tobeornottobe.txt";
var filePath = "resources/tobeornottobe.txt";

var result = fs.existsSync(filePath);
assert.equal(result, true);
}

{
var filePath = "../resources/empty.txt";
var filePath = "resources/empty.txt";

var result = fs.existsSync(filePath);
assert.equal(result, false);
Expand Down
6 changes: 3 additions & 3 deletions test/run_pass/test_fs_mkdir_rmdir.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ function unlink(path) {
}

{
var root = "../resources/test_dir";
var sub1 = "../resources/test_dir/file1";
var sub2 = "../resources/test_dir/file2";
var root = "resources/test_dir";
var sub1 = "resources/test_dir/file1";
var sub2 = "resources/test_dir/file2";

unlink(sub1);
unlink(sub2);
Expand Down
2 changes: 1 addition & 1 deletion test/run_pass/test_fs_open_close.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var fs = require('fs');
var assert = require('assert');


var fileName = "../resources/greeting.txt";
var fileName = "resources/greeting.txt";


// test sync open & close.
Expand Down
2 changes: 1 addition & 1 deletion test/run_pass/test_fs_readdir.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
var fs = require('fs');
var assert = require('assert');

var path = '../resources/readdir'
var path = 'resources/readdir'
var ans = 'DO_NOT_MODIFY_THIS_FOLDER\n'+
'This_is_a_directory\n'+
'This_is_another_directory\n'+
Expand Down
2 changes: 1 addition & 1 deletion test/run_pass/test_fs_readfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
var fs = require('fs');
var assert = require('assert');

var filePath = "../resources/tobeornottobe.txt";
var filePath = "resources/tobeornottobe.txt";

fs.readFile(filePath, function(err, data) {
assert.equal(err, null);
Expand Down
2 changes: 1 addition & 1 deletion test/run_pass/test_fs_readfilesync.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
var fs = require('fs');
var assert = require('assert');

var filePath = "../resources/tobeornottobe.txt";
var filePath = "resources/tobeornottobe.txt";

var data = fs.readFileSync(filePath);

Expand Down
4 changes: 2 additions & 2 deletions test/run_pass/test_fs_rename.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
var fs = require('fs');
var assert = require('assert');

var file1 = "../resources/rename.txt";
var file2 = "../resources/rename.txt.async";
var file1 = "resources/rename.txt";
var file2 = "resources/rename.txt.async";

fs.rename(file1, file2, function(err) {
assert.equal(err, null);
Expand Down
4 changes: 2 additions & 2 deletions test/run_pass/test_fs_rename_sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
var fs = require('fs');
var assert = require('assert');

var file1 = "../resources/rename.txt";
var file2 = "../resources/rename.txt.sync";
var file1 = "resources/rename.txt";
var file2 = "resources/rename.txt.sync";

fs.renameSync(file1, file2);
assert.equal(fs.existsSync(file1), false);
Expand Down
8 changes: 4 additions & 4 deletions test/run_pass/test_fs_stat.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ var fs = require('fs');
var assert = require('assert');


var stats1 = fs.statSync('test_fs_stat.js');
var stats1 = fs.statSync('run_pass/test_fs_stat.js');
assert.equal(stats1.isFile(), true);
assert.equal(stats1.isDirectory(), false);

fs.stat('test_fs_stat.js', function(err, stats) {
fs.stat('run_pass/test_fs_stat.js', function(err, stats) {
if (!err) {
assert.equal(stats.isFile(), true);
assert.equal(stats.isDirectory(), false);
Expand All @@ -33,11 +33,11 @@ fs.stat('test_fs_stat.js', function(err, stats) {
});


var stats2 = fs.statSync('../resources');
var stats2 = fs.statSync('resources');
assert.equal(stats2.isDirectory(), true);
assert.equal(stats2.isFile(), false);

fs.stat('../resources', function(err, stats) {
fs.stat('resources', function(err, stats) {
if (!err) {
assert.equal(stats.isDirectory(), true);
assert.equal(stats.isFile(), false);
Expand Down
4 changes: 2 additions & 2 deletions test/run_pass/test_fs_writefile_unlink.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
var fs = require('fs');
var assert = require('assert');

var file1 = "../resources/tobeornottobe.txt";
var file2 = "../resources/tobeornottobe_async.txt";
var file1 = "resources/tobeornottobe.txt";
var file2 = "resources/tobeornottobe_async.txt";

fs.readFile(file1, function(err, buf1) {
assert.equal(err, null);
Expand Down
4 changes: 2 additions & 2 deletions test/run_pass/test_fs_writefile_unlink_sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
var fs = require('fs');
var assert = require('assert');

var file1 = "../resources/tobeornottobe.txt";
var file2 = "../resources/tobeornottobe_sync.txt";
var file1 = "resources/tobeornottobe.txt";
var file2 = "resources/tobeornottobe_sync.txt";

/* make a new file2 from file1 */
var buf1 = fs.readFileSync(file1);
Expand Down
4 changes: 2 additions & 2 deletions test/run_pass/test_module_cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

var assert = require('assert');

var module_cache = require('require1/module_cache.js');
var module_cache = require('run_pass/require1/module_cache.js');
module_cache.i = 100;
module_cache = require('require1/module_cache.js');
module_cache = require('run_pass/require1/module_cache.js');

assert.equal(module_cache.i, 100);
8 changes: 4 additions & 4 deletions tools/check_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ Driver.prototype.runNextTest = function() {
this.finish();
} else {
if (this.fIdx == this.fLength) {
process.chdir(this.root);
this.dIdx++;
if (this.dIdx == this.dLength) {
this.finish();
Expand Down Expand Up @@ -176,7 +175,6 @@ Driver.prototype.nextTestSet = function(skipped) {

var dirname = this.dirname();
this.fLength = this.tests[dirname].length;
process.chdir(util.absolutePath(dirname));
this.logger.message("\n");
this.logger.message(">>>> " + dirname, "summary");
};
Expand All @@ -192,8 +190,10 @@ Driver.prototype.currentTest = function() {

Driver.prototype.test = function() {
var test = this.currentTest();
var content = fs.readFileSync(util.absolutePath(test['name'])).toString();
return content;
var dirname = this.dirname();
var testfile = util.absolutePath(util.join(dirname, test['name']));

return fs.readFileSync(testfile).toString();
};

Driver.prototype.finish = function() {
Expand Down