flang-compiler / f18

F18 is a front-end for Fortran intended to replace the existing front-end in the Flang compiler
229 stars 48 forks source link

Port F18 unittests to gtest #995

Open RichBarton-Arm opened 4 years ago

RichBarton-Arm commented 4 years ago

After #941 is complete, F18 will have a directory unittests that contain tests written in C++ that wrap various internals of F18's runtime or shared utilities in a test harness and test them. This is supported by some custom test harness code.

LLVM projects use the gtest framework for tests of this type. See https://github.com/llvm/llvm-project/tree/master/clang/unittests for an example of this.

The F18 tests need to be ported to also use this framework.

Sameeranjoshi commented 4 years ago

Hi @RichBarton-Arm is someone working on this currently? I was in need of at least a basic framework for adding FIR gtest. By basic I mean the Cmake file changes, so we can run at least a single test.

Sameeranjoshi commented 4 years ago

This ticket seems like we need a port of all unittests/ files into a gtest based framework, but given that there is no unittest framework using gtest, should we have that first?

RichBarton-Arm commented 4 years ago

Hi @Sameeranjoshi Currently there is nobody working on this so it is up for grabs. Adding the gtest framework with a single test would definitely be a good start. We could then work on migration across from ctest to gtest once we have a target to aim at. Please feel free to claim it and move it to in progress.

Sameeranjoshi commented 4 years ago

https://reviews.llvm.org/D80377

RichBarton-Arm commented 4 years ago

@Sameeranjoshi has committed https://reviews.llvm.org/D80377 which puts the infrastructure in place. All new tests can be added as gtest tests. We now need to port the existing tests over to this format.

banach-space commented 3 years ago

A fresh patch in this direction: https://reviews.llvm.org/D97403

Thank you @ashermancinelli!

banach-space commented 3 years ago

https://reviews.llvm.org/D105315 concludes the porting of flang/unittests/Runtime. Massive thank you to @ashermancinelli for the enormous effort!

We still need to port flang/unittests/Decimal and flang/unittests/Evaluate. Please volunteer :)