Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consumed catch2 from usersim path #3973

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
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
6 changes: 3 additions & 3 deletions .azure/reusable-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,14 @@ jobs:
- script: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat"
set EBPF_ENABLE_WER_REPORT=yes
OpenCppCoverage.exe -q --cover_children --sources $(Build.SourcesDirectory)\$(PROJECT_NAME) --excluded_sources $(Build.SourcesDirectory)\$(PROJECT_NAME)\external\Catch2 --export_type cobertura:ebpf_for_windows.xml --working_dir $(BUILD_PLATFORM)\$(BUILD_CONFIGURATION) -- $(BUILD_PLATFORM)\$(BUILD_CONFIGURATION)\$(TEST_COMMAND)
OpenCppCoverage.exe -q --cover_children --sources $(Build.SourcesDirectory)\$(PROJECT_NAME) --excluded_sources $(Build.SourcesDirectory)\$(PROJECT_NAME)\external\usersim\external\Catch2 --export_type cobertura:ebpf_for_windows.xml --working_dir $(BUILD_PLATFORM)\$(BUILD_CONFIGURATION) -- $(BUILD_PLATFORM)\$(BUILD_CONFIGURATION)\$(TEST_COMMAND)
workingDirectory: $(Build.SourcesDirectory)/$(PROJECT_NAME)
condition: and(eq('${{parameters.code_coverage}}', 'true'), eq('${{parameters.vs_dev}}', 'true'))
name: run_test_with_code_coverage_in_vs_dev
displayName: Run test with Code Coverage in VS Dev environment

- script: |
OpenCppCoverage.exe -q --cover_children --sources $(Build.SourcesDirectory)\$(PROJECT_NAME) --excluded_sources $(Build.SourcesDirectory)\$(PROJECT_NAME)\external\Catch2 --export_type cobertura:ebpf_for_windows.xml --working_dir $(BUILD_PLATFORM)\$(BUILD_CONFIGURATION) -- powershell.exe .\Test-FaultInjection.ps1 $(DUMP_PATH) $(TEST_TIMEOUT) $(TEST_COMMAND) 4
OpenCppCoverage.exe -q --cover_children --sources $(Build.SourcesDirectory)\$(PROJECT_NAME) --excluded_sources $(Build.SourcesDirectory)\$(PROJECT_NAME)\external\usersim\external\Catch2 --export_type cobertura:ebpf_for_windows.xml --working_dir $(BUILD_PLATFORM)\$(BUILD_CONFIGURATION) -- powershell.exe .\Test-FaultInjection.ps1 $(DUMP_PATH) $(TEST_TIMEOUT) $(TEST_COMMAND) 4
workingDirectory: $(Build.SourcesDirectory)/$(PROJECT_NAME)
condition: and(eq('${{parameters.code_coverage}}', 'true'), eq('${{parameters.fault_injection}}', 'true'))
name: run_test_with_code_coverage_with_fault_injection
Expand All @@ -209,7 +209,7 @@ jobs:

