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
10 changes: 0 additions & 10 deletions plugins/generate-tests/prepare-test-schema/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const TestXmlGenerator = require('./helpers/test-xml-generator');

const IGNORED_TEST_FILES_PATH_PATTERN = '/components/**/_tests/**/*_*.brs';
const MAIN_FILE_LOCATION = '/source/Main.brs';
const TEST_FILE_NAME_REGEX = /[^/]+(?=\.test\.brs)/;
const TEST_FILES_PATH_PATTERN = '/components/**/_tests/**/*.test.brs';
const TESTS_LOCATION = '/components/tests/auto-generated/';

Expand All @@ -33,15 +32,6 @@ module.exports = async function prepareTestSchema(dir) {
);
}

function _matchesPattern(str, pattern) {
const regex = new RegExp(
'^' + pattern.replace(/[.+^${}()|[\]\\]/g, '\\$&').replace(/\*/g, '.*').replace(/\?/g, '.') + '$',
'i',
);

return regex.test(str);
}

async function prepareSchema(testFilePath, testXmlGenerator, rootDir) {
const testSchema = await TestSchema.load(testFilePath);
if (!testSchema) {
Expand Down
9 changes: 7 additions & 2 deletions src/source/UnitTestFramework.brs
Original file line number Diff line number Diff line change
Expand Up @@ -1711,8 +1711,13 @@ function TestRunner__Run(statObj = m.Logger.CreateTotalStatistic() as Object, te
if m.testsFilter.count() > 0
filteredNodes = []
for each testNodeName in testNodes
for each filterName in m.testsFilter
if testNodeName = filterName then filteredNodes.push(testNodeName)
for each filterPattern in m.testsFilter
regexStr = filterPattern.replace("*", ".*")
regex = CreateObject("roRegex", "^" + regexStr + "$", "i")
if regex.isMatch(testNodeName)
filteredNodes.push(testNodeName)
exit for
end if
end for
end for
testNodes = filteredNodes
Expand Down