Skip to content
This repository has been archived by the owner on Jul 26, 2021. It is now read-only.

Commit

Permalink
* переписан обработчик локальных тестов на PowerShell (IT-Service/ITG…
Browse files Browse the repository at this point in the history
  • Loading branch information
sergey-s-betke committed Jun 8, 2018
1 parent 0131dff commit 138f59a
Showing 1 changed file with 5 additions and 18 deletions.
23 changes: 5 additions & 18 deletions ITG.MakeUtils/tests.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,18 @@ TESTSDIR ?= tests
testPlatformSetStatus = Write-Information "Test '$1' $2$(if $3, in $3)."

# $(call testPlatformWrapper,testId,testScript)
testPlatformWrapper = \
set +e; \
$(call testPlatformSetStatus,$1,Running); \
START_TIME=$$$$(($$$$(date +%s%3N))); \
( $2 ); \
EXIT_CODE=$$$$?; \
FINISH_TIME=$$$$(($$$$(date +%s%3N))); \
DURATION=$$$$(($$$$FINISH_TIME-$$$$START_TIME)); \
if [[ $$$$EXIT_CODE -eq 0 ]]; then \
$(call testPlatformSetStatus,$1,Passed,$$$$DURATION); \
else \
$(call testPlatformSetStatus,$1,Failed,$$$$DURATION); \
fi; \
exit $$$$EXIT_CODE;

testPlatformWrapper = \
$(call testPlatformSetStatus,$1,Running); \
$$$$sw = [Diagnostics.Stopwatch]::StartNew(); \
$$$$Status = 'Passed'; \
try { \
$2; \
$$$$sw.Stop(); \
$(call testPlatformSetStatus,$1,Passed,$$$$($$$$sw.Elapsed)); \
if ( $$$$LASTEXITCODE -ne 0 ) { throw $$$$LASTEXITCODE; } ;\
} catch { \
$$$$Status = 'Failed'; \
} finally { \
$$$$sw.Stop(); \
$(call testPlatformSetStatus,$1,Failed,$$$$($$$$sw.Elapsed)); \
$(call testPlatformSetStatus,$1,$$$$Status,$$$$($$$$sw.Elapsed)); \
};

# $(call defineTest,id,targetId,script,dependencies)
Expand Down

0 comments on commit 138f59a

Please sign in to comment.