- script: |
set EBPF_ENABLE_WER_REPORT=yes
OpenCppCoverage.exe -q --sources $(Build.SourcesDirectory)\$(PROJECT_NAME) --excluded_sources $(Build.SourcesDirectory)\$(PROJECT_NAME)\external\Catch2 --export_type cobertura:ebpf_for_windows.xml --working_dir $(BUILD_PLATFORM)\$(BUILD_CONFIGURATION) -- powershell .\Run-Test.ps1 $(DUMP_PATH) $(TEST_TIMEOUT) $(TEST_COMMAND)
OpenCppCoverage.exe -q --sources $(Build.SourcesDirectory)\$(PROJECT_NAME) --excluded_sources $(Build.SourcesDirectory)\$(PROJECT_NAME)\external\usersim\external\Catch2 --export_type cobertura:ebpf_for_windows.xml --working_dir $(BUILD_PLATFORM)\$(BUILD_CONFIGURATION) -- powershell .\Run-Test.ps1 $(DUMP_PATH) $(TEST_TIMEOUT) $(TEST_COMMAND)
workingDirectory: $(Build.SourcesDirectory)/$(PROJECT_NAME)
condition: and(eq('${{parameters.code_coverage}}', 'true'), ne('${{parameters.vs_dev}}', 'true'), ne('${{parameters.fault_injection}}', 'true'))
name: run_test_with_code_coverage
Expand Down
1 change: 0 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ updates:
generic:
patterns:
- "external/win-c"
- "external/Catch2"
- "external/pe-parse"
- "tests/external/kissfft"

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/reusable-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -253,15 +253,15 @@ jobs:
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat"
set EBPF_ENABLE_WER_REPORT=yes
OpenCppCoverage.exe -q --cover_children --sources %CD% --excluded_sources %CD%\external\Catch2 --export_type cobertura:ebpf_for_windows.xml --working_dir ${{env.BUILD_PLATFORM}}\${{env.BUILD_CONFIGURATION}} -- ${{env.BUILD_PLATFORM}}\${{env.BUILD_CONFIGURATION}}\${{env.TEST_COMMAND}}
OpenCppCoverage.exe -q --cover_children --sources %CD% --excluded_sources %CD%\external\usersim\external\Catch2 --export_type cobertura:ebpf_for_windows.xml --working_dir ${{env.BUILD_PLATFORM}}\${{env.BUILD_CONFIGURATION}} -- ${{env.BUILD_PLATFORM}}\${{env.BUILD_CONFIGURATION}}\${{env.TEST_COMMAND}}

- name: Run test with Code Coverage and low resource simulation
if: (inputs.code_coverage == true) && (inputs.fault_injection == true) && (steps.skip_check.outputs.should_skip != 'true')
id: run_test_with_code_coverage_in_fault_injection
shell: cmd
run: |
set EBPF_ENABLE_WER_REPORT=yes
OpenCppCoverage.exe -q --cover_children --sources %CD% --excluded_sources %CD%\external\Catch2 --export_type cobertura:ebpf_for_windows.xml --working_dir ${{env.BUILD_PLATFORM}}\${{env.BUILD_CONFIGURATION}} -- powershell.exe .\Test-FaultInjection.ps1 ${{env.DUMP_PATH}} ${{env.TEST_TIMEOUT}} ${{env.TEST_COMMAND}} 8
OpenCppCoverage.exe -q --cover_children --sources %CD% --excluded_sources %CD%\external\usersim\external\Catch2 --export_type cobertura:ebpf_for_windows.xml --working_dir ${{env.BUILD_PLATFORM}}\${{env.BUILD_CONFIGURATION}} -- powershell.exe .\Test-FaultInjection.ps1 ${{env.DUMP_PATH}} ${{env.TEST_TIMEOUT}} ${{env.TEST_COMMAND}} 8

- name: Run test with low resource simulation
if: (inputs.code_coverage != true) && (inputs.fault_injection == true) && (steps.skip_check.outputs.should_skip != 'true')
Expand All @@ -278,7 +278,7 @@ jobs:
shell: cmd
run: |
set EBPF_ENABLE_WER_REPORT=yes
OpenCppCoverage.exe -q --sources %CD% --excluded_sources %CD%\external\Catch2 --export_type cobertura:ebpf_for_windows.xml --working_dir ${{env.BUILD_PLATFORM}}\${{env.BUILD_CONFIGURATION}} -- powershell .\Run-Test.ps1 ${{env.DUMP_PATH}} ${{env.TEST_TIMEOUT}} ${{env.TEST_COMMAND}}
OpenCppCoverage.exe -q --sources %CD% --excluded_sources %CD%\external\usersim\external\Catch2 --export_type cobertura:ebpf_for_windows.xml --working_dir ${{env.BUILD_PLATFORM}}\${{env.BUILD_CONFIGURATION}} -- powershell .\Run-Test.ps1 ${{env.DUMP_PATH}} ${{env.TEST_TIMEOUT}} ${{env.TEST_COMMAND}}

