Skip to content
Permalink
Browse files

Test case for issue #385 (PCTCompile)

  • Loading branch information
gquerret committed Nov 21, 2019
1 parent de4b3e1 commit a6cf3714389b8103095dd6d96efa9a08dd302387
@@ -1279,6 +1279,30 @@ public void test80() {
assertTrue(f3.exists());
}

@Test(groups = {"v11"})
public void test81() {
configureProject(BASEDIR + "test81/build.xml");
executeTarget("init");

executeTarget("test1");
File f1 = new File(BASEDIR + "test81/build1/rssw/Class1.r");
assertTrue(f1.exists());
File f2 = new File(BASEDIR + "test81/build1/prgs/Internal.r");
assertTrue(f2.exists());

executeTarget("test2");
File f3 = new File(BASEDIR + "test81/build2/rssw/Class1.r");
assertTrue(f3.exists());
File f4 = new File(BASEDIR + "test81/build2/prgs/Internal.r");
assertTrue(f4.exists());

executeTarget("test3");
File f5 = new File(BASEDIR + "test81/build3/rssw/Class1.r");
assertTrue(f5.exists());
File f6 = new File(BASEDIR + "test81/build3/prgs/Internal.r");
assertTrue(f6.exists());
}

@Test(groups = {"v10"})
public void test101() {
configureProject(BASEDIR + "test101/build.xml");
@@ -1329,4 +1329,28 @@ public void test80() {
assertTrue(f3.exists());
}

@Test(groups = {"v11"})
public void test81() {
configureProject(BASEDIR + "test81/build.xml");
executeTarget("init");

executeTarget("test1");
File f1 = new File(BASEDIR + "test81/build1/rssw/Class1.r");
assertTrue(f1.exists());
File f2 = new File(BASEDIR + "test81/build1/prgs/Internal.r");
assertTrue(f2.exists());

executeTarget("test2");
File f3 = new File(BASEDIR + "test81/build2/rssw/Class1.r");
assertTrue(f3.exists());
File f4 = new File(BASEDIR + "test81/build2/prgs/Internal.r");
assertTrue(f4.exists());

executeTarget("test3");
File f5 = new File(BASEDIR + "test81/build3/rssw/Class1.r");
assertTrue(f5.exists());
File f6 = new File(BASEDIR + "test81/build3/prgs/Internal.r");
assertTrue(f6.exists());
}

}
@@ -0,0 +1,6 @@
COMPILE "prgs/Internal.cls" SAVE INTO "build4" OPTIONS "require-field-qualifiers".
MESSAGE SUBSTITUTE("Error &1 - Num messages &2 - Warnings &3", COMPILER:ERROR, COMPILER:NUM-MESSAGES, COMPILER:WARNING).
COMPILE "rssw/Class1.cls" SAVE INTO "build4" OPTIONS "require-field-qualifiers".
MESSAGE SUBSTITUTE("Error &1 - Num messages &2 - Warnings &3", COMPILER:ERROR, COMPILER:NUM-MESSAGES, COMPILER:WARNING).

RETURN '0'.
@@ -0,0 +1,66 @@
<?xml version="1.0"?>
<project name="PCTCompile-test81">
<taskdef resource="PCT.properties" />

<target name="init">
<mkdir dir="db" />
<sports2000 destDir="db" dbName="sp2k1" />
<sports2000 destDir="db" dbName="sp2k2" />
<PCTLoadSchema srcFile="delta.df" dlcHome="${DLC}">
<DBConnection dbDir="db" dbName="sp2k2" singleUser="true" />
</PCTLoadSchema>
</target>

<target name="test1">
<mkdir dir="build1" />
<PCTCompile graphicalMode="false" destDir="build1" dlcHome="${DLC}">
<fileset dir="src" includes="**/*.cls" />
<propath location="src" />
<DBConnection dbDir="db" dbName="sp2k1" singleUser="true" />
</PCTCompile>
</target>

<target name="test2">
<mkdir dir="build2" />
<PCTCompile graphicalMode="false" destDir="build2" dlcHome="${DLC}">
<fileset dir="src" includes="**/*.cls" />
<propath location="src" />
<DBConnection dbDir="db" dbName="sp2k2" singleUser="true" />
</PCTCompile>
</target>

<target name="test3">
<mkdir dir="build3" />
<PCTCompile graphicalMode="false" destDir="build3" dlcHome="${DLC}" requireFieldQualifiers="true">
<fileset dir="src" includes="**/*.cls" />
<propath location="src" />
<DBConnection dbDir="db" dbName="sp2k2" singleUser="true" />
</PCTCompile>
</target>

<target name="test3-bis">
<mkdir dir="build3" />
<PCTCompile graphicalMode="false" destDir="build3" dlcHome="${DLC}">
<Option name="-compileroptionsfile" value="options.txt" />
<fileset dir="src" includes="**/*.cls" />
<propath location="src" />
<DBConnection dbDir="db" dbName="sp2k2" singleUser="true" />
</PCTCompile>
</target>

<target name="test4">
<mkdir dir="build4" />
<PCTRun graphicalMode="false" dlcHome="${DLC}" procedure="build.p">
<propath location="src" />
<DBConnection dbDir="db" dbName="sp2k2" singleUser="true" />
</PCTRun>
</target>

<target name="test5">
<mkdir dir="build4" />
<exec executable="${DLC}\bin\_progres.exe">
<arg line="-b -db db/sp2k2 -1 -p wrapper.p" />
</exec>
</target>

</project>
@@ -0,0 +1,9 @@
ADD FIELD "InternalName" OF "customer" AS integer
FORMAT "9"
INITIAL "0"
LABEL "Fld1"
POSITION 20
SQL-WIDTH 4
COLUMN-LABEL "Fld1"
ORDER 10

@@ -0,0 +1,3 @@
require-full-names,
require-field-qualifiers

@@ -0,0 +1 @@
ASSIGN propath = "src," + PROPATH.
@@ -0,0 +1,8 @@
class prgs.Internal:

method public static void StaticMethod1():
message "xyz".
end method.

end.

@@ -0,0 +1,11 @@
using prgs.Internal.

class rssw.Class1:

method private void mthd1():
find first customer no-lock.
if true then Internal:StaticMethod1().
end method.

end class.

@@ -0,0 +1,4 @@
RUN propath.p.
RUN build.p.

RETURN '0'.

0 comments on commit a6cf371

Please sign in to comment.
You can’t perform that action at this time.