Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mv the directory src/tests to test #669

Merged
merged 3 commits into from Jul 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 23 additions & 0 deletions CMakeLists.txt
Expand Up @@ -48,8 +48,31 @@ if(NOT FYPP)
message(FATAL_ERROR "Preprocessor fypp not found! Please install fypp following the instructions in https://fypp.readthedocs.io/en/stable/fypp.html#installing")
endif()

# Custom preprocessor flags
if(DEFINED CMAKE_MAXIMUM_RANK)
set(fyppFlags "-DMAXRANK=${CMAKE_MAXIMUM_RANK}")
elseif(f03rank)
set(fyppFlags)
else()
set(fyppFlags "-DVERSION90")
endif()

list(
APPEND fyppFlags
"-DWITH_QP=$<BOOL:${WITH_QP}>"
"-DWITH_XDP=$<BOOL:${WITH_XDP}>"
"-DPROJECT_VERSION_MAJOR=${PROJECT_VERSION_MAJOR}"
"-DPROJECT_VERSION_MINOR=${PROJECT_VERSION_MINOR}"
"-DPROJECT_VERSION_PATCH=${PROJECT_VERSION_PATCH}"
)

add_subdirectory(src)

if(BUILD_TESTING)
enable_testing()
add_subdirectory(test)
endif()

install(EXPORT ${PROJECT_NAME}-targets
NAMESPACE ${PROJECT_NAME}::
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
Expand Down
4 changes: 2 additions & 2 deletions STYLE_GUIDE.md
Expand Up @@ -20,9 +20,9 @@ This style guide is a living document and proposed changes may be adopted after
* If the interface and implementation is split using submodules the implementation submodule file should have the same name as the
interface (parent) module but end in `_implementation`
E.g., `string_class.f90` and `string_class_implementation.f90`
* Tests should be added in the `tests` subdirectory and have the same name as the module they are testing with the `test_` prefix
* Tests should be added in the `test` subdirectory and have the same name as the module they are testing with the `test_` prefix
added
E.g., `string_class.f90` and `tests/test_string_class.f90`
E.g., `string_class.f90` and `test/test_string_class.f90`

## Indentation & whitespace

Expand Down
4 changes: 2 additions & 2 deletions WORKFLOW.md
Expand Up @@ -81,8 +81,8 @@ To add tests, the macro ``ADDTEST`` should be used instead of the CMake function
``add_test``, the macro hides creation of the executable target, linking against the
main library target and registering the test.
The tests themselves are defined as standalone executables in the subdirectories
in ``src/tests``, a new subdirectory with tests has to be registred in
``src/tests/CMakeLists.txt``.
in ``test``, a new subdirectory with tests has to be registered in
``test/CMakeLists.txt``.

The source tree should be considered read-only. References to ``PROJECT_SOURCE_DIR``
and ``CMAKE_CURRENT_SOURCE_DIR`` should only be used for accessing source files,
Expand Down
4 changes: 2 additions & 2 deletions ci/fpm-deployment.sh
Expand Up @@ -47,8 +47,8 @@ find src -maxdepth 1 -iname "*.fypp" \

# Collect stdlib source files
find src -maxdepth 1 -iname "*.f90" -exec cp {} "$destdir/src/" \;
find src/tests -name "test_*.f90" -exec cp {} "$destdir/test/" \;
find src/tests -name "*.dat" -exec cp {} "$destdir/" \;
find test -name "test_*.f90" -exec cp {} "$destdir/test/" \;
find test -name "*.dat" -exec cp {} "$destdir/" \;

# Include additional files
cp "${include[@]}" "$destdir/"
Expand Down
4 changes: 2 additions & 2 deletions doc/specs/stdlib_hash_procedures.md
Expand Up @@ -1623,7 +1623,7 @@ various hash functions. The other is a comparison of the outputs of
the Fortran hash functions, with the outputs of the C and C++ hash
procedures that are the inspiration for the Fortran hash functions.

In the `src/test/hash_functions_perf` subdirectory, the Fortran Standard
In the `test/hash_functions_perf` subdirectory, the Fortran Standard
Library provides two performance test codes for
the hash functions of `stdlib_hash_32bit` and
`stdlib_hash_64bit`, `test_32_bit_hash_performance` and
Expand Down Expand Up @@ -1726,7 +1726,7 @@ severely impact the performance of `nmhash32`, `nmhash32x`,
`water_hash`, `pengy_hash`, and `spooky_hash` relative to
`fnv_1_hash` and `fnv_1a_hash`.

In the `src/test/hash_functions` subdirectory, the Fortran
In the `test/hash_functions` subdirectory, the Fortran
Standard Library contains codes to test the validity of
the Fortran codes against the original C and C++ codes. It consists of one
executable `test_hash_functions` that
Expand Down
23 changes: 0 additions & 23 deletions src/CMakeLists.txt
Expand Up @@ -61,24 +61,6 @@ set(fppFiles
)


# Custom preprocessor flags
if(DEFINED CMAKE_MAXIMUM_RANK)
set(fyppFlags "-DMAXRANK=${CMAKE_MAXIMUM_RANK}")
elseif(f03rank)
set(fyppFlags)
else()
set(fyppFlags "-DVERSION90")
endif()

list(
APPEND fyppFlags
"-DWITH_QP=$<BOOL:${WITH_QP}>"
"-DWITH_XDP=$<BOOL:${WITH_XDP}>"
"-DPROJECT_VERSION_MAJOR=${PROJECT_VERSION_MAJOR}"
"-DPROJECT_VERSION_MINOR=${PROJECT_VERSION_MINOR}"
"-DPROJECT_VERSION_PATCH=${PROJECT_VERSION_PATCH}"
)

fypp_f90("${fyppFlags}" "${fppFiles}" outFiles)

set(SRC
Expand Down Expand Up @@ -134,11 +116,6 @@ else()
target_sources(${PROJECT_NAME} PRIVATE f08estop.f90)
endif()

if(BUILD_TESTING)
enable_testing()
add_subdirectory(tests)
endif()

install(TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}-targets
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.