[PATCH] D97349: [flang] Change existing runtime tests to use gtest

Asher Mancinelli via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 23 17:12:58 PST 2021


ashermancinelli created this revision.
ashermancinelli added a reviewer: awarzynski.
Herald added a subscriber: mgorny.
Herald added a reviewer: sscalpone.
ashermancinelli requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Updates the flang runtime unittests to use GTest. This patch should
likely not be accepted as-is, as there are temporarily two directories
for runtime tests such that new tests may be
written to use GTest without interfering with the old ones. Eventually,
old runtime tests directory should be removed.

The style guide indicates that exceptions should never be used,
however almost all of the the current runtime tests use exceptions.
This revision removes this need for exceptions.

I attempted to follow the style guide as closely as possible, however
some of the files flang/unittests/Runtime differ in style from other
unittest directories. In these cases, I leaned towards conforming with
the other existing unittests and not the precedent set by
flang/unittests/Runtime directory. For example, for file names I used
pascal case instead of kabob case, and test cases are in pascal case
instead of camel case.

Some tests require input and will likely not be able to remain in the
same directory as the other runtime tests since LLVM's CMake unittest
functions do not allow multiple targets in a directory (as discussed
on slack). Example is

This is my first revision, so please point out anything that doesn't
conform to best practices.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D97349

Files:
  flang/unittests/CMakeLists.txt
  flang/unittests/Runtime/CMakeLists.txt
  flang/unittests/Runtime/format.cpp
  flang/unittests/Runtime/list-input.cpp
  flang/unittests/Runtime/testing.cpp
  flang/unittests/Runtime/testing.h
  flang/unittests/RuntimeGTest/CMakeLists.txt
  flang/unittests/RuntimeGTest/CharacterTest.cpp
  flang/unittests/RuntimeGTest/ExternalIOTest.cpp
  flang/unittests/RuntimeGTest/FormatTest.cpp
  flang/unittests/RuntimeGTest/HelloWorldOutputTest.cpp
  flang/unittests/RuntimeGTest/ListInputTest.cpp
  flang/unittests/RuntimeGTest/RuntimeTesting.cpp
  flang/unittests/RuntimeGTest/RuntimeTesting.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97349.325941.patch
Type: text/x-patch
Size: 62665 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210224/f56d365a/attachment.bin>


More information about the llvm-commits mailing list