From 8ac7b290243ef79697e5b8c0395e9e5de1c1c8c9 Mon Sep 17 00:00:00 2001
From: Carlos Mastalli <carlos.mastalli@laas.fr>
Date: Wed, 20 Feb 2019 10:38:30 +0100
Subject: [PATCH] [unittest] Configure the CI jobs

---
 .gitlab-ci.yml       |  5 +++++
 unittest/test_all.py | 21 +++++++++++++++++++++
 2 files changed, 26 insertions(+)
 create mode 100644 .gitlab-ci.yml
 create mode 100644 unittest/test_all.py

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..2a4326f
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,5 @@
+image: gepgitlab.laas.fr:4567/Gepetto/example-robot-data
+
+test:
+  script:
+    - cd unittest && python test_all.py
diff --git a/unittest/test_all.py b/unittest/test_all.py
new file mode 100644
index 0000000..02564ce
--- /dev/null
+++ b/unittest/test_all.py
@@ -0,0 +1,21 @@
+import unittest
+import sys
+
+testmodules = [
+  'test_load',
+]
+
+suite = unittest.TestSuite()
+
+for t in testmodules:
+  try:
+    # If the module defines a suite() function, call it to get the suite.
+    mod = __import__(t, globals(), locals(), ['suite'])
+    suitefn = getattr(mod, 'suite')
+    suite.addTest(suitefn())
+  except (ImportError, AttributeError):
+    # else, just load all the test cases from the module.
+    suite.addTest(unittest.defaultTestLoader.loadTestsFromName(t))
+
+result = unittest.TextTestRunner().run(suite)
+sys.exit(len(result.errors) + len(result.failures))
-- 
GitLab