diff options
Diffstat (limited to 'test/suite/ctor_files/ctor.cc.generated')
| -rw-r--r-- | test/suite/ctor_files/ctor.cc.generated | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/test/suite/ctor_files/ctor.cc.generated b/test/suite/ctor_files/ctor.cc.generated index 5f82fd4..5bc2940 100644 --- a/test/suite/ctor_files/ctor.cc.generated +++ b/test/suite/ctor_files/ctor.cc.generated @@ -4,6 +4,7 @@ #include <ctor.h> #include <filesystem> #include <iostream> +#include <fstream> namespace { @@ -41,6 +42,44 @@ ctor::build_configurations ctorConfigs(const ctor::settings& settings) return 0; } }, + + { + .target = "many_to_one", + .sources = { + {"many_to_one.cc", ctor::source_type::generated} + } + }, + { + .target = "many_to_one.cc", + .sources = { + {"foo.cc", ctor::source_type::generated}, + {"hello.cc"}, + }, + .function = [](const std::vector<std::string>& input, + const std::string& output, + const ctor::build_configuration& config, + const ctor::settings& settings) + { + std::cout << "Output: " << output << '\n'; + std::ofstream ofs(output); + bool comment{true}; + for(const auto& input_file : input) + { + std::cout << "Input: " << input_file << '\n'; + std::ifstream ifs(input_file); + std::string line; + while(std::getline(ifs, line)) + { + ofs << line << '\n'; + } + if(comment) ofs << "/*\n"; + comment = false; + } + ofs << "*/\n"; + return 0; + } + }, + }; } } |
