Logo QF-Test

Finding valuable answers
in the Mailing List Archive.


Free Trial  Download  Buy

Thomas Max, QF-Test training and support

Use the full-text search on our web site to find helpful tips on the mailing list.

Thomas Max, 
Sr. Software Engineer & Trainer, QFS

2017 up to now  | 2016 | 2015 | 2014 | 2013 | 2012 | 2011 | 2010 | 2009 | 2008 | 2007

(older archive entries before 2007 are not shown here, but included in the onsite-search)

Mailing List - Entries of 2012

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[QF-Test] QF-Test and Gradle...

  • Subject: [QF-Test] QF-Test and Gradle...
  • From: "Berg, Klaus-Peter" <klaus-peter.berg@?.com>
  • Date: Wed, 28 Mar 2012 18:31:24 +0200

Hi all,
does anyone has experience in using the build system Gradle to run QF-Test suites and to check the process result return value?
Gradle's marketing [http://www.gradle.org]  tells us: "Gradle is build automation evolved.
Gradle combines the power and flexibility of Ant with the dependency management and conventions of Maven into a more effective way to build.
Powered by a Groovy DSL..."
Especially the possibility to integrate QF-Test suite execution with Groovy -- that is already a QF-Test scripting language - could make this approach interesting.
However, I'm not sure if my first Gradle solution is really an optimal solution.
So, perhaps other QF-Test users have ideas or comments ...
Best regards
Klaus Peter Berg
 QF-Test GRADLE build file for Windows OS.
defaultTasks 'runAllTests'
def basedir = "."
def logdir = "$basedir"
def suite = "../../Test_Suites/AllTests"
def testcase = "Run all tests"
def reportDir = "$basedir/report"
def qftest = null
env = System.getenv()
task checkProperties {
    if (!env.QFTEST_HOME) {
        throw new Exception("No Windows environment variable 'QFTEST_HOME' found!")
    qftest = "${env.QFTEST_HOME}/bin/qftest.exe"

task runAllTests(dependsOn: 'checkProperties') {
    def reportDirFile = new File(reportDir)
    if (reportDirFile.exists()) {
        reportDirFile.deleteDir() // delete directory with all it's subdirectories and files
    else {
    def result = 0
    try {
        result = exec {
            executable = qftest
            args = ['-J-Duser.language=en', '-batch', '-runlog', "$logdir/+b", '-report', reportDir, '-test', testcase, "${suite}.qft"]
    catch (org.gradle.process.internal.ExecException ex) {
        def regex = /^.+finished with \(non-zero\) exit value ([1-3])\.$/
        def matcher = (ex.message =~ regex)
        def exitCode = matcher[0][1]
        switch (exitCode) {
            case '1': println "\nTest terminated with warnings."
            case '2': println "\nTest terminated with errors!"
            case '3': println "\nTest terminated with exceptions!"
                println "Test result undetermined: $exitCode"
    if (result == 0) {
        println "Test terminated successfully."

Videos Downloads Documentation Buy Free Trial