-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests: Add initial set of unit tests for Detours (#137)
- Import the Catch2 self-contained C++ test framework. It's used by many Microsoft OSS projects: - https://github.com/microsoft/cppwinrt/tree/master/test - https://github.com/microsoft/wil/tree/master/tests As well as many OSS projects in general. When the CMake PR is merged, we can remove this as a checked in development dependency, and can instead download it using CMake. - Start basic set of unit tests to validate failure modes of - Hook the execution into the existing NMake build system. - Hook test execution into CI pipeline
- Loading branch information
Showing
9 changed files
with
18,171 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
############################################################################## | ||
## | ||
## Detours Unit Tests. | ||
## | ||
## Microsoft Research Detours Package | ||
## | ||
## Copyright (c) Microsoft Corporation. All rights reserved. | ||
## | ||
|
||
ROOT = .. | ||
!include ..\samples\common.mak | ||
|
||
DEPS = $(LIBD)\detours.lib | ||
LIBS=$(LIBS) kernel32.lib | ||
CFLAGS=$(CFLAGS) /EHsc /DCATCH_CONFIG_NO_WINDOWS_SEH | ||
|
||
############################################################################## | ||
|
||
all: dirs \ | ||
$(BIND)\unittests.exe \ | ||
\ | ||
|
||
############################################################################## | ||
|
||
dirs: | ||
@if not exist $(BIND) mkdir $(BIND) && echo. Created $(BIND) | ||
@if not exist $(OBJD) mkdir $(OBJD) && echo. Created $(OBJD) | ||
|
||
$(OBJD)\main.obj : main.cpp | ||
$(OBJD)\test_module_api.obj : test_module_api.cpp | ||
$(OBJD)\test_image_api.obj : test_image_api.cpp | ||
$(OBJD)\corruptor.obj : corruptor.cpp | ||
|
||
$(BIND)\unittests.exe : $(OBJD)\main.obj \ | ||
$(OBJD)\test_module_api.obj \ | ||
$(OBJD)\test_image_api.obj \ | ||
$(OBJD)\corruptor.obj $(DEPS) | ||
cl $(CFLAGS) /Fe$@ /Fd$(@R).pdb \ | ||
$(OBJD)\main.obj \ | ||
$(OBJD)\test_module_api.obj \ | ||
$(OBJD)\test_image_api.obj \ | ||
$(OBJD)\corruptor.obj \ | ||
/link $(LINKFLAGS) $(LIBS) /subsystem:console | ||
|
||
############################################################################## | ||
|
||
clean: | ||
-del *~ 2>nul | ||
-del $(BIND)\unittests*.* 2>nul | ||
-rmdir /q /s $(OBJD) 2>nul | ||
|
||
realclean: clean | ||
-rmdir /q /s $(OBJDS) 2>nul | ||
|
||
option: | ||
############################################################################## | ||
|
||
test: all | ||
@cls | ||
$(BIND)\unittests.exe --reporter console --success --durations yes | ||
|
||
debug: all | ||
windbg -o $(BIND)\unittests.exe | ||
|
||
|
||
################################################################# End of File. |
Oops, something went wrong.