@@ -12,7 +12,7 @@ modification, are permitted provided that the following conditions are met:
1212 * Redistributions in binary form must reproduce the above copyright
1313 notice, this list of conditions and the following disclaimer in the
1414 documentation and/or other materials provided with the distribution.
15- * Neither the names of of the copyright holders nor the names of its
15+ * Neither the names of the copyright holders nor the names of its
1616 contributors may be used to endorse or promote products derived from
1717 this software without specific prior written permission.
1818
@@ -32,72 +32,96 @@ THE POSSIBILITY OF SUCH DAMAGE.
3232 xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
3333 xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
3434 <modelVersion >4.0.0</modelVersion >
35-
35+
3636 <parent >
3737 <groupId >org.javacc.generator.cpp</groupId >
3838 <artifactId >examples</artifactId >
3939 <version >1.1.0-SNAPSHOT</version >
4040 </parent >
41-
41+
4242 <groupId >org.javacc.generator.cpp.examples</groupId >
4343 <artifactId >corba-idl</artifactId >
4444 <packaging >nar</packaging >
4545
4646 <name >JavaCC C++ code generator / CORBA-IDL</name >
47-
47+
4848 <build >
4949 <plugins >
50-
50+
51+ <!-- clear the tests results files -->
52+ <plugin >
53+ <groupId >org.apache.maven.plugins</groupId >
54+ <artifactId >maven-clean-plugin</artifactId >
55+ <executions >
56+ <execution >
57+ <id >clear-res-test</id >
58+ <phase >process-test-resources</phase >
59+ <goals >
60+ <goal >clean</goal >
61+ </goals >
62+ <configuration >
63+ <excludeDefaultDirectories >true</excludeDefaultDirectories >
64+ <filesets >
65+ <fileset >
66+ <directory >files</directory >
67+ <includes >
68+ <include >*.out</include >
69+ <include >*.err</include >
70+ </includes >
71+ </fileset >
72+ </filesets >
73+ </configuration >
74+ </execution >
75+ </executions >
76+ </plugin >
77+
78+ <!-- test -->
5179 <plugin >
5280 <groupId >com.github.maven-nar</groupId >
5381 <artifactId >nar-maven-plugin</artifactId >
82+ <version >${nar-maven-plugin.version} </version >
5483 <extensions >true</extensions >
5584 <configuration >
85+ <skip >${skip.test.cpp.examples.CORBA-IDL} </skip > <!-- default false -->
5686 <libraries >
5787 <library >
5888 <type >executable</type >
5989 <run >true</run >
6090 <args >
61- <arg >${project.basedir} /idl/Hello.idl</arg >
62- <arg >${project.basedir} /idl/idl.in</arg >
63- <arg >${project.basedir} /idl/idl.out</arg >
64- <arg >${project.basedir} /idl/idl.err</arg >
91+ <arg >${project.basedir} /files/Hello.idl</arg >
92+ <arg >${project.basedir} /files/Hello.out</arg >
93+ <arg >${project.basedir} /files/Hello.err</arg >
6594 </args >
6695 </library >
6796 </libraries >
6897 </configuration >
6998 </plugin >
70-
99+
100+ <!-- check the tests results -->
71101 <plugin >
72102 <groupId >org.apache.maven.plugins</groupId >
73103 <artifactId >maven-antrun-plugin</artifactId >
74104 <executions >
75105 <execution >
76- <id >compare-out </id >
106+ <id >check-res-test </id >
77107 <phase >test</phase >
78108 <goals >
79109 <goal >run</goal >
80110 </goals >
81111 <configuration >
82- <target unless =" maven.test.skip" >
83- <available file =" ${project.basedir}/idl/idl.out" property =" isActualAvailable" />
84- <fail unless =" isActualAvailable"
85- message =" ${project.basedir}/idl/idl.out does not exist!" />
86- <available file =" ${project.basedir}/idl/idl.ref" property =" isExpectedAvailable" />
87- <fail unless =" isExpectedAvailable"
88- message =" ${project.basedir}/idl/idl.ref does not exist!" />
89- <condition property =" files.match" >
90- <filesmatch file1 =" ${project.basedir}/idl/idl.out"
91- file2 =" ${project.basedir}/idl/idl.ref" />
92- </condition >
93- <fail unless =" files.match"
94- message =" ${project.basedir}/idl/idl.out does not match ${project.basedir}/idl/idl.ref!" />
112+ <skip >${skip.test.cpp.examples.CORBA-IDL} </skip > <!-- default false -->
113+ <failOnError >${failOnError.check.cpp.examples.CORBA-IDL} </failOnError >
114+ <target >
115+ <ant antfile =" ${project.basedir}/../../it/build-utils.xml" target =" compare-out" >
116+ <property name =" dir" value =" ${project.basedir}" />
117+ <property name =" file" value =" Hello" />
118+ </ant >
95119 </target >
96120 </configuration >
97121 </execution >
98122 </executions >
99123 </plugin >
100-
124+
101125 </plugins >
102126 </build >
103127</project >
0 commit comments