diff options
Diffstat (limited to 'test/test.sh')
| -rwxr-xr-x | test/test.sh | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/test/test.sh b/test/test.sh index c77ec1d..0130492 100755 --- a/test/test.sh +++ b/test/test.sh @@ -2,24 +2,26 @@ set -e -# Clone the Ruby Bundler test repository. -echo "Cloning the test repository https://gitlab.com/gitlab-org/security-products/tests/ruby-bundler.git" -git clone https://gitlab.com/gitlab-org/security-products/tests/ruby-bundler.git /code +for project in ruby-bundler java-maven; do + # Clone the test repository. + echo "Cloning the test repository https://gitlab.com/gitlab-org/security-products/tests/$project.git" + git clone "https://gitlab.com/gitlab-org/security-products/tests/$project.git" "/code/$project" -# Run license management on it. -echo "Running license management on the cloned repository" -cd /code -/run.sh analyze . + # Run license management on it. + echo "Running license management on the $project" + cd "/code/$project" + /run.sh analyze . -# Compare results with expected results. -set +e -diff /code/gl-license-management-report.json /test/results/ruby-bundler.json > /diff.txt + # Compare results with expected results. + set +e + diff "/code/$project/gl-license-management-report.json" "/test/results/$project.json" > /diff.txt + set -e -if [ -s /diff.txt ] ; then - echo "Unexpected result. Here is the diff between actual results and those expected :" - cat /diff.txt - exit 1 -else - echo "All tests are OK." -fi + if [ -s /diff.txt ] ; then + echo "Unexpected result. Here is the diff between actual results and those expected :" + cat /diff.txt + exit 1 + fi +done +echo "All tests are OK." |
