diff --git a/test/e2e/test.ps1 b/test/e2e/test.ps1 index cdb636f..f8373f5 100644 --- a/test/e2e/test.ps1 +++ b/test/e2e/test.ps1 @@ -1,4 +1,4 @@ -Get-ChildItem 0* | ForEach-Object { +$result = Get-ChildItem 0* | ForEach-Object { $name=$_.Name; $arguments=(Get-Content "$name/commandline"); $command="Get-Content $name/input | ../../../dist/sel $arguments"; @@ -7,7 +7,15 @@ Get-ChildItem 0* | ForEach-Object { Compare-Object (Invoke-Expression "$command") (Get-Content "$name/output"); if ( $? -eq $True ) { Write-Host "OK" + return 0 } else { Write-Host "NG" + return 1 } +} | Measure-Object -Sum + +if ($result.Sum -eq 0) { + exit 0 +} else { + exit 1 } diff --git a/test/e2e/test.sh b/test/e2e/test.sh index 1c05d3c..e387784 100755 --- a/test/e2e/test.sh +++ b/test/e2e/test.sh @@ -2,7 +2,9 @@ set -e -SEL=../../dist/sel +SEL=../../../dist/sel + +EXIT_CODE=0 ls -1 | grep -v test.sh | \ while read DIR; do @@ -10,5 +12,7 @@ ls -1 | grep -v test.sh | \ input=$DIR/input output=$DIR/output echo -en "test $DIR: $SEL $commandline ... " - cat $input | eval "$SEL $commandline" | diff - $output && echo "OK" || ( echo "NG"; false ) + cat "$input" | eval "$SEL $commandline" | diff - "$output" && echo "OK" || ( echo "NG"; false; $EXIT_CODE=1 ) done + +exit "$EXIT_CODE"