Skip to content

Commit

Permalink
Revert "test: test installation of conan packages"
Browse files Browse the repository at this point in the history
This reverts commit bf5dab5.
  • Loading branch information
FeignClaims committed Sep 18, 2024
1 parent a12ae5b commit 15fe2fb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 32 deletions.
19 changes: 13 additions & 6 deletions tests/myproj/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,21 @@ project_options(
add_executable(main ./src/main/main.cpp)
target_link_libraries(main PRIVATE myproj_project_options myproj_project_warnings)

target_find_dependencies(main
target_find_dependencies(
main
PUBLIC
PACKAGE fmt CONFIG
PACKAGE Eigen3 CONFIG
PACKAGE docopt CONFIG
PACKAGE
fmt
CONFIG
PACKAGE
Eigen3
CONFIG
PACKAGE
docopt
CONFIG
)

target_link_system_libraries(main PRIVATE fmt::fmt Eigen3::Eigen docopt)
target_link_system_libraries(main PRIVATE fmt::fmt Eigen3::Eigen)

add_subdirectory(libs)

Expand Down Expand Up @@ -171,7 +178,7 @@ package_project(
myproj_project_options
myproj_project_warnings
PUBLIC_INCLUDES
${lib2_INCLUDE_DIR2}
${lib2_INCLUDE_DIR22}
)

package_project(NAME myproj_main TARGETS main)
3 changes: 0 additions & 3 deletions tests/myproj/conanfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,5 @@
[requires]
docopt.cpp/0.6.3

[options]
docopt.cpp/*:shared=True

[generators]
CMakeDeps
27 changes: 4 additions & 23 deletions tests/myproj/src/main/main.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
// test external pac
#include <docopt/docopt.h>
#include <Eigen/Dense>
#include <fmt/core.h>
#include <fmt/ostream.h>
#include <fmt/ranges.h>

Check warning on line 4 in tests/myproj/src/main/main.cpp

View workflow job for this annotation

GitHub Actions / Test (ubuntu-22.04, gcc, true)

included header ranges.h is not used directly [misc-include-cleaner]

Check warning on line 4 in tests/myproj/src/main/main.cpp

View workflow job for this annotation

GitHub Actions / Test (ubuntu-22.04, llvm, true)

included header ranges.h is not used directly [misc-include-cleaner]

Check warning on line 4 in tests/myproj/src/main/main.cpp

View workflow job for this annotation

GitHub Actions / Test (windows-2022, gcc, true)

included header ranges.h is not used directly [misc-include-cleaner]

// test std libraries
#include <iostream>

Check warning on line 7 in tests/myproj/src/main/main.cpp

View workflow job for this annotation

GitHub Actions / Test (ubuntu-22.04, llvm, true)

included header iostream is not used directly [misc-include-cleaner]

Check warning on line 7 in tests/myproj/src/main/main.cpp

View workflow job for this annotation

GitHub Actions / Test (windows-2022, gcc, true)

included header iostream is not used directly [misc-include-cleaner]
#include <map>
#include <string>

Check warning on line 8 in tests/myproj/src/main/main.cpp

View workflow job for this annotation

GitHub Actions / Test (ubuntu-22.04, llvm, true)

included header string is not used directly [misc-include-cleaner]

Check warning on line 8 in tests/myproj/src/main/main.cpp

View workflow job for this annotation

GitHub Actions / Test (windows-2022, gcc, true)

included header string is not used directly [misc-include-cleaner]
#include <string_view>

Check warning on line 9 in tests/myproj/src/main/main.cpp

View workflow job for this annotation

GitHub Actions / Test (ubuntu-22.04, llvm, true)

included header string_view is not used directly [misc-include-cleaner]

Check warning on line 9 in tests/myproj/src/main/main.cpp

View workflow job for this annotation

GitHub Actions / Test (windows-2022, gcc, true)

included header string_view is not used directly [misc-include-cleaner]

Expand All @@ -18,31 +15,15 @@
#include <cstdint>

Check warning on line 15 in tests/myproj/src/main/main.cpp

View workflow job for this annotation

GitHub Actions / Test (ubuntu-22.04, llvm, true)

included header cstdint is not used directly [misc-include-cleaner]

Check warning on line 15 in tests/myproj/src/main/main.cpp

View workflow job for this annotation

GitHub Actions / Test (windows-2022, gcc, true)

included header cstdint is not used directly [misc-include-cleaner]
#include <cstring>

static std::string const usage{
R"(main.
Usage:
main
main (-h | --help)
main --version
Options:
-h --help Show this screen.
--version Show version.
)"};

int main(int argc, char const* argv[]) {
std::map<std::string, docopt::value> args{docopt::docopt(usage, {argv + 1, argv + argc}, /*help=*/true, "main 1.0")};
for (auto const& arg : args) {
fmt::println("{}: {}", arg.first, fmt::streamed(arg.second));
}
int main() {
fmt::print("Hello from fmt{}", "!");

Eigen::VectorXd eigen_vec = Eigen::Vector3d(1, 2, 3);

Check warning on line 21 in tests/myproj/src/main/main.cpp

View workflow job for this annotation

GitHub Actions / Test (ubuntu-22.04, llvm, true)

no header providing "Eigen::VectorXd" is directly included [misc-include-cleaner]

Check warning on line 21 in tests/myproj/src/main/main.cpp

View workflow job for this annotation

GitHub Actions / Test (windows-2022, gcc, true)

no header providing "Eigen::VectorXd" is directly included [misc-include-cleaner]
fmt::println("[{}]", fmt::join(eigen_vec, ", "));
fmt::print("[{}]", fmt::join(eigen_vec, ", "));

Check warning on line 22 in tests/myproj/src/main/main.cpp

View workflow job for this annotation

GitHub Actions / Test (ubuntu-22.04, llvm, true)

no header providing "fmt::join" is directly included [misc-include-cleaner]

Check warning on line 22 in tests/myproj/src/main/main.cpp

View workflow job for this annotation

GitHub Actions / Test (windows-2022, gcc, true)

no header providing "fmt::join" is directly included [misc-include-cleaner]

#if !defined(__MINGW32__) && !defined(__MSYS__)// TODO fails
Eigen::VectorXd eigen_vec2 = Eigen::VectorXd::LinSpaced(10, 0, 1);

Check warning on line 25 in tests/myproj/src/main/main.cpp

View workflow job for this annotation

GitHub Actions / Test (ubuntu-22.04, llvm, true)

10 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers]

Check warning on line 25 in tests/myproj/src/main/main.cpp

View workflow job for this annotation

GitHub Actions / Test (macos-13, llvm, true)

10 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers]

Check warning on line 25 in tests/myproj/src/main/main.cpp

View workflow job for this annotation

GitHub Actions / Test (macos-13, llvm, true)

10 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers]

Check warning on line 25 in tests/myproj/src/main/main.cpp

View workflow job for this annotation

GitHub Actions / Test (macos-13, gcc, true)

10 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers]

Check warning on line 25 in tests/myproj/src/main/main.cpp

View workflow job for this annotation

GitHub Actions / Test (macos-13, gcc, true)

10 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers]
fmt::println("[{}]", fmt::join(eigen_vec2, ", "));
fmt::print("[{}]", fmt::join(eigen_vec2, ", "));
#endif

// trigger address sanitizer
Expand Down

0 comments on commit 15fe2fb

Please sign in to comment.