Skip to content
Open
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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: MIT
# found in the top-level directory of this distribution.

cmake_minimum_required(VERSION 3.11)
cmake_minimum_required(VERSION 4.0)
project(cppast VERSION 0.1.0)

if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
Expand Down
2 changes: 1 addition & 1 deletion external/external.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if(build_tool)
set(CXXOPTS_BUILD_TESTS OFF CACHE BOOL "")

message(STATUS "Fetching cxxopts")
FetchContent_Declare(cxxopts URL https://github.com/jarro2783/cxxopts/archive/v2.2.1.zip)
FetchContent_Declare(cxxopts GIT_REPOSITORY https://github.com/jarro2783/cxxopts GIT_TAG origin/master)
FetchContent_MakeAvailable(cxxopts)
endif()

Expand Down
2 changes: 1 addition & 1 deletion external/tpl/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 4.0)

project(tiny-process-library)

Expand Down
2 changes: 1 addition & 1 deletion include/cppast/cpp_entity_index.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ struct cpp_entity_id : type_safe::strong_typedef<cpp_entity_id, detail::hash_typ
inline namespace literals
{
/// \returns A new [cppast::cpp_entity_id]() created from the given string.
inline cpp_entity_id operator"" _id(const char* str, std::size_t)
inline cpp_entity_id operator""_id(const char* str, std::size_t)
{
return cpp_entity_id(str);
}
Expand Down
6 changes: 3 additions & 3 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Fetch catch.
message(STATUS "Fetching catch")
include(FetchContent)
FetchContent_Declare(catch URL https://github.com/catchorg/Catch2/archive/refs/tags/v2.13.9.zip)
FetchContent_Declare(catch GIT_REPOSITORY https://github.com/catchorg/Catch2 GIT_TAG devel)
FetchContent_MakeAvailable(catch)

set(tests
Expand Down Expand Up @@ -42,9 +42,9 @@ foreach(file ${files})
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/cppast_files.hpp "\"${CMAKE_CURRENT_SOURCE_DIR}/../src/${file}\",\n")
endforeach()

add_executable(cppast_test test.cpp test_parser.hpp ${tests})
add_executable(cppast_test test_parser.hpp ${tests})
target_include_directories(cppast_test PRIVATE ${CMAKE_CURRENT_LIST_DIR}/../src ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(cppast_test PUBLIC cppast Catch2)
target_link_libraries(cppast_test PUBLIC cppast Catch2::Catch2WithMain)
target_compile_definitions(cppast_test PUBLIC CPPAST_INTEGRATION_FILE="${CMAKE_CURRENT_SOURCE_DIR}/integration.cpp"
CPPAST_COMPILE_COMMANDS="${CMAKE_BINARY_DIR}")

Expand Down
2 changes: 1 addition & 1 deletion test/cpp_friend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

using namespace cppast;

TEST_CASE("cpp_friend", "[!hide][clang4]")
TEST_CASE("cpp_friend", "[.][clang4]")
{
auto code = R"(
/// b
Expand Down
6 changes: 5 additions & 1 deletion test/cpp_preprocessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ TEST_CASE("command line macro definition")
REQUIRE(!logger.error);
}

static bool endsWith( std::string const& s, std::string const& suffix ) {
return s.size() >= suffix.size() && std::equal(suffix.rbegin(), suffix.rend(), s.rbegin());
}

TEST_CASE("cpp_include_directive")
{
write_file("cpp_include_directive-header.hpp", R"(
Expand Down Expand Up @@ -149,7 +153,7 @@ b
REQUIRE(include.target().name() == include.name());
REQUIRE(include.include_kind() == cppast::cpp_include_kind::system);
REQUIRE(include.target().get(idx).empty());
REQUIRE_THAT(include.full_path(), Catch::EndsWith("iostream"));
REQUIRE(endsWith(include.full_path(), std::string("iostream")));
}
else if (include.name() == "cpp_include_directive-header.hpp")
{
Expand Down
2 changes: 1 addition & 1 deletion test/cpp_token.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <cppast/cpp_token.hpp>

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>

#include <algorithm>
#include <initializer_list>
Expand Down
4 changes: 2 additions & 2 deletions test/integration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

using namespace cppast;

TEST_CASE("stdlib", "[!hide][integration]")
TEST_CASE("stdlib", "[.][integration]")
{
auto code = R"(
// list of headers from: http://en.cppreference.com/w/cpp/header
Expand Down Expand Up @@ -113,7 +113,7 @@ TEST_CASE("stdlib", "[!hide][integration]")
REQUIRE(!parser.error());
}

TEST_CASE("cppast", "[!hide][integration]")
TEST_CASE("cppast", "[integration]")
{
const char* files[] = {
#include <cppast_files.hpp>
Expand Down
2 changes: 1 addition & 1 deletion test/libclang_parser.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (C) 2017-2023 Jonathan Müller and cppast contributors
// SPDX-License-Identifier: MIT

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>

#include <cppast/libclang_parser.hpp>

Expand Down
2 changes: 1 addition & 1 deletion test/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <cppast/parser.hpp>

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>

using namespace cppast;

Expand Down
4 changes: 2 additions & 2 deletions test/preprocessor.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <fstream>

#include "libclang/preprocessor.hpp"
Expand All @@ -8,7 +8,7 @@

using namespace cppast;

TEST_CASE("preprocessor escaped character", "[!hide][clang4]")
TEST_CASE("preprocessor escaped character", "[.][clang4]")
{
write_file("ppec.hpp", R"(
)");
Expand Down
5 changes: 0 additions & 5 deletions test/test.cpp

This file was deleted.

2 changes: 1 addition & 1 deletion test/test_parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <fstream>

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>

#include <cppast/code_generator.hpp>
#include <cppast/cpp_class.hpp>
Expand Down
Loading