Skip to content

Commit

Permalink
feat(tests-integration): Allow creating subfolders for integration te…
Browse files Browse the repository at this point in the history
…sts sources
  • Loading branch information
Adda0 committed Oct 29, 2024
1 parent 56780ef commit 5f69e28
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 15 deletions.
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

0 comments on commit 5f69e28

Please sign in to comment.