From 2bfddbe8f8898551a28c3ea07b7ae508018f8634 Mon Sep 17 00:00:00 2001 From: Luke Ireland Date: Wed, 19 Feb 2020 15:49:33 +0000 Subject: [PATCH] Create a separate directory for unittests Some of the regression tests are C programs that act as test harnesses for the compiler internals as opposed to being Fortran inputs to test the compiler in action. The former style of tests are analog to LLVM's unittests and will not use the lit framework. Change-Id: I0ff10e23f66ff843e8fff4c35cfb6559b9dab762 --- CMakeLists.txt | 2 +- {test => unittests}/CMakeLists.txt | 1 - {test => unittests}/Decimal/CMakeLists.txt | 0 .../Decimal/quick-sanity-test.cpp | 0 {test => unittests}/Decimal/thorough-test.cpp | 0 {test => unittests}/Evaluate/CMakeLists.txt | 25 ------------------- .../Evaluate/ISO-Fortran-binding.cpp | 0 .../Evaluate/bit-population-count.cpp | 0 {test => unittests}/Evaluate/expression.cpp | 0 {test => unittests}/Evaluate/folding.cpp | 0 {test => unittests}/Evaluate/fp-testing.cpp | 0 {test => unittests}/Evaluate/fp-testing.h | 0 {test => unittests}/Evaluate/integer.cpp | 0 {test => unittests}/Evaluate/intrinsics.cpp | 0 .../Evaluate/leading-zero-bit-count.cpp | 0 {test => unittests}/Evaluate/logical.cpp | 0 {test => unittests}/Evaluate/real.cpp | 0 {test => unittests}/Evaluate/reshape.cpp | 0 {test => unittests}/Evaluate/testing.cpp | 0 {test => unittests}/Evaluate/testing.h | 0 {test => unittests}/Evaluate/uint128.cpp | 0 {test => unittests}/Runtime/CMakeLists.txt | 0 .../Runtime/external-hello.cpp | 0 {test => unittests}/Runtime/format.cpp | 0 {test => unittests}/Runtime/hello.cpp | 0 {test => unittests}/Runtime/list-input.cpp | 0 {test => unittests}/Runtime/testing.cpp | 0 {test => unittests}/Runtime/testing.h | 0 28 files changed, 1 insertion(+), 27 deletions(-) rename {test => unittests}/CMakeLists.txt (94%) rename {test => unittests}/Decimal/CMakeLists.txt (100%) rename {test => unittests}/Decimal/quick-sanity-test.cpp (100%) rename {test => unittests}/Decimal/thorough-test.cpp (100%) rename {test => unittests}/Evaluate/CMakeLists.txt (85%) rename {test => unittests}/Evaluate/ISO-Fortran-binding.cpp (100%) rename {test => unittests}/Evaluate/bit-population-count.cpp (100%) rename {test => unittests}/Evaluate/expression.cpp (100%) rename {test => unittests}/Evaluate/folding.cpp (100%) rename {test => unittests}/Evaluate/fp-testing.cpp (100%) rename {test => unittests}/Evaluate/fp-testing.h (100%) rename {test => unittests}/Evaluate/integer.cpp (100%) rename {test => unittests}/Evaluate/intrinsics.cpp (100%) rename {test => unittests}/Evaluate/leading-zero-bit-count.cpp (100%) rename {test => unittests}/Evaluate/logical.cpp (100%) rename {test => unittests}/Evaluate/real.cpp (100%) rename {test => unittests}/Evaluate/reshape.cpp (100%) rename {test => unittests}/Evaluate/testing.cpp (100%) rename {test => unittests}/Evaluate/testing.h (100%) rename {test => unittests}/Evaluate/uint128.cpp (100%) rename {test => unittests}/Runtime/CMakeLists.txt (100%) rename {test => unittests}/Runtime/external-hello.cpp (100%) rename {test => unittests}/Runtime/format.cpp (100%) rename {test => unittests}/Runtime/hello.cpp (100%) rename {test => unittests}/Runtime/list-input.cpp (100%) rename {test => unittests}/Runtime/testing.cpp (100%) rename {test => unittests}/Runtime/testing.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 97a03ee4a9a3..f19259df77e1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -154,7 +154,7 @@ enable_testing() add_subdirectory(include/flang) add_subdirectory(lib) add_subdirectory(runtime) -add_subdirectory(test) +add_subdirectory(unittests) add_subdirectory(tools) add_subdirectory(test-lit) diff --git a/test/CMakeLists.txt b/unittests/CMakeLists.txt similarity index 94% rename from test/CMakeLists.txt rename to unittests/CMakeLists.txt index e83f63c8e030..6d49e6c72b57 100644 --- a/test/CMakeLists.txt +++ b/unittests/CMakeLists.txt @@ -9,4 +9,3 @@ add_subdirectory(Decimal) add_subdirectory(Evaluate) add_subdirectory(Runtime) -add_subdirectory(Semantics) diff --git a/test/Decimal/CMakeLists.txt b/unittests/Decimal/CMakeLists.txt similarity index 100% rename from test/Decimal/CMakeLists.txt rename to unittests/Decimal/CMakeLists.txt diff --git a/test/Decimal/quick-sanity-test.cpp b/unittests/Decimal/quick-sanity-test.cpp similarity index 100% rename from test/Decimal/quick-sanity-test.cpp rename to unittests/Decimal/quick-sanity-test.cpp diff --git a/test/Decimal/thorough-test.cpp b/unittests/Decimal/thorough-test.cpp similarity index 100% rename from test/Decimal/thorough-test.cpp rename to unittests/Decimal/thorough-test.cpp diff --git a/test/Evaluate/CMakeLists.txt b/unittests/Evaluate/CMakeLists.txt similarity index 85% rename from test/Evaluate/CMakeLists.txt rename to unittests/Evaluate/CMakeLists.txt index b08c1431df70..d874fcb39dbc 100644 --- a/test/Evaluate/CMakeLists.txt +++ b/unittests/Evaluate/CMakeLists.txt @@ -132,18 +132,6 @@ target_link_libraries(folding-test FortranSemantics ) -set(FOLDING_TESTS - folding01.f90 - folding02.f90 - folding03.f90 - folding04.f90 - folding05.f90 - folding06.f90 - folding07.f90 - folding08.f90 - folding09.f90 -) - add_test(Expression expression-test) add_test(Integer integer-test) add_test(Intrinsics intrinsics-test) @@ -152,16 +140,3 @@ add_test(Real real-test) add_test(RESHAPE reshape-test) add_test(ISO-binding ISO-Fortran-binding-test) add_test(folding folding-test) - -set(TEST_LIBPGMATH "-pgmath=false") -if (LIBPGMATH_DIR) - find_library(LIBPGMATH pgmath PATHS ${LIBPGMATH_DIR}) - if(LIBPGMATH) - set(TEST_LIBPGMATH "-pgmath=true") - endif() -endif() - -foreach(test ${FOLDING_TESTS}) - add_test(NAME ${test} COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/test_folding.sh - ${test} ${TEST_LIBPGMATH}) -endforeach() diff --git a/test/Evaluate/ISO-Fortran-binding.cpp b/unittests/Evaluate/ISO-Fortran-binding.cpp similarity index 100% rename from test/Evaluate/ISO-Fortran-binding.cpp rename to unittests/Evaluate/ISO-Fortran-binding.cpp diff --git a/test/Evaluate/bit-population-count.cpp b/unittests/Evaluate/bit-population-count.cpp similarity index 100% rename from test/Evaluate/bit-population-count.cpp rename to unittests/Evaluate/bit-population-count.cpp diff --git a/test/Evaluate/expression.cpp b/unittests/Evaluate/expression.cpp similarity index 100% rename from test/Evaluate/expression.cpp rename to unittests/Evaluate/expression.cpp diff --git a/test/Evaluate/folding.cpp b/unittests/Evaluate/folding.cpp similarity index 100% rename from test/Evaluate/folding.cpp rename to unittests/Evaluate/folding.cpp diff --git a/test/Evaluate/fp-testing.cpp b/unittests/Evaluate/fp-testing.cpp similarity index 100% rename from test/Evaluate/fp-testing.cpp rename to unittests/Evaluate/fp-testing.cpp diff --git a/test/Evaluate/fp-testing.h b/unittests/Evaluate/fp-testing.h similarity index 100% rename from test/Evaluate/fp-testing.h rename to unittests/Evaluate/fp-testing.h diff --git a/test/Evaluate/integer.cpp b/unittests/Evaluate/integer.cpp similarity index 100% rename from test/Evaluate/integer.cpp rename to unittests/Evaluate/integer.cpp diff --git a/test/Evaluate/intrinsics.cpp b/unittests/Evaluate/intrinsics.cpp similarity index 100% rename from test/Evaluate/intrinsics.cpp rename to unittests/Evaluate/intrinsics.cpp diff --git a/test/Evaluate/leading-zero-bit-count.cpp b/unittests/Evaluate/leading-zero-bit-count.cpp similarity index 100% rename from test/Evaluate/leading-zero-bit-count.cpp rename to unittests/Evaluate/leading-zero-bit-count.cpp diff --git a/test/Evaluate/logical.cpp b/unittests/Evaluate/logical.cpp similarity index 100% rename from test/Evaluate/logical.cpp rename to unittests/Evaluate/logical.cpp diff --git a/test/Evaluate/real.cpp b/unittests/Evaluate/real.cpp similarity index 100% rename from test/Evaluate/real.cpp rename to unittests/Evaluate/real.cpp diff --git a/test/Evaluate/reshape.cpp b/unittests/Evaluate/reshape.cpp similarity index 100% rename from test/Evaluate/reshape.cpp rename to unittests/Evaluate/reshape.cpp diff --git a/test/Evaluate/testing.cpp b/unittests/Evaluate/testing.cpp similarity index 100% rename from test/Evaluate/testing.cpp rename to unittests/Evaluate/testing.cpp diff --git a/test/Evaluate/testing.h b/unittests/Evaluate/testing.h similarity index 100% rename from test/Evaluate/testing.h rename to unittests/Evaluate/testing.h diff --git a/test/Evaluate/uint128.cpp b/unittests/Evaluate/uint128.cpp similarity index 100% rename from test/Evaluate/uint128.cpp rename to unittests/Evaluate/uint128.cpp diff --git a/test/Runtime/CMakeLists.txt b/unittests/Runtime/CMakeLists.txt similarity index 100% rename from test/Runtime/CMakeLists.txt rename to unittests/Runtime/CMakeLists.txt diff --git a/test/Runtime/external-hello.cpp b/unittests/Runtime/external-hello.cpp similarity index 100% rename from test/Runtime/external-hello.cpp rename to unittests/Runtime/external-hello.cpp diff --git a/test/Runtime/format.cpp b/unittests/Runtime/format.cpp similarity index 100% rename from test/Runtime/format.cpp rename to unittests/Runtime/format.cpp diff --git a/test/Runtime/hello.cpp b/unittests/Runtime/hello.cpp similarity index 100% rename from test/Runtime/hello.cpp rename to unittests/Runtime/hello.cpp diff --git a/test/Runtime/list-input.cpp b/unittests/Runtime/list-input.cpp similarity index 100% rename from test/Runtime/list-input.cpp rename to unittests/Runtime/list-input.cpp diff --git a/test/Runtime/testing.cpp b/unittests/Runtime/testing.cpp similarity index 100% rename from test/Runtime/testing.cpp rename to unittests/Runtime/testing.cpp diff --git a/test/Runtime/testing.h b/unittests/Runtime/testing.h similarity index 100% rename from test/Runtime/testing.h rename to unittests/Runtime/testing.h