Skip to content

Commit a67a171

Browse files
committed
Only run test files starting with "test_".
1 parent 2f2828e commit a67a171

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

support/run/brun.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ function getFileNames (dir) {
1717
files.forEach((file) => {
1818
let fullname = path.resolve(dir, file);
1919
let stat = fs.statSync(fullname);
20+
let basename = path.basename(file, ".py");
2021

21-
if (stat.isFile() && (path.extname(file) == "\.py")) {
22+
if (stat.isFile() && basename.startsWith("test_") && (path.extname(file) == ".py")) {
2223
filelist.push(dir + '/' + file);
2324
}
2425
});

test/testunit.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,15 @@ function test (python3, opt) {
4444
files.forEach((file) => {
4545
let fullname = dir + "/" + file;
4646
let stat = fs.statSync(fullname);
47+
let basename = path.basename(file, ".py");
4748

48-
if (stat.isFile() && (path.extname(file) == "\.py")) {
49+
if (stat.isFile() && basename.startsWith("test_") && (path.extname(file) == ".py")) {
4950
buf = "";
5051
console.log(fullname);
5152

5253
// Run Skulpt
5354
Sk.misceval.asyncToPromise(function() {
54-
return Sk.importMain(path.basename(file, ".py"), false, true);
55+
return Sk.importMain(basename, false, true);
5556
}).then(function () {}, function(e) {
5657
failTot += 1;
5758
console.log("UNCAUGHT EXCEPTION: " + e);
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)