From 7ba9ae7b0da5e653f2fbc76da5581e1bb939c2e6 Mon Sep 17 00:00:00 2001 From: Gabriel Schulhof Date: Mon, 16 Jun 2014 10:06:10 +0300 Subject: [PATCH] Build: Allow one to specify a specific test file within a suite Fixes gh-7506 --- Gruntfile.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index b570958d718..757c02008a3 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -841,11 +841,20 @@ module.exports = function( grunt ) { .forEach( function( suite ) { testDirs.forEach( function( dir ) { dir = "tests/" + dir; - patterns = patterns.concat([ - dir + "/" + suite + "/index.html", - dir + "/" + suite + "/*/index.html", - dir + "/" + suite + "/**/*-tests.html" - ]); + + if ( suite.indexOf( "/" ) >= 0 ) { + + // If the suite is a path, then append it exactly + patterns.push( dir + "/" + suite ); + } else { + + // If not, append all patterns we care about + patterns = patterns.concat([ + dir + "/" + suite + "/index.html", + dir + "/" + suite + "/*/index.html", + dir + "/" + suite + "/**/*-tests.html" + ]); + } }); });