+def link_extra_test(options):
+ global verbose
+
+ if not options.extra_test_path:
+ print("Option extra_test is mandatory")
+ return
+
+ extra_test_dir=os.path.abspath(options.extra_test_path)
+ if not os.path.exists(extra_test_dir):
+ print("Test %s does not exist" % extra_test_dir)
+ return
+
+ verbose = options.verbose
+
+ home_dir = os.path.expanduser(options.prefix)
+ test_dir = os.path.join(home_dir,'bin','salome', 'test')
+
+ if options.clear:
+ rmtree(test_dir)
+ pass
+
+ #directory bin/salome/test : create it and link content
+ if os.path.exists(extra_test_dir):
+ # link <appli_path>/bin/salome/test/<extra_test> to <extra_test_path>/bin/salome/test
+ print("link %s --> %s"%(os.path.join(test_dir, options.extra_test_name), extra_test_dir))
+ symlink(extra_test_dir, os.path.join(test_dir, options.extra_test_name))
+ # register extra_test for testing in CTestTestfile.cmake
+ with open(os.path.join(test_dir, "CTestTestfile.cmake"), "ab") as f:
+ aStr = "SUBDIRS(%s)\n" % options.extra_test_name
+ f.write(aStr.encode())
+ else:
+ if verbose:
+ print(extra_test_dir, " doesn't exist")
+ pass
+