Ideally the code itself should also be deleted from CDT, but
this test is super flaky and I cannot seem to convert it to
JUnit5 so I can properly mark it as flaky. Therefore
the test is now simply gone.
Part of #117
The resource helper is widely used, but when it deletes
projects, it leaves their contents on disk. Fix this
so that the contents on disk is deleted.
Part of #117
Maybe once upon a time this lifecycle did something,
but now in setUp fProject is always null and therefore
the project was never getting deleted as the fProject
that deleteProject saw was different than
the tests.
Part of #117
Having the test suites means that tests run multiple times
when running in the UI. Most suites just ran the tests in
that package, so their value, especially with the transition
to JUnit5 is minimal.
Note that the suites are not used when running build
with Tycho/Maven
Part of #117
Warning in build.properties will be errors when they run
in the tycho build, like this:
```
Error: Failed to execute goal org.eclipse.tycho:tycho-packaging-plugin:2.7.5:package-plugin
(default-package-plugin) on project org.eclipse.cdt.core.tests:
/home/runner/work/cdt/cdt/core/org.eclipse.cdt.core.tests/build.properties:
bin.includes value(s) [test.xml] do not match any files. -> [Help 1]
```
So make them errors in the workspace so that the issue is
detected before push.
Some build.properties issues don't affect the build, but
are still indicative of a problem.
If a .cproject references a binary parser ID that is not in
the plug-in XML, or in the XML, but marked as private, the
UI cannot display the binary parsers and was raising an
ArrayIndexOutOfBoundsException as below.
This fix rewrites the array handling using collections.
```java
!ENTRY org.eclipse.ui 4 0 2022-11-04 09:44:27.409
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.ArrayIndexOutOfBoundsException: Index 7 out of bounds for length 7
at org.eclipse.cdt.ui.newui.BinaryParsTab.updateData(BinaryParsTab.java:253)
at org.eclipse.cdt.ui.newui.AbstractCPropertyTab.setVisible(AbstractCPropertyTab.java:253)
at org.eclipse.cdt.ui.newui.BinaryParsTab.setVisible(BinaryParsTab.java:221)
at org.eclipse.cdt.ui.newui.AbstractCPropertyTab.handleTabEvent(AbstractCPropertyTab.java:630)
at org.eclipse.cdt.ui.newui.AbstractPage.updateSelectedTab(AbstractPage.java:412)
at org.eclipse.cdt.ui.newui.AbstractPage$4.widgetSelected(AbstractPage.java:382)
```
Changed the execute to take the cwd to run the command in and
clean up the related code, including some error message
handling and removing some redundant code.
Fixes#125
Various tests are not cleaning up properly after
themselves, causing test failures on subsequent
tests. Therefore start each test by deleting
all projects.
In addition, some tests were creating their test
projects in their constructor. As all the constructors
run before all the tests as part of test discovery
it means that projects were being created in
constructor and interfering with other tests
later. With the deleting of all projects in @AfterEach
these tests would have started failing. Therefore,
change these tests to create their projects
and do other initialize tasks in the setUp method.
For older JUnit3 style tests:
This substantially slows down tests as many tests
rely on sharing the project between multiple tests and
recreating those projects on each run is slow.
Therefore this is not applied universally to
all JUnit3 tests.
For tests that are affected, those tests are moved
to JUnit5 base test.
Part of #117
On GitHub actions the org.eclipse.cdt.ui.tests.text.contentassist2
tests are running after ProposalFilterPreferencesTest and
ProposalFilterPreferencesTest was changing the default
filter and not restoring it.
Part of #117
This old test had a race condition. The failing test was trying
to verify that CDTPROJECT_ADDED was received, but if there
was a delay in the startup then another event would come in
later. So for this test use the first received event,
for the remaining tests use the last received event.
Part of #117
It may be that this test fails regularly because
another test is not cleaned up properly.
Make sure there are no unexpected projects in
the workspace.
Part of #117
The launchbar way of compositing images for the buttons was preventing
the use of higher quality icons on hidpi dislays, making the launchbar
buttons look blurry or pixelated compared to other toolbar buttons.
Instead we can get a nicer result with a custom widget on which we can
directly draw a button border plus the hidpi version of the icon.
Also included is an attempt at a 2x hammer build button icon, which
should look a bit nicer on hidpi screens.
Switch to CTabFolder/CTabItem for newui.
This changeset is a breaking change but on a review of existing
adopters/extenders of CDT no one is actually accessing these fields.
Change-Id: Ic1ef0f242c1d2932726f3a6d4c9df9558312764a
Signed-off-by: Torbjörn Svensson <torbjorn.svensson@st.com>
Also-by: Jonah Graham <jonah@kichwacoders.com>
Adds constexpr evaluation for some additional compiler builtins. This is
probably the last lot few builtins that can reasonably be
constexpr-evaluated in CDT.
gcc linker outputs "removing unused section" to stderr when the option "--print-gc-sections" is used. That is fine.
Eclipse CDT reports all these lines as errors however and the build seems to have failed, which is wrong.
The was a bug report Bug 539927: Do not mark "Removing unused section" lines as errors and a fix
To fix this bug a change was made 2020-12-02 05322656c6
-CDTGNULinkerErrorParser.regex.LdMode=(.*[/\\\\])?ld(\\.exe)?: (mode .*)
+CDTGNULinkerErrorParser.regex.ldInfo=(.*[/\\\\])?ld(\\.exe)?: ((mode|Removing unused section) .*)
That does however not solve problem entirely, as the output of gcc linker is "removing", not "Removing", i.e. the word "removing" starts with a lower-case "r"
To fix that problem both R and r should be accepted.
After building a project and shuting down eclipse, the build console
will have a propertyChange event fired that will attempt to modify the
stream and background color that will trigger a use-after-dispose error
from SWT. This changeset ensures that the action is only taken on
non-disposed widgets.
Contributed by STMicroelectronics
Change-Id: I872c28da1b2fca7ec39f5b12d9d1ec398e559814
Signed-off-by: Torbjörn Svensson <torbjorn.svensson@st.com>
The class CommandLauncher holds an internal state of the process and
it's command line. To avoid corrupting the internal state, only allow
executing new commands if the previous command is finished.
Contributed by STMicroelectronics
Change-Id: If41816f6b642953776a4fea3df9f341a17712222
Signed-off-by: Torbjörn Svensson <torbjorn.svensson@st.com>
The root files in GitHub are a bit more prominent, so keep
that area clean and move this special ini to a subdir.
Change-Id: I12d95727e9dad29ebe4f50d47faa9e98753a52bc
java 17 is now the default, and that means that a new hash
is created by reproducible_build_wrapper.py due to the changed
path for includes to the Java 17 include directory.
Nothing else about the binaries has actually changed.
Change-Id: I36398b84cc5fe20cd1d0f58f52dfee4737e913f8
Switch from the standard Java ProcessBuilder to the CDT CommandLauncher
for new style core build projects.
The CommandLauncher uses a more sophiscated mechanism for watching the
spawned process allowing us to interrupt the process when the user hits
the stop button on the launchbar by properly listening to a monitor.
The change adds new API to CBuildCongifuration that takes a progress
monitor, and changes all the affected build configuration types to use
this new API.
Change-Id: I0c4225616ad8331c2cea28bcb502028455a8ea71
Provide constexpr evaluation for: __builtin_ctz, __builtin_popcount,
__builtin_parity, __builtin_abs, and the variants which take a long int
or long long int.
Change-Id: I6088e2d41a161059ce0a64443a1d1126952ff905
On Windows, the TabFolder and TabItem classes does not follow the
themeing in Eclipse. As a result, the tab selectors will be drawn with
the light theme while the rest of the Eclipse UI is in dark theme.
Contributed by STMicroelectronics
Change-Id: I9169c9e01f8c9a3af7b6bb6d1c673a043735e7e9
Signed-off-by: Torbjörn Svensson <torbjorn.svensson@st.com>
jaxb is not standard anymore, and having a dependency just
for this simple method is overkill.
This is also a workaround for Bug 579817.
Change-Id: Ic0db6e595b8faa9323c26d29f8caedc0ac4b089e
This mostly is using diamond operator, but includes
adding missing @Override and organizing imports and
applying formatting improvements in the JDT formatter.
Change-Id: Id91cbff33b0a039cc5121945ffbc407ecba45866
The CDT Cleanup profile had a bunch of extra cleanups applied to it, this
prevents running the CDT cleanup profile manually to simulate running the
save actions on all Java files
Change-Id: Iad491e1258a4ba90d81d1457ea0f6779e3663e38