Uncrustify: Difference between revisions

From OpenPetra Wiki
Jump to navigation Jump to search
Line 27: Line 27:
  git clone https://github.com/uncrustify/uncrustify.git
  git clone https://github.com/uncrustify/uncrustify.git
  cd uncrustify
  cd uncrustify
  chmod a+x *.sh
  . make_win32.sh
./make_win32.sh


Result in: /root/release/uncrustify-0.62.92-g5c059c9-dirty-win32.zip
Result in: /root/release/uncrustify-0.62.92-g5c059c9-win32.zip


== Debugging uncrustify and adding tests ==
== Debugging uncrustify and adding tests ==

Revision as of 19:56, 23 April 2016

about uncrustify

"Source Code Beautifier for C, C++, C#, ObjectiveC, D, Java, Pawn and VALA"

"The goals of this project are simple: Create a highly configurable, easily modifiable source code beautifier."

See sources at Github: https://github.com/uncrustify/uncrustify

current version used

  • Currently we still use version 0.56.

our own installer for Windows

it is easier to have an installer for Windows, instead of the zip file provided by the uncrustify project.

build installer from git master

apt-get install mingw-w64 git automake g++ make zip python
git clone https://github.com/uncrustify/uncrustify.git
cd uncrustify
. make_win32.sh

Result in: /root/release/uncrustify-0.62.92-g5c059c9-win32.zip

Debugging uncrustify and adding tests

For C# 6 support we noticed that even version 0.62 did not support all new C# 6 features. see https://sourceforge.net/p/uncrustify/bugs/672/ for details.

On Linux, I cloned the git master of uncrustify, to see if those issues had already been fixed there.

git clone https://github.com/uncrustify/uncrustify.git
cd uncrustify
./autogen.sh
./configure
make

To run the tests:

./run_tests.sh c-sharp

You can add new tests with these steps:

You can change the log_level to 7 in https://github.com/uncrustify/uncrustify/blob/master/tests/run_tests.py#L84 so that you see the difference of the result of uncrustify compared to your expected output, if the test fails.

If uncrustify has an exception, you only get message like this:

RUN: /home/timotheusp/dev/uncrustify.tpokorra/src/uncrustify -q -c config/ben.cfg -f input/cs/exception-filters.cs  > results/cs/10160-exception-filters.cs
FAILED: 10160

Then you should run this on the commandline, but without the -q:

cd tests
/home/timotheusp/dev/uncrustify.tpokorra/src/uncrustify -c config/ben.cfg -f input/cs/exception-filters.cs  > results/cs/10160-exception-filters.cs