Permalink
Browse files

Pass environment variables from PCTCompile to _progres

  • Loading branch information...
gquerret committed Oct 20, 2018
1 parent fdd212c commit 69e8fdff303762f94328a7bac4cf595f787660a4
@@ -22,6 +22,7 @@
import org.apache.tools.ant.types.Mapper;
import org.apache.tools.ant.types.Path;
import org.apache.tools.ant.types.ResourceCollection;
import org.apache.tools.ant.types.Environment.Variable;
import org.apache.tools.ant.util.FileNameMapper;
public class CompilationWrapper extends PCT implements IRunAttributes, ICompilationAttributes {
@@ -55,6 +56,9 @@ public void execute() {
((PCTCompile) pctTask).setRunAttributes(runAttributes);
((PCTCompile) pctTask).setCompilationAttributes(compAttributes);
}
for (Variable var : getEnvironmentVariables()) {
pctTask.addEnv(var);
}
pctTask.bindToOwner(this);
if (getDlcHome() != null) {
pctTask.setDlcHome(getDlcHome());
@@ -1152,6 +1152,14 @@ public void test73() {
assertPropertyEquals("test73Result2", "0");
}
@Test(groups = {"v10"})
public void test74() {
configureProject(BASEDIR + "test74/build.xml");
executeTarget("init");
executeTarget("test");
assertTrue(new File(BASEDIR + "test74/build/test.r").exists());
}
@Test(groups = {"v10"})
public void test101() {
configureProject(BASEDIR + "test101/build.xml");
@@ -1167,4 +1167,12 @@ public void test73() {
executeTarget("test2");
assertPropertyEquals("test73Result2", "0");
}
@Test(groups = {"v10"})
public void test74() {
configureProject(BASEDIR + "test74/build.xml");
executeTarget("init");
executeTarget("test");
assertTrue(new File(BASEDIR + "test74/build/test.r").exists());
}
}
@@ -401,4 +401,11 @@ public void test47() {
expectLog("test1", "Hello1");
expectLog("test2", "Hello2");
}
@Test(groups = {"v10"})
public void test48() {
configureProject("PCTRun/test48/build.xml");
executeTarget("test1");
expectBuildException("test2", "Invalid env variable");
}
}
@@ -0,0 +1,26 @@
<?xml version="1.0"?>
<project name="PCTCompile-test74">
<taskdef resource="PCT.properties" />
<target name="init">
<mkdir dir="db" />
<copy file="${DLC}/prolang/convmap/utf8-bas.wbt" tofile="utf8-custom.wbt" />
<exec dir="." executable="${DLC}/bin/_dbutil">
<arg line="-C wbreak-compiler utf8-custom.wbt 42" />
<env key="DLC" value="${DLC}" />
</exec>
<PCTCreateBase dbName="mydb" destDir="db" dlcHome="${DLC}" wordRules="42">
<env key="PROWD42" path="proword.42" />
</PCTCreateBase>
</target>
<target name="test">
<mkdir dir="build" />
<PCTCompile graphicalMode="false" destDir="build" dlcHome="${DLC}">
<DBConnection dbname="mydb" dbDir="db" readOnly="true" />
<fileset dir="src" includes="test.p" />
<env key="PROWD42" path="proword.42" />
<Profiler enabled="${PROFILER}" coverage="true" outputDir="profiler" />
</PCTCompile>
</target>
</project>
@@ -0,0 +1 @@
message "hello world".
@@ -0,0 +1,17 @@
<?xml version="1.0"?>
<project name="PCTRun-test48">
<taskdef resource="PCT.properties" />
<target name="test1">
<PCTRun graphicalMode="false" procedure="test.p" dlcHome="${DLC}">
<env key="TESTENV" value="ABCD" />
</PCTRun>
</target>
<target name="test2">
<PCTRun graphicalMode="false" procedure="test.p" dlcHome="${DLC}">
<env key="TESTENV" value="ABCDE" />
</PCTRun>
</target>
</project>
@@ -0,0 +1 @@
RETURN IF OS-GETENV("TESTENV") = "ABCD" THEN "0" ELSE "1".

0 comments on commit 69e8fdf

Please sign in to comment.