Skip to content

Commit

Permalink
-Move dwarf4 testing out of Makefile.
Browse files Browse the repository at this point in the history
-TODO:Move dwarf versions testing to os-level/Dockerfile. This avoids having to rely on expiremental features of DWARF support for some gcc versions/DWARF version combinations.
-Update Catch2 for Ubuntu22. catchorg/Catch2#2178
  • Loading branch information
lorenzo-gomez-windhover committed Sep 17, 2024
2 parents ceefe40 + d5bf6fa commit b1f1466
Show file tree
Hide file tree
Showing 6 changed files with 1,710 additions and 4,616 deletions.
2 changes: 1 addition & 1 deletion Catch2
Submodule Catch2 updated 74 files
+9 −13 .travis.yml
+11 −4 BUILD.bazel
+3 −0 CMake/catch2.pc.in
+39 −13 CMakeLists.txt
+4 −4 README.md
+1 −1 codecov.yml
+1 −1 conanfile.py
+33 −2 contrib/Catch.cmake
+55 −1 contrib/CatchAddTests.cmake
+35 −8 contrib/ParseAndAddCatchTests.cmake
+54 −2 docs/cmake-integration.md
+3 −3 docs/contributing.md
+7 −0 docs/deprecations.md
+3 −3 docs/generators.md
+14 −0 docs/limitations.md
+3 −0 docs/opensource-users.md
+1 −1 docs/other-macros.md
+139 −2 docs/release-notes.md
+34 −0 docs/slow-compiles.md
+1 −1 docs/tutorial.md
+1 −1 examples/302-Gen-Table.cpp
+16 −16 include/catch.hpp
+1 −3 include/internal/benchmark/catch_constructor.hpp
+1 −0 include/internal/benchmark/catch_execution_plan.hpp
+3 −1 include/internal/benchmark/detail/catch_estimate_clock.hpp
+1 −1 include/internal/benchmark/detail/catch_run_for_at_least.hpp
+2 −2 include/internal/benchmark/detail/catch_stats.cpp
+2 −2 include/internal/benchmark/detail/catch_stats.hpp
+1 −1 include/internal/catch_approx.h
+14 −21 include/internal/catch_compiler_capabilities.h
+44 −0 include/internal/catch_config_uncaught_exceptions.hpp
+1 −1 include/internal/catch_debugger.h
+10 −2 include/internal/catch_default_main.hpp
+1 −1 include/internal/catch_enum_values_registry.cpp
+139 −71 include/internal/catch_fatal_condition.cpp
+42 −43 include/internal/catch_fatal_condition.h
+6 −1 include/internal/catch_generators_generic.hpp
+2 −0 include/internal/catch_interfaces_reporter.h
+2 −2 include/internal/catch_matchers_floating.cpp
+1 −1 include/internal/catch_output_redirect.cpp
+9 −6 include/internal/catch_platform.h
+48 −9 include/internal/catch_run_context.cpp
+1 −0 include/internal/catch_run_context.h
+5 −1 include/internal/catch_session.cpp
+18 −14 include/internal/catch_test_case_registry_impl.cpp
+8 −0 include/internal/catch_test_case_tracker.cpp
+4 −0 include/internal/catch_test_case_tracker.h
+34 −34 include/internal/catch_test_registry.h
+2 −2 include/internal/catch_tostring.h
+2 −0 include/internal/catch_uncaught_exceptions.cpp
+1 −1 include/internal/catch_version.cpp
+28 −9 include/reporters/catch_reporter_junit.cpp
+4 −3 include/reporters/catch_reporter_junit.h
+29 −1 projects/CMakeLists.txt
+1 −0 projects/ExtraTests/X01-PrefixedMacros.cpp
+4 −0 projects/ExtraTests/X02-DisabledMacros.cpp
+6 −0 projects/SelfTest/Baselines/compact.sw.approved.txt
+42 −2 projects/SelfTest/Baselines/console.std.approved.txt
+56 −2 projects/SelfTest/Baselines/console.sw.approved.txt
+35 −1 projects/SelfTest/Baselines/junit.sw.approved.txt
+25 −0 projects/SelfTest/Baselines/sonarqube.sw.approved.txt
+61 −5 projects/SelfTest/Baselines/xml.sw.approved.txt
+3 −0 projects/SelfTest/IntrospectiveTests/GeneratorsImpl.tests.cpp
+11 −0 projects/SelfTest/IntrospectiveTests/ToString.tests.cpp
+7 −0 projects/SelfTest/UsageTests/Approx.tests.cpp
+14 −1 projects/SelfTest/UsageTests/Condition.tests.cpp
+9 −11 projects/SelfTest/UsageTests/Generators.tests.cpp
+4 −2 projects/SelfTest/UsageTests/Matchers.tests.cpp
+16 −0 projects/SelfTest/UsageTests/Message.tests.cpp
+25 −0 projects/SelfTest/UsageTests/Tricky.tests.cpp
+5 −2 scripts/approvalTests.py
+11 −9 scripts/releaseCommon.py
+451 −274 single_include/catch2/catch.hpp
+2 −0 src/catch_with_main.cpp
44 changes: 9 additions & 35 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ CATCH2_DIR := $(ROOT_DIR)/Catch2
# Unit test directories
UT_SRC_DIR := $(ROOT_DIR)/unit-test
UT_OBJ_DIR := $(BUILD_DIR)/ut_obj
UT_OBJ_DWARF4_DIR := $(BUILD_DIR)/ut_obj_dwarf4
UT_OBJ_32BIT_DIR := $(BUILD_DIR)/ut_obj_32
UT_OBJ_DWARF4_32BIT_DIR := $(BUILD_DIR)/ut_obj_32_dwarf4
UT_BIN_DIR := $(BUILD_DIR)
UT_INCLUDES := -I$(CATCH2_DIR)/single_include/catch2

