Eclipse Xpect™ is a unit- and integration-testing framework to be used for Xtext-based languages. Test data (e.g. expectations) are embedded into programs written in the DSL under tests. Xpect itself is based on Junit; new test methods can be written in Java and are called by the Xpect framework with the test data. Typical Xpect tests include expecting certain error messages, ensuring correct scopes, or specific content assist proposals.
Visit xpect-tests.org for details.
See CONTRIBUTING.md for details.
Prerequisite: Java 11 or newer; Eclipse (2023-03 or newer recommended); Xtext 2.31.0.
- Clone https://github.com/eclipse/Xpect (this repository)
- Import all projects into your Eclipse workspace.
- Set target platform to /org.eclipse.xpect.releng/target-platforms/eclipse_2023_03-xtext_2_31_0/org.eclipse.xpect.target.eclipse_2023_03-xtext_2_31_0.target (Preferences -> Plug-in Development -> Target Platform)
- Run /org.eclipse.xpect/src/org/eclipse/xpect/GenerateXpect.mwe2, /org.xtext.example.arithmetics/src/org/eclipse/xpect/example/arithmetics/GenerateXpect.mwe2, /org.xtext.example.domainmodel/src/org/xtext/example/domainmodel/GenerateDomainmodel.mwe2. Now your projects should be without errors markers. Sometimes, even after these steps, several projects still have error markers. However, this is a refresh problem in Eclipse. Simply clean build the projects with error markers will solve the issues.
- Run
mvn -P '!tests' -Dtarget-platform=eclipse_2023_03-xtext_2_31_0 --batch-mode --update-snapshots -fae -Dmaven.repo.local=xpect-local-maven-repository -DtestOnly=false clean install
to build artefacts and create a p2 repository (formerly known as update site).