forked from ysb33r/gnumake-gradle-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for noExecArgs. Fixed unit test failure
- Loading branch information
Showing
8 changed files
with
131 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
src/test/groovy/org/ysb33r/gradle/gnumake/RunMakeSpec.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// | ||
// ============================================================================ | ||
// (C) Copyright Schalk W. Cronje 2013-2015 | ||
// | ||
// This software is licensed under the Apache License 2.0 | ||
// See http://www.apache.org/licenses/LICENSE-2.0 for license details | ||
// | ||
// Unless required by applicable law or agreed to in writing, software distributed under the License is | ||
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and limitations under the License. | ||
// | ||
// ============================================================================ | ||
// | ||
|
||
package org.ysb33r.gradle.gnumake | ||
|
||
import org.gradle.api.Project | ||
import org.gradle.internal.os.OperatingSystem | ||
import org.gradle.testfixtures.ProjectBuilder | ||
import spock.lang.Specification | ||
|
||
|
||
/** | ||
* @author Schalk W. Cronjé | ||
*/ | ||
class RunMakeSpec extends Specification { | ||
|
||
static final File MAKESCRIPT = new File( "src/test/resources/fake-make-scripts/${OperatingSystem.current().isWindows() ? 'fake-make.bat' : 'fake-make.sh'}" ) | ||
Project project = ProjectBuilder.builder().build() | ||
|
||
void captureStdOut() { | ||
} | ||
|
||
|
||
def "Check that Make is invoked with the correct arguments"() { | ||
given: | ||
def systemOut = new ByteArrayOutputStream() | ||
System.out = new PrintStream(systemOut) | ||
|
||
project.allprojects { | ||
apply plugin : 'org.ysb33r.gnumake' | ||
|
||
gnumake { | ||
executable MAKESCRIPT.absolutePath | ||
} | ||
|
||
make { | ||
flags DESTDIR : 'foo/bar' | ||
targets 'build','install' | ||
} | ||
} | ||
|
||
project.evaluate() | ||
project.tasks.make.execute() | ||
String output = systemOut.toString() | ||
|
||
expect: | ||
output.contains('fake-make build install DESTDIR=foo/bar') | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,4 @@ | |
@REM | ||
|
||
@echo off | ||
echo %1 %2 %3 %4 %5 %6 %7 %8 %9 | ||
echo fake-make %1 %2 %3 %4 %5 %6 %7 %8 %9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,4 @@ | |
# ============================================================================ | ||
# | ||
|
||
echo $@ | ||
echo fake-make $@ |