Salome HOME
Testing when calling salome shell inside ctest
authorCédric Aguerre <cedric.aguerre@edf.fr>
Wed, 19 Jul 2017 13:51:58 +0000 (15:51 +0200)
committerCédric Aguerre <cedric.aguerre@edf.fr>
Wed, 19 Jul 2017 13:51:58 +0000 (15:51 +0200)
CTestTestfileInstall.cmake.in
bin/appliskel/tests/CMakeLists.txt
bin/appliskel/tests/salomeTest/CMakeLists.txt [new file with mode: 0644]
bin/appliskel/tests/salomeTest/CTestTestfileInstall.cmake [new file with mode: 0644]
bin/appliskel/tests/salomeTest/salome_test.py [new file with mode: 0644]
bin/appliskel/tests/salomeTest/salome_test.sh [new file with mode: 0644]
bin/appliskel/tests/salomeTest/salome_test_in_shell.sh [new file with mode: 0644]

index 254fb82f1e3e0701a287b3998271dfd3eaefcc2d..7532280536b07f612f77d868cc4e5e7d40b73f9b 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2015-2016  CEA/DEN, EDF R&D
+# Copyright (C) 2015-2017  CEA/DEN, EDF R&D
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -17,7 +17,6 @@
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-#SET(SALOME_TEST_DRIVER "$ENV{ABSOLUTE_APPLI_PATH}/bin/salome/appliskel/salome_test_driver.py")
 SET(SALOME_TEST_DRIVER "@CMAKE_INSTALL_PREFIX@/bin/salome/appliskel/salome_test_driver.py")
 
 SET(COMPONENT_NAME KERNEL)
@@ -42,4 +41,5 @@ SUBDIRS( Launcher
          salomeInstance
          salomeCommand
          concurrentSession
+         salomeTest
     )
index dd4c93082bacbd4d40c008bfa817026c5f9debe4..da311738a0b333f5156b09c2794bde14ddbbdbb8 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2013-2017  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -20,3 +20,4 @@
 ADD_SUBDIRECTORY(concurrentSession)
 ADD_SUBDIRECTORY(salomeInstance)
 ADD_SUBDIRECTORY(salomeCommand)
+ADD_SUBDIRECTORY(salomeTest)
diff --git a/bin/appliskel/tests/salomeTest/CMakeLists.txt b/bin/appliskel/tests/salomeTest/CMakeLists.txt
new file mode 100644 (file)
index 0000000..da05dd5
--- /dev/null
@@ -0,0 +1,31 @@
+# Copyright (C) 2017  CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+FILE(GLOB py_scripts "${CMAKE_CURRENT_SOURCE_DIR}/*.py")
+FILE(GLOB sh_scripts "${CMAKE_CURRENT_SOURCE_DIR}/*.sh")
+LIST(APPEND scripts ${py_scripts})
+LIST(APPEND scripts ${sh_scripts})
+
+# Application tests
+INSTALL(FILES CTestTestfileInstall.cmake
+        DESTINATION ${KERNEL_TEST_DIR}/salomeTest
+        RENAME CTestTestfile.cmake)
+
+INSTALL(FILES ${scripts}
+        DESTINATION ${KERNEL_TEST_DIR}/salomeTest)
diff --git a/bin/appliskel/tests/salomeTest/CTestTestfileInstall.cmake b/bin/appliskel/tests/salomeTest/CTestTestfileInstall.cmake
new file mode 100644 (file)
index 0000000..c4df885
--- /dev/null
@@ -0,0 +1,36 @@
+# Copyright (C) 2017  CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+SET(tname salome_test)
+
+SET(TEST_NAME ${COMPONENT_NAME}_SALOME_TEST_${tname}_bash)
+ADD_TEST(${TEST_NAME} bash ${tname}.sh)
+SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}" TIMEOUT ${TIMEOUT} WILL_FAIL ON)
+
+SET(TEST_NAME ${COMPONENT_NAME}_SALOME_TEST_${tname}_shell)
+ADD_TEST(${TEST_NAME} bash ${tname}_in_shell.sh)
+SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}" TIMEOUT ${TIMEOUT} WILL_FAIL ON)
+
+SET(TEST_NAME ${COMPONENT_NAME}_SALOME_TEST_${tname}_py)
+ADD_TEST(${TEST_NAME} python ${tname}.py)
+SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}" TIMEOUT ${TIMEOUT} WILL_FAIL ON)
+
+SET(TEST_NAME ${COMPONENT_NAME}_SALOME_TEST_${tname}_driver)
+ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ${tname}.py)
+SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}" TIMEOUT ${TIMEOUT} WILL_FAIL ON)
diff --git a/bin/appliskel/tests/salomeTest/salome_test.py b/bin/appliskel/tests/salomeTest/salome_test.py
new file mode 100644 (file)
index 0000000..6119509
--- /dev/null
@@ -0,0 +1,32 @@
+#!/usr/bin/env python
+# Copyright (C) 2017  CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+import unittest
+
+class TestSalomeTest(unittest.TestCase):
+
+  def testMustPass(self):
+    assert(True)
+
+  def testMustFail(self):
+    assert(False)
+
+if __name__ == "__main__":
+  unittest.main()
diff --git a/bin/appliskel/tests/salomeTest/salome_test.sh b/bin/appliskel/tests/salomeTest/salome_test.sh
new file mode 100644 (file)
index 0000000..cba080a
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/bash
+# Copyright (C) 2017  CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+set -e # fail when any subcommand fails
+
+SOURCE="${BASH_SOURCE[0]}"
+while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
+CALLDIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
+
+python ${CALLDIR}/salome_test.py
diff --git a/bin/appliskel/tests/salomeTest/salome_test_in_shell.sh b/bin/appliskel/tests/salomeTest/salome_test_in_shell.sh
new file mode 100644 (file)
index 0000000..fd00f8b
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/bash
+# Copyright (C) 2017  CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+set -e # fail when any subcommand fails
+
+SOURCE="${BASH_SOURCE[0]}"
+while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
+CALLDIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
+
+echo ABSOLUTE_APPLI_PATH: $ABSOLUTE_APPLI_PATH
+$ABSOLUTE_APPLI_PATH/salome shell -- python ${CALLDIR}/salome_test.py