Expand All @@ -29,44 +27,29 @@ OBJ := $(SRC:$(SRC_DIR)/%.cpp=$(OBJ_DIR)/%.o)

# Unit test files
UT_EXE := $(UT_BIN_DIR)/juicer-ut
UT_DWARF4_EXE := $(UT_BIN_DIR)/juicer-ut-dwarf4

UT_EXE_32BIT := $(UT_BIN_DIR)/juicer-ut-32
UT_DWARF4_EXE_32BIT := $(UT_BIN_DIR)/juicer-ut-dwarf4-32
UT_SRC := $(wildcard $(UT_SRC_DIR)/*.cpp) $(filter-out $(SRC_DIR)/main.cpp, $(SRC))
UT_OBJ := $(UT_SRC:$(UT_SRC_DIR)/%.cpp=$(UT_OBJ_DIR)/%.o)
UT_OBJ := $(UT_OBJ:$(SRC_DIR)/%.cpp=$(UT_OBJ_DIR)/%.o)


UT_SRC_DWARF4 := $(wildcard $(UT_SRC_DIR)/test_file*.cpp)
UT_OBJ_DWARF4 := $(UT_SRC_DWARF4:$(UT_SRC_DIR)/test_file%.cpp=$(UT_OBJ_DWARF4_DIR)/test_file%.o)
UT_OBJ_DWARF4 := $(UT_OBJ_DWARF4:$(UT_SRC_DIR)/test_file%.cpp=$(UT_OBJ_DWARF4_DIR)/test_file%.o)

UT_SRC_32 := $(wildcard $(UT_SRC_DIR)/test_file*.cpp)
UT_OBJ_32 := $(UT_SRC_32:$(UT_SRC_DIR)/test_file%.cpp=$(UT_OBJ_32BIT_DIR)/test_file%.o)
UT_OBJ_32 := $(UT_OBJ_32:$(UT_SRC_DIR)/test_file%.cpp=$(UT_OBJ_32BIT_DIR)/test_file%.o)


UT_SRC_DWARF4_32 := $(wildcard $(UT_SRC_DIR)/test_file*.cpp)
UT_OBJ_DWARF4_32 := $(UT_SRC_DWARF4_32:$(UT_SRC_DIR)/test_file%.cpp=$(UT_OBJ_DWARF4_32BIT_DIR)/test_file%.o)
UT_OBJ_DWARF4_32 := $(UT_OBJ_DWARF4_32:$(UT_SRC_DIR)/test_file%.cpp=$(UT_OBJ_DWARF4_32BIT_DIR)/test_file%.o)


# Set target flags
CPPFLAGS := -MMD -MP -std=c++14 -fmessage-length=0 $(INCLUDES)
CFLAGS := -Wall -g3 -gdwarf-5
CFLAGS_DWARF4 := -Wall -g3 -gdwarf-4
CFLAGS_32BIT := -Wall -g3 -m32 -gdwarf-5
CFLAGS_DWARF4_32BIT := -Wall -g3 -m32 -gdwarf-4
CFLAGS := -Wall -g3
CFLAGS_32BIT := -Wall -g3 -m32
LDFLAGS := -Llib
LDLIBS := -lm -ldwarf -lsqlite3 -lelf -lcrypto

# Set unit test flags
UT_CPPFLAGS := $(CPPFLAGS) $(UT_INCLUDES)
UT_CFLAGS_DWARF4 := $(CFLAGS_DWARF4) --coverage
UT_CFLAGS := $(CFLAGS) --coverage
UT_CFLAGS_32BIT := $(CFLAGS_32BIT) --coverage
UT_CFLAGS_DWARF4_32BIT := $(CFLAGS_DWARF4_32BIT) --coverage
UT_LDFLAGS := $(LDFLAGS)
UT_LDLIBS := $(LDLIBS) -lgcov

Expand All @@ -91,11 +74,9 @@ $(UT_EXE): $(UT_OBJ)
$(LD) $(UT_LDFLAGS) $^ $(UT_LDLIBS) -o $@


$(UT_DWARF4_EXE): $(UT_OBJ_DWARF4)

$(UT_EXE_32BIT): $(UT_OBJ_32)

$(UT_DWARF4_EXE_32BIT): $(UT_OBJ_DWARF4_32)

$(UT_OBJ_DIR)/%.o: $(UT_SRC_DIR)/%.cpp | $(UT_OBJ_DIR)
$(CC) $(UT_CPPFLAGS) $(UT_CFLAGS) -c $< -o $@
Expand All @@ -105,35 +86,22 @@ $(UT_OBJ_DIR)/%.o: $(UT_SRC_DIR)/%.cpp | $(UT_OBJ_DIR)
$(CC) $(UT_CPPFLAGS) $(UT_CFLAGS) -c $< -o $@


$(UT_OBJ_DWARF4_DIR)/test_file%.o: $(UT_SRC_DIR)/test_file%.cpp | $(UT_OBJ_DWARF4_DIR)
$(CC) $(UT_CPPFLAGS) $(UT_CFLAGS_DWARF4) -c $< -o $@


$(UT_OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp | $(UT_OBJ_DIR)
$(CC) $(UT_CPPFLAGS) $(UT_CFLAGS) -c $< -o $@

$(UT_OBJ_32BIT_DIR)/test_file%.o: $(UT_SRC_DIR)/test_file%.cpp | $(UT_OBJ_32BIT_DIR)
$(CC) $(UT_CPPFLAGS) $(UT_CFLAGS_32BIT) -c $< -o $@

$(UT_OBJ_DWARF4_32BIT_DIR)/test_file%.o: $(UT_SRC_DIR)/test_file%.cpp | $(UT_OBJ_DWARF4_32BIT_DIR)
$(CC) $(UT_CPPFLAGS) $(UT_CFLAGS_32BIT) -c $< -o $@


$(UT_OBJ_DIR):
mkdir -p $@

$(UT_OBJ_DWARF4_DIR):
mkdir -p $@


$(UT_OBJ_32BIT_DIR):
mkdir -p $@


$(UT_OBJ_DWARF4_32BIT_DIR):
mkdir -p $@


run-tests: $(UT_EXE_32BIT) | $(UT_EXE)
-(cd $(BUILD_DIR); $(UT_EXE))

Expand All @@ -147,7 +115,7 @@ $(COVERAGE_DIR)/index.html: | run-tests
(cd $(COVERAGE_DIR); gcovr $(ROOT_DIR) --root $(ROOT_DIR) --object-directory $(UT_OBJ_DIR) --filter $(ROOT_DIR)/src/ --html --html-details -o index.html)


all: $(EXE) $(UT_EXE) $(UT_DWARF4_EXE) $(UT_EXE_32BIT) $(UT_DWARF4_EXE_32BIT)
all: $(EXE) $(UT_EXE) $(UT_EXE_32BIT)

clean:
@$(RM) -Rf $(BUILD_DIR)
Expand All @@ -159,6 +127,12 @@ docker-build:
@sudo docker build --no-cache -t juicer:latest -f Dockerfile .



docker-build-dev:
@sudo docker build --no-cache -t juicer-dev:latest -f Dockerfile.dev .
@sudo docker run -v .:/home/docker/juicer -it juicer-dev:latest bash


check-format:
@python3 clang_format_all.py --config clang_format_all_config.yaml

Expand Down
1 change: 1 addition & 0 deletions src/Artifact.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#define SRC_ARTIFACT_H_

#include <string>
#include <cstdint>

class ElfFile;

Expand Down
Loading

0 comments on commit b1f1466

Please sign in to comment.