Skip to content

Commit

Permalink
build fix (#58)
Browse files Browse the repository at this point in the history
* Add logging to the detour events and move pipe init earlier

* Add exe dependency and install path parameter

* Update CI

* Run directly

* Remove tests

* Update history json tests

* Fix build history manager tests

* Fix up tests

* Add all tests to the build

* Disable core client tests for now
  • Loading branch information
mwasplund authored Aug 8, 2020
1 parent 1d83da1 commit 4bbd55b
Show file tree
Hide file tree
Showing 38 changed files with 870 additions and 566 deletions.
40 changes: 34 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: CI

on: [push]

jobs:
Expand All @@ -13,8 +12,37 @@ jobs:
- name: Setup Soup
uses: SoupBuild/Setup-Soup@v1
with:
version: v0.8.1-alpha
- name: Build Client
run: soup build Source/Client/CLI/ -v:d
- name: Run Tests
run: Scripts/InPath/AllTest.bat
version: v0.8.5-alpha
- name: Soup Install
run: soup install Source/Client/CLI/ -v:d

- name: Build Execute UnitTests
run: soup build Source/Build/Execute.UnitTests/
- name: Run Execute UnitTests
run: soup run Source/Build/Execute.UnitTests/

- name: Build Utilities UnitTests
run: soup build Source/Build/Utilities.UnitTests/
- name: Run Utilities UnitTests
run: soup run Source/Build/Utilities.UnitTests/

- name: Build Extensions Compiler Core UnitTests
run: soup build Source/Extensions/Compiler/Core.UnitTests/
- name: Run Extensions Compiler Core UnitTests
run: soup run Source/Extensions/Compiler/Core.UnitTests/

- name: Build Extensions Compiler Clang UnitTests
run: soup build Source/Extensions/Compiler/Clang.UnitTests/
- name: Run Extensions Compiler Clang UnitTests
run: soup run Source/Extensions/Compiler/Clang.UnitTests/

- name: Build Extensions Compiler MSVC UnitTests
run: soup build Source/Extensions/Compiler/MSVC.UnitTests/
- name: Run Extensions Compiler MSVC UnitTests
run: soup run Source/Extensions/Compiler/MSVC.UnitTests/

# openssl not available on CI build
# - name: Build Client Core UnitTests
# run: soup build Source/Client/Core.UnitTests/
# - name: Run Client Core UnitTests
# run: soup run Source/Client/Core.UnitTests/
2 changes: 1 addition & 1 deletion Docs/Developer-Setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* [Latest Release](https://github.com/mwasplund/Soup/releases)

### OpenSSL Requirements
* Perl. We recommend ActiveState Perl, available from https://www.activestate.com/ActivePerl
* Perl. We recommend Strawberry http://strawberryperl.com/
* Netwide Assembler, a.k.a. NASM, available from https://www.nasm.us

## Setup
Expand Down
118 changes: 34 additions & 84 deletions Scripts/alltest.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,94 +2,44 @@
SET ScriptsDir=%~dp0
SET SourceDir=%ScriptsDir%..\Source

echo %SourceDir%\Build\Execute.UnitTests\
pushd %SourceDir%\Build\Execute.UnitTests\
echo soup build %SourceDir%\Build\Execute.UnitTests\
call soup build %SourceDir%\Build\Execute.UnitTests\
if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL%
echo soup run %SourceDir%\Build\Execute.UnitTests\
call soup run %SourceDir%\Build\Execute.UnitTests\
if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL%
call soup build
if %ERRORLEVEL% NEQ 0 (
popd
exit /B %ERRORLEVEL%
)
call soup run
if %ERRORLEVEL% NEQ 0 (
echo Failed
popd
exit /B %ERRORLEVEL%
)
popd

echo %SourceDir%\Build\Utilities.UnitTests\
pushd %SourceDir%\Build\Utilities.UnitTests\
if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL%
call soup build
if %ERRORLEVEL% NEQ 0 (
popd
exit /B %ERRORLEVEL%
)
call soup run
if %ERRORLEVEL% NEQ 0 (
popd
exit /B %ERRORLEVEL%
)
popd
echo soup build %SourceDir%\Build\Utilities.UnitTests\
call soup build %SourceDir%\Build\Utilities.UnitTests\
if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL%
echo soup run %SourceDir%\Build\Utilities.UnitTests\
call soup run %SourceDir%\Build\Utilities.UnitTests\
if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL%

echo %SourceDir%\Extensions\Compiler\Core.UnitTests\
pushd %SourceDir%\Extensions\Compiler\Core.UnitTests\
if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL%
call soup build
if %ERRORLEVEL% NEQ 0 (
popd
exit /B %ERRORLEVEL%
)
call soup run
if %ERRORLEVEL% NEQ 0 (
popd
exit /B %ERRORLEVEL%
)
popd
echo soup build %SourceDir%\Extensions\Compiler\Core.UnitTests\
call soup build %SourceDir%\Extensions\Compiler\Core.UnitTests\
if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL%
echo soup run %SourceDir%\Extensions\Compiler\Core.UnitTests\
call soup run %SourceDir%\Extensions\Compiler\Core.UnitTests\
if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL%

echo %SourceDir%\Extensions\Compiler\Clang.UnitTests\
pushd %SourceDir%\Extensions\Compiler\Clang.UnitTests\
echo soup build %SourceDir%\Extensions\Compiler\Clang.UnitTests\
call soup build %SourceDir%\Extensions\Compiler\Clang.UnitTests\
if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL%
echo soup run %SourceDir%\Extensions\Compiler\Clang.UnitTests\
call soup run %SourceDir%\Extensions\Compiler\Clang.UnitTests\
if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL%
call soup build
if %ERRORLEVEL% NEQ 0 (
popd
exit /B %ERRORLEVEL%
)
call soup run
if %ERRORLEVEL% NEQ 0 (
echo Failed
popd
exit /B %ERRORLEVEL%
)
popd

echo %SourceDir%\Extensions\Compiler\MSVC.UnitTests\
pushd %SourceDir%\Extensions\Compiler\MSVC.UnitTests\
if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL%
call soup build
if %ERRORLEVEL% NEQ 0 (
popd
exit /B %ERRORLEVEL%
)
call soup run
if %ERRORLEVEL% NEQ 0 (
popd
exit /B %ERRORLEVEL%
)
popd
echo soup build %SourceDir%\Extensions\Compiler\MSVC.UnitTests\
call soup build %SourceDir%\Extensions\Compiler\MSVC.UnitTests\
if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL%
echo soup run %SourceDir%\Extensions\Compiler\MSVC.UnitTests\
call soup run %SourceDir%\Extensions\Compiler\MSVC.UnitTests\
if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL%

echo %SourceDir%\Client\Core.UnitTests\
pushd %SourceDir%\Client\Core.UnitTests\
if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL%
call soup build
if %ERRORLEVEL% NEQ 0 (
popd
exit /B %ERRORLEVEL%
)
call soup run
if %ERRORLEVEL% NEQ 0 (
popd
exit /B %ERRORLEVEL%
)
popd
echo soup build %SourceDir%\Client\Core.UnitTests\
call soup build %SourceDir%\Client\Core.UnitTests\
if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL%
echo soup run %SourceDir%\Client\Core.UnitTests\
call soup run %SourceDir%\Client\Core.UnitTests\
if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL%
54 changes: 27 additions & 27 deletions Scripts/Build.cmd → Scripts/build.cmd
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
@echo off
SET Flavor=%1
SET ScriptsDir=%~dp0
SET SourceDir=%ScriptsDir%..\Source
SET ClientCLIDir=%SourceDir%\Client\CLI
SET DetoursDir=%SourceDir%\Monitor\Detours
SET BinaryDirectorPath=out\bin\MSVC\%Flavor%\win32
SET ClientCLIBinaryDirectory=%ClientCLIDir%\%BinaryDirectorPath%
SET DetoursBinaryDirectory=%DetoursDir%\%BinaryDirectorPath%

REM - Build each version of the detours dll
echo soup build %DetoursDir% -architecture x64 -flavor %Flavor%
call soup build %DetoursDir% -architecture x64 -flavor %Flavor%
if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL%
echo soup build %DetoursDir% -architecture x86 -flavor %Flavor%
call soup build %DetoursDir% -architecture x86 -flavor %Flavor%
if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL%

REM - Build the host
echo soup build %ClientCLIDir% -flavor %Flavor%
call soup build %ClientCLIDir% -flavor %Flavor%
if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL%

REM - Copy the detour dlls
echo copy %DetoursBinaryDirectory%\x64\Monitor.Detours.dll %ClientCLIBinaryDirectory%\x64\Monitor.Detours.64.dll
copy %DetoursBinaryDirectory%\x64\Monitor.Detours.dll %ClientCLIBinaryDirectory%\x64\Monitor.Detours.64.dll > nul
echo copy %DetoursBinaryDirectory%\x86\Monitor.Detours.dll %ClientCLIBinaryDirectory%\x64\Monitor.Detours.32.dll
@echo off
SET Flavor=%1
SET ScriptsDir=%~dp0
SET SourceDir=%ScriptsDir%..\Source
SET ClientCLIDir=%SourceDir%\Client\CLI
SET DetoursDir=%SourceDir%\Monitor\Detours
SET BinaryDirectorPath=out\bin\MSVC\%Flavor%\win32
SET ClientCLIBinaryDirectory=%ClientCLIDir%\%BinaryDirectorPath%
SET DetoursBinaryDirectory=%DetoursDir%\%BinaryDirectorPath%

REM - Build each version of the detours dll
echo soup build %DetoursDir% -architecture x64 -flavor %Flavor%
call soup build %DetoursDir% -architecture x64 -flavor %Flavor%
if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL%
echo soup build %DetoursDir% -architecture x86 -flavor %Flavor%
call soup build %DetoursDir% -architecture x86 -flavor %Flavor%
if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL%

REM - Build the host
echo soup build %ClientCLIDir% -flavor %Flavor%
call soup build %ClientCLIDir% -flavor %Flavor%
if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL%

REM - Copy the detour dlls
echo copy %DetoursBinaryDirectory%\x64\Monitor.Detours.dll %ClientCLIBinaryDirectory%\x64\Monitor.Detours.64.dll
copy %DetoursBinaryDirectory%\x64\Monitor.Detours.dll %ClientCLIBinaryDirectory%\x64\Monitor.Detours.64.dll > nul
echo copy %DetoursBinaryDirectory%\x86\Monitor.Detours.dll %ClientCLIBinaryDirectory%\x64\Monitor.Detours.32.dll
copy %DetoursBinaryDirectory%\x86\Monitor.Detours.dll %ClientCLIBinaryDirectory%\x64\Monitor.Detours.32.dll > nul
4 changes: 1 addition & 3 deletions Scripts/soup.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,5 @@ SET OutDir=%ClientDir%\out
SET BinaryDir=%OutDir%\bin
SET RunDir=%OutDir%\run
REM - Use a copy of the final binary in case we are re-buiding itself
rmdir /S /Q %RunDir%
xcopy /s /Y %BinaryDir%\MSVC\release\win32\x64\* %RunDir%\ > nul
copy %ClientDir%\LocalUserConfig.json %RunDir%\LocalUserConfig.json > nul
robocopy %BinaryDir%\MSVC\release\win32\x64\ %RunDir%\ /MIR
%RunDir%\Soup.exe %*
4 changes: 1 addition & 3 deletions Scripts/soupd.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,5 @@ SET OutDir=%ClientDir%\out
SET BinaryDir=%OutDir%\bin
SET RunDir=%OutDir%\run
REM - Use a copy of the final binary in case we are re-buiding itself
rmdir /S /Q %RunDir%
xcopy /s /Y %BinaryDir%\MSVC\debug\win32\x64\* %RunDir%\ > nul
copy %ClientDir%\LocalUserConfig.json %RunDir%\LocalUserConfig.json > nul
robocopy %BinaryDir%\MSVC\debug\win32\x64\ %RunDir%\ /MIR
%RunDir%\Soup.exe %*
9 changes: 5 additions & 4 deletions Source/Build/Execute.UnitTests/BuildHistoryCheckerTests.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Soup::Build::Execute::UnitTests
{
public:
[[Fact]]
void IsOutdated_ZeroInput_Throws()
void IsOutdated_ZeroInput()
{
// Register the test listener
auto testListener = std::make_shared<TestTraceListener>();
Expand All @@ -30,9 +30,10 @@ namespace Soup::Build::Execute::UnitTests

// Perform the check
auto uut = BuildHistoryChecker();
Assert::ThrowsRuntimeError([&uut, &targetFiles, &inputFiles, &rootPath]() {
bool result = uut.IsOutdated(targetFiles, inputFiles, rootPath);
});
bool result = uut.IsOutdated(targetFiles, inputFiles, rootPath);

// Verify the results
Assert::IsFalse(result, "Verify the result is false.");

// Verify expected file system requests
Assert::AreEqual(
Expand Down
Loading

0 comments on commit 4bbd55b

Please sign in to comment.