summaryrefslogtreecommitdiff
path: root/test/test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/test.sh')
-rwxr-xr-xtest/test.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/test.sh b/test/test.sh
new file mode 100755
index 0000000..c77ec1d
--- /dev/null
+++ b/test/test.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+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
+
+# Run license management on it.
+echo "Running license management on the cloned repository"
+cd /code
+/run.sh analyze .
+
+# Compare results with expected results.
+set +e
+diff /code/gl-license-management-report.json /test/results/ruby-bundler.json > /diff.txt
+
+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
+