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

Allow creating subfolders for integration tests sources #448

Merged
merged 1 commit into from
Nov 4, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions tests-integration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,20 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/inputs/double-automata.input.in" "${

configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/utils/config.hh.in" "${CMAKE_CURRENT_SOURCE_DIR}/src/utils/config.hh" @ONLY)

file(GLOB SOURCES "src/*.cc")
file(
GLOB_RECURSE SOURCES

${CMAKE_CURRENT_SOURCE_DIR}/src/*.cc
)
list(FILTER SOURCES EXCLUDE REGEX ".*/tests-integration/src/utils/.*")
foreach(SOURCE ${SOURCES})
get_filename_component(TARGET ${SOURCE} NAME_WE)

add_executable(${TARGET}
${SOURCE}
src/utils/utils.cc
)
get_filename_component(TARGET_PATH ${SOURCE} DIRECTORY)
file(RELATIVE_PATH TARGET_PATH "${CMAKE_CURRENT_SOURCE_DIR}/src/" "${TARGET_PATH}")

add_executable(${TARGET} ${SOURCE} src/utils/utils.cc)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_PATH})
target_link_libraries(${TARGET} libmata)

# Add common compile warnings.
Expand Down
9 changes: 6 additions & 3 deletions tests-integration/src/templates/template-with-cli-args.cc
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
/**
* NOTE: Input automata, that are of type `NFA-bits` are mintermized!
* TODO: Input automata, that are of type `NFA-bits` are mintermized!
* - If you want to skip mintermization, set the variable `MINTERMIZE_AUTOMATA` below to `false`
*/

#include "utils/utils.hh"
// TODO: Modify when copying to target `/mata/tests-integration/src/utils/`.
#include "../utils/utils.hh"
#include "../utils/config.hh"

#include "mata/nfa/nfa.hh"

#include <iostream>
Expand Down Expand Up @@ -36,7 +39,7 @@ int main(int argc, char *argv[])
TIME_BEGIN(tmp);

/**************************************************
* HERE COMES YOUR CODE THAT YOU WANT TO PROFILE *
* TODO: HERE COMES YOUR CODE YOU WANT TO PROFILE *
* - Use alphabet alph as source alphabet *
* - Use Nfa aut as source automaton *
* - e.g. complement(aut, alph); *
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/**
* NOTE: Input automata, that are of type `NFA-bits` are mintermized!
* TODO: Input automata, that are of type `NFA-bits` are mintermized!
* - If you want to skip mintermization, set the variable `MINTERMIZE_AUTOMATA` below to `false`
*/

#include "utils/utils.hh"
#include "utils/config.hh"
// TODO: Modify when copying to target `/mata/tests-integration/src/utils/`.
#include "../utils/utils.hh"
#include "../utils/config.hh"

#include "mata/nfa/nfa.hh"

Expand All @@ -24,7 +25,7 @@ int main(int argc, char *argv[])
std::cout << std::fixed << std::setprecision(4);

/**
* NOTE: Comment out automata, that you do not want to process or add your own automata.
* TODO: Comment out automata that you do not want to process or add your own automata.
*/
std::vector<std::string> automata = {
mata::PerformanceTesting::AUTOMATA_DIR + "/b-armc-incl-easiest/aut1.mata",
Expand Down Expand Up @@ -129,7 +130,7 @@ int main(int argc, char *argv[])
TIME_BEGIN(tmp);

/**************************************************
* HERE COMES YOUR CODE THAT YOU WANT TO PROFILE *
* TODO: HERE COMES YOUR CODE YOU WANT TO PROFILE *
* - Use alphabet alph as source alphabet *
* - Use Nfa aut as source automaton *
* - e.g. complement(aut, alph); *
Expand Down
8 changes: 6 additions & 2 deletions tests-integration/src/templates/template.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#include "utils/utils.hh"
// TODO: Modify when copying to target `/mata/tests-integration/src/utils/`.
#include "../utils/utils.hh"
#include "../utils/config.hh"

#include "mata/nfa/nfa.hh"

#include <iostream>
#include <iomanip>
#include <chrono>
Expand All @@ -14,7 +18,7 @@ int main() {
TIME_BEGIN(tmp);

/**************************************************
* HERE COMES YOUR CODE THAT YOU WANT TO PROFILE *
* TODO: HERE COMES YOUR CODE YOU WANT TO PROFILE *
**************************************************/

TIME_END(tmp);
Expand Down
Loading