[gui-test] add an optional prepare gant script to setup environment

This script is needed to perform a custom shell script to setup environment before running tests, e.g. to start X server for UI tests.
This commit is contained in:
Sergey Karashevich
2018-01-25 21:20:25 +03:00
parent c30874621c
commit 33f706e88d
+33
View File
@@ -0,0 +1,33 @@
/*
* Copyright 2000-2018 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.
*/
includeTargets << new File("tests_in_community.gant")
includeTool << gant.tools.Execute
/**
* Configures environment by running a shell script delegating by system property "gant.prepare.test.script" and than runs an default target
* in tests_in_community.gant
*/
target(prepare: "Prepare tests environment") {
def uiScript = System.getProperty("gant.prepare.test.script")
echo message: 'Preparing tests environment... '
echo message: " Running shell script \"$uiScript\""
execute.shell(uiScript)
"default"()
}
setDefaultTarget(prepare)