- name: Run test on self-hosted runner
if: (inputs.code_coverage == false) && (steps.skip_check.outputs.should_skip != 'true') && (inputs.environment == 'ebpf_cicd_tests_ws2019' || inputs.environment == 'ebpf_cicd_tests_ws2022' || inputs.environment == 'ebpf_cicd_perf_ws2022') && (inputs.fault_injection != true)
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
[submodule "external/win-c"]
path = external/win-c
url = https://github.com/takamin/win-c.git
[submodule "external/Catch2"]
path = external/Catch2
url = https://github.com/catchorg/Catch2.git
[submodule "external/pe-parse"]
path = external/pe-parse
url = https://github.com/trailofbits/pe-parse.git
Expand Down
4 changes: 2 additions & 2 deletions ebpf-for-windows.sln
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bpf2c_tests", "tests\bpf2c_
{B4AD72E3-754E-40CA-9CEA-D3F2C9170E51} = {B4AD72E3-754E-40CA-9CEA-D3F2C9170E51}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Catch2WithMain", "external\Catch2\build\src\Catch2WithMain.vcxproj", "{8BD3552A-2CFB-4A59-AB15-2031B97ADA1E}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Catch2WithMain", "external\usersim\external\Catch2\build\src\Catch2WithMain.vcxproj", "{8BD3552A-2CFB-4A59-AB15-2031B97ADA1E}"
ProjectSection(ProjectDependencies) = postProject
{231EE32B-EBA4-4FE5-A55B-DB18F539D403} = {231EE32B-EBA4-4FE5-A55B-DB18F539D403}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Catch2", "external\Catch2\build\src\Catch2.vcxproj", "{8D538CBE-01BF-4A2E-A98A-6C368FDF13D7}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Catch2", "external\usersim\external\Catch2\build\src\Catch2.vcxproj", "{8D538CBE-01BF-4A2E-A98A-6C368FDF13D7}"
ProjectSection(ProjectDependencies) = postProject
{231EE32B-EBA4-4FE5-A55B-DB18F539D403} = {231EE32B-EBA4-4FE5-A55B-DB18F539D403}
EndProjectSection
Expand Down
1 change: 0 additions & 1 deletion external/Catch2
Submodule Catch2 deleted from 8898cc
2 changes: 1 addition & 1 deletion external/ebpf-verifier
Submodule ebpf-verifier updated 73 files
+26 −47 README.md
+1 −1 ebpf-samples
+0 −0 external/CLI11.hpp
+1 −1 external/bpf_conformance
+1 −1 external/libbtf
+1 −1 scripts/.check-license.ignore
+0 −304 scripts/format-code
+0 −337 scripts/format-code.ps1
+0 −4 scripts/pre-commit
+28 −34 src/asm_cfg.cpp
+14 −12 src/asm_files.cpp
+2 −2 src/asm_files.hpp
+4 −2 src/asm_marshal.cpp
+87 −104 src/asm_ostream.cpp
+19 −5 src/asm_ostream.hpp
+1 −1 src/asm_parse.cpp
+16 −37 src/asm_syntax.hpp
+1 −1 src/asm_unmarshal.cpp
+1 −1 src/asm_unmarshal.hpp
+66 −69 src/assertions.cpp
+17 −0 src/config.cpp
+13 −28 src/config.hpp
+2 −1 src/crab/add_bottom.hpp
+4 −4 src/crab/array_domain.cpp
+10 −10 src/crab/bitset_domain.cpp
+7 −7 src/crab/bitset_domain.hpp
+47 −57 src/crab/cfg.hpp
+41 −89 src/crab/ebpf_domain.cpp
+16 −19 src/crab/ebpf_domain.hpp
+26 −23 src/crab/fwd_analyzer.cpp
+1 −1 src/crab/fwd_analyzer.hpp
+30 −30 src/crab/split_dbm.cpp
+1 −1 src/crab/split_dbm.hpp
+13 −11 src/crab/thresholds.cpp
+3 −3 src/crab/thresholds.hpp
+25 −9 src/crab/type_domain.cpp
+9 −3 src/crab/type_domain.hpp
+1 −1 src/crab/wto.cpp
+0 −15 src/crab/wto.hpp
+4 −4 src/crab_utils/adapt_sgraph.hpp
+1 −1 src/crab_utils/debug.cpp
+1 −1 src/crab_utils/debug.hpp
+21 −21 src/crab_utils/graph_ops.hpp
+17 −16 src/crab_utils/stats.cpp
+1 −1 src/crab_utils/stats.hpp
+30 −25 src/crab_verifier.cpp
+3 −3 src/crab_verifier.hpp
+0 −11 src/ebpf_base.h
+2 −2 src/linux/gpl/spec_prototypes.cpp
+11 −12 src/linux/linux_platform.cpp
+15 −15 src/main/check.cpp
+1 −1 src/main/linux_verifier.cpp
+1 −1 src/main/run_yaml.cpp
+3 −5 src/main/utils.hpp
+4 −9 src/spec_type_descriptors.hpp
+4 −4 src/test/conformance_check.cpp
+31 −37 src/test/ebpf_yaml.cpp
+3 −3 src/test/ebpf_yaml.hpp
+5 −5 src/test/test_conformance.cpp
+13 −14 src/test/test_marshal.cpp
+2 −1 src/test/test_print.cpp
+79 −79 src/test/test_verify.cpp
+3 −3 src/test/test_wto.cpp
+0 −18 test-data/assign.yaml
+0 −40 test-data/atomic.yaml
+3 −15 test-data/call.yaml
+0 −35 test-data/calllocal.yaml
+1 −10 test-data/callx.yaml
+0 −3 test-data/jump.yaml
+1 −198 test-data/loop.yaml
+0 −68 test-data/pointer.yaml
+0 −23 test-data/stack.yaml
+6 −13 test-data/subtract.yaml
2 changes: 1 addition & 1 deletion external/usersim
6 changes: 3 additions & 3 deletions netebpfext/user/netebpfext_user.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<ClCompile>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>$(SolutionDir)include;$(SolutionDir)libs\shared;$(SolutionDir)libs\shared\user;$(SolutionDir)libs\runtime;$(SolutionDir)libs\runtime\user;$(SolutionDir)external\usersim\inc;$(SolutionDir)external\usersim\src;$(SolutionDir)external\usersim\cxplat\inc;$(SolutionDir)external\usersim\cxplat\inc\winuser;$(OutputPath);$(SolutionDir)external\ebpf-verifier\src;$(SolutionDir)include\user;$(SolutionDir)netebpfext;$(SolutionDir)netebpfext\user;$(SolutionDir)libs\thunk;$(SolutionDir)tests\libs\util;$(SolutionDir)external\catch2\src;$(SolutionDir)external\catch2\build\generated-includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(SolutionDir)include;$(SolutionDir)libs\shared;$(SolutionDir)libs\shared\user;$(SolutionDir)libs\runtime;$(SolutionDir)libs\runtime\user;$(SolutionDir)external\usersim\inc;$(SolutionDir)external\usersim\src;$(SolutionDir)external\usersim\cxplat\inc;$(SolutionDir)external\usersim\cxplat\inc\winuser;$(OutputPath);$(SolutionDir)external\ebpf-verifier\src;$(SolutionDir)include\user;$(SolutionDir)netebpfext;$(SolutionDir)netebpfext\user;$(SolutionDir)libs\thunk;$(SolutionDir)tests\libs\util;$(SolutionDir)external\usersim\external\catch2\src;$(SolutionDir)external\usersim\external\catch2\build\generated-includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Zc:strictStrings- %(AdditionalOptions)</AdditionalOptions>
<CompileAs>CompileAsCpp</CompileAs>
<DisableSpecificWarnings>4505</DisableSpecificWarnings>
Expand All @@ -80,7 +80,7 @@
<ClCompile>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>$(SolutionDir)include;$(SolutionDir)libs\shared;$(SolutionDir)libs\shared\user;$(SolutionDir)libs\runtime;$(SolutionDir)libs\runtime\user;$(SolutionDir)external\usersim\inc;$(SolutionDir)external\usersim\src;$(SolutionDir)external\usersim\cxplat\inc;$(SolutionDir)external\usersim\cxplat\inc\winuser;$(OutputPath);$(SolutionDir)external\ebpf-verifier\src;$(SolutionDir)include\user;$(SolutionDir)netebpfext;$(SolutionDir)netebpfext\user;$(SolutionDir)libs\thunk;$(SolutionDir)tests\libs\util;$(SolutionDir)external\catch2\src;$(SolutionDir)external\catch2\build\generated-includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(SolutionDir)include;$(SolutionDir)libs\shared;$(SolutionDir)libs\shared\user;$(SolutionDir)libs\runtime;$(SolutionDir)libs\runtime\user;$(SolutionDir)external\usersim\inc;$(SolutionDir)external\usersim\src;$(SolutionDir)external\usersim\cxplat\inc;$(SolutionDir)external\usersim\cxplat\inc\winuser;$(OutputPath);$(SolutionDir)external\ebpf-verifier\src;$(SolutionDir)include\user;$(SolutionDir)netebpfext;$(SolutionDir)netebpfext\user;$(SolutionDir)libs\thunk;$(SolutionDir)tests\libs\util;$(SolutionDir)external\usersim\external\catch2\src;$(SolutionDir)external\usersim\external\catch2\build\generated-includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/Zc:strictStrings- %(AdditionalOptions)</AdditionalOptions>
<CompileAs>CompileAsCpp</CompileAs>
<DisableSpecificWarnings>4505</DisableSpecificWarnings>
Expand All @@ -99,7 +99,7 @@
<ClCompile>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)include;$(SolutionDir)libs\shared;$(SolutionDir)libs\shared\user;$(SolutionDir)libs\runtime;$(SolutionDir)libs\runtime\user;$(SolutionDir)external\usersim\inc;$(SolutionDir)external\usersim\src;$(SolutionDir)external\usersim\cxplat\inc;$(SolutionDir)external\usersim\cxplat\inc\winuser;$(OutputPath);$(SolutionDir)external\ebpf-verifier\src;$(SolutionDir)include\user;$(SolutionDir)netebpfext;$(SolutionDir)netebpfext\user;$(SolutionDir)libs\thunk;$(SolutionDir)tests\libs\util;$(SolutionDir)external\catch2\src;$(SolutionDir)external\catch2\build\generated-includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(SolutionDir)include;$(SolutionDir)libs\shared;$(SolutionDir)libs\shared\user;$(SolutionDir)libs\runtime;$(SolutionDir)libs\runtime\user;$(SolutionDir)external\usersim\inc;$(SolutionDir)external\usersim\src;$(SolutionDir)external\usersim\cxplat\inc;$(SolutionDir)external\usersim\cxplat\inc\winuser;$(OutputPath);$(SolutionDir)external\ebpf-verifier\src;$(SolutionDir)include\user;$(SolutionDir)netebpfext;$(SolutionDir)netebpfext\user;$(SolutionDir)libs\thunk;$(SolutionDir)tests\libs\util;$(SolutionDir)external\usersim\external\catch2\src;$(SolutionDir)external\usersim\external\catch2\build\generated-includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsCpp</CompileAs>
<AdditionalOptions>/Zc:strictStrings- %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>4505</DisableSpecificWarnings>
Expand Down
2 changes: 1 addition & 1 deletion scripts/initialize_ebpf_repo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ $cmakeCommonArgs = "-G 'Visual Studio 17 2022' -A $Architecture"
$commands = @(
"git submodule update --init --recursive",
"cmake $cmakeCommonArgs -S external\ebpf-verifier -B external\ebpf-verifier\build",
"cmake $cmakeCommonArgs -S external\catch2 -B external\catch2\build -DBUILD_TESTING=OFF",
"cmake $cmakeCommonArgs -S external\usersim\external\catch2 -B external\usersim\external\catch2\build -DBUILD_TESTING=OFF",
"cmake $cmakeCommonArgs -S external\ubpf -B external\ubpf\build",
"cmake $cmakeCommonArgs -S external\ubpf -B external\ubpf\build_fuzzer -DUBPF_ENABLE_LIBFUZZER=on",
"nuget restore ebpf-for-windows.sln"
Expand Down
Loading
Loading