diff --git a/Test/Applications/StandardTester/tester/DoctRenderer.config b/Test/Applications/StandardTester/tester/DoctRenderer.config deleted file mode 100644 index d4acf1835b..0000000000 --- a/Test/Applications/StandardTester/tester/DoctRenderer.config +++ /dev/null @@ -1,22 +0,0 @@ - - ./sdkjs/common/Native/native.js - ./sdkjs/common/Native/jquery_native.js - ./sdkjs/vendor/xregexp/xregexp-all-min.js - ./fonts/AllFonts.js - ./sdkjs/vendor/jquery/jquery.min.js - - ./sdkjs/word/sdk-all-min.js - ./sdkjs/common/libfont/js/fonts.js - ./sdkjs/word/sdk-all.js - - - ./sdkjs/slide/sdk-all-min.js - ./sdkjs/common/libfont/js/fonts.js - ./sdkjs/slide/sdk-all.js - - - ./sdkjs/cell/sdk-all-min.js - ./sdkjs/common/libfont/js/fonts.js - ./sdkjs/cell/sdk-all.js - - \ No newline at end of file diff --git a/Test/Applications/StandardTester/tester/scripts/check.bat b/Test/Applications/StandardTester/tester/scripts/check.bat deleted file mode 100644 index 5ad33b8ca3..0000000000 --- a/Test/Applications/StandardTester/tester/scripts/check.bat +++ /dev/null @@ -1,14 +0,0 @@ -@echo OFF -rem -rem --input="input-standard-files-dir" -rem --output="output-dir" -rem --standard // generate standarts -rem --use-system-fonts="0/1/false/true" -rem --font-dirs="C:\\Windows\\Fonts;/usr/share/fonts;" -rem --cores=4 -rem - -set RUN_DIR=%~dp0.. -cd "%RUN_DIR%" -RMDIR "%RUN_DIR%\result\check" /S /Q -standardtester.exe --input="%RUN_DIR%\result\out" --output="%RUN_DIR%\result\check" --cores=1 \ No newline at end of file diff --git a/Test/Applications/StandardTester/tester/scripts/check.py b/Test/Applications/StandardTester/tester/scripts/check.py new file mode 100644 index 0000000000..9780637bc0 --- /dev/null +++ b/Test/Applications/StandardTester/tester/scripts/check.py @@ -0,0 +1,3 @@ +#!/usr/bin/env python +import tester +tester.make(["--input='./result/out'", "--output='./result/check'", "--cores=1"]) \ No newline at end of file diff --git a/Test/Applications/StandardTester/tester/scripts/generate.bat b/Test/Applications/StandardTester/tester/scripts/generate.bat deleted file mode 100644 index 226ed5eade..0000000000 --- a/Test/Applications/StandardTester/tester/scripts/generate.bat +++ /dev/null @@ -1,13 +0,0 @@ -@echo OFF -rem -rem --input="input-standard-files-dir" -rem --output="output-dir" -rem --standard // generate standarts -rem --use-system-fonts="0/1/false/true" -rem --font-dirs="C:\\Windows\\Fonts;/usr/share/fonts;" -rem --cores=4 -rem - -set RUN_DIR=%~dp0.. -cd "%RUN_DIR%" -standardtester.exe --input="%RUN_DIR%\result\standard" --output="%RUN_DIR%\result\out" --standard --cores=1 diff --git a/Test/Applications/StandardTester/tester/scripts/generate.py b/Test/Applications/StandardTester/tester/scripts/generate.py new file mode 100644 index 0000000000..486b6c2644 --- /dev/null +++ b/Test/Applications/StandardTester/tester/scripts/generate.py @@ -0,0 +1,3 @@ +#!/usr/bin/env python +import tester +tester.make(["--input='./result/standard'", "--output='./result/out'", "--standard", "--cores=1"]) \ No newline at end of file diff --git a/Test/Applications/StandardTester/tester/scripts/tester.py b/Test/Applications/StandardTester/tester/scripts/tester.py new file mode 100644 index 0000000000..489172e31d --- /dev/null +++ b/Test/Applications/StandardTester/tester/scripts/tester.py @@ -0,0 +1,42 @@ +#!/usr/bin/env python + +import os +import platform +import subprocess + +def make(src_args): + #--input="input-standard-files-dir" + #--output="output-dir" + #--standard // generate standarts + #--use-system-fonts="0/1/false/true" + #--font-dirs="C:\\Windows\\Fonts;/usr/share/fonts;" + #--cores=4 + work_dir = os.path.dirname(os.path.realpath(__file__)) + "/.." + os.chdir(work_dir) + host = platform.system().lower() + + args = [] + args.append("standardtester.exe" if "windows" == host else "standardtester") + for arg in src_args: + arg_valid = arg.replace("'", "\"") + arg_valid = arg_valid.replace("./", work_dir + "/") + args.append(arg_valid) + + # env + env_dir = os.environ + if ("linux" == host): + env_dir["LD_LIBRARY_PATH"] = "./:" + env_dir["LD_LIBRARY_PATH"] + elif ("darwin" == host): + env_dir["DYLD_LIBRARY_PATH"] = "./:" + env_dir["DYLD_LIBRARY_PATH"] + + ret = 0 + if ("windows" == platform): + process = subprocess.Popen(args, stderr=subprocess.STDOUT, shell=True, env=env_dir) + ret = process.wait() + else: + command = "" + for arg in args: + command += (" \"" + arg + "\"") + process = subprocess.Popen(command, stderr=subprocess.STDOUT, shell=True, env=env_dir) + ret = process.wait() + return ret \ No newline at end of file diff --git a/Test/Applications/StandardTester/tester/scripts/update.bat b/Test/Applications/StandardTester/tester/scripts/update.bat deleted file mode 100644 index f340ac2640..0000000000 --- a/Test/Applications/StandardTester/tester/scripts/update.bat +++ /dev/null @@ -1,15 +0,0 @@ -@echo OFF -set RUN_DIR=%~dp0.. -set GIT_DIR=%RUN_DIR%\..\..\..\..\.. - -RMDIR "%RUN_DIR%\sdkjs" /S /Q - -xcopy /s/e/k/c/y/q "%GIT_DIR%\sdkjs\deploy\sdkjs" "%RUN_DIR%\sdkjs\" -md %RUN_DIR%\sdkjs\vendor\jquery -copy "%GIT_DIR%\web-apps\vendor\jquery\jquery.min.js" "%RUN_DIR%\sdkjs\vendor\jquery\jquery.min.js" -md %RUN_DIR%\sdkjs\vendor\xregexp -copy "%GIT_DIR%\web-apps\vendor\xregexp\xregexp-all-min.js" "%RUN_DIR%\sdkjs\vendor\xregexp\xregexp-all-min.js" - -del /s /q "%RUN_DIR%\sdkjs\*.cache" - -copy "%GIT_DIR%\server\FileConverter\bin\core\*" "%RUN_DIR%\." diff --git a/Test/Applications/StandardTester/tester/scripts/update.py b/Test/Applications/StandardTester/tester/scripts/update.py new file mode 100644 index 0000000000..595fe11493 --- /dev/null +++ b/Test/Applications/StandardTester/tester/scripts/update.py @@ -0,0 +1,81 @@ +#!/usr/bin/env python + +import os +import platform +import shutil +import codecs + +work_dir = os.path.dirname(os.path.realpath(__file__)) + "/.." +git_dir = work_dir + "/../../../../.." +exe_addon = ".exe" if "windows" == platform.system().lower() else "" + +# 1) Remove all old version +print("-----------------------------------------------") +print("- remove old version --------------------------") +for r, d, f in os.walk(work_dir): + for file in f: + os.remove(os.path.join(work_dir, file)) + break + +if os.path.isdir(work_dir + "/sdkjs"): + shutil.rmtree(work_dir + "/sdkjs") +if os.path.isdir(work_dir + "/HtmlFileInternal"): + shutil.rmtree(work_dir + "/HtmlFileInternal") +print("-----------------------------------------------") + +# 2) create new portable version +print("- create new version --------------------------") +shutil.copytree(git_dir + "/sdkjs/deploy/sdkjs", work_dir + "/sdkjs") + +if os.path.isfile(work_dir + "/sdkjs/word/sdk-all.cache"): + os.remove(work_dir + "/sdkjs/word/sdk-all.cache") +if os.path.isfile(work_dir + "/sdkjs/slide/sdk-all.cache"): + os.remove(work_dir + "/sdkjs/slide/sdk-all.cache") +if os.path.isfile(work_dir + "/sdkjs/cell/sdk-all.cache"): + os.remove(work_dir + "/sdkjs/cell/sdk-all.cache") + +os.makedirs(work_dir + "/sdkjs/vendor/jquery") +shutil.copy2(git_dir + "/web-apps/vendor/jquery/jquery.min.js", work_dir + "/sdkjs/vendor/jquery/jquery.min.js") +os.makedirs(work_dir + "/sdkjs/vendor/xregexp") +shutil.copy2(git_dir + "/web-apps/vendor/xregexp/xregexp-all-min.js", work_dir + "/sdkjs/vendor/xregexp/xregexp-all-min.js") + +base_core = git_dir + "/server/FileConverter/bin/core" +for r, d, f in os.walk(base_core): + for file in f: + shutil.copy2(os.path.join(base_core, file), work_dir + "/" + os.path.basename(file)) + for dir in d: + shutil.copytree(os.path.join(base_core, dir), work_dir + "/" + os.path.basename(dir)) + break + +if os.path.isfile(work_dir + "/allfontsgen" + exe_addon): + os.remove(work_dir + "/allfontsgen" + exe_addon) +if os.path.isfile(work_dir + "/allthemesgen" + exe_addon): + os.remove(work_dir + "/allthemesgen" + exe_addon) + +config = "\n" +config += "./sdkjs/common/Native/native.js\n" +config += "./sdkjs/common/Native/jquery_native.js\n" +config += "./sdkjs/vendor/xregexp/xregexp-all-min.js\n" +config += "./fonts/AllFonts.js\n" +config += "./sdkjs/vendor/jquery/jquery.min.js\n" +config += "\n" +config += "./sdkjs/word/sdk-all-min.js\n" +config += "./sdkjs/common/libfont/js/fonts.js\n" +config += "./sdkjs/word/sdk-all.js\n" +config += "\n" +config += "\n" +config += "./sdkjs/slide/sdk-all-min.js\n" +config += "./sdkjs/common/libfont/js/fonts.js\n" +config += "./sdkjs/slide/sdk-all.js\n" +config += "\n" +config += "\n" +config += "./sdkjs/cell/sdk-all-min.js\n" +config += "./sdkjs/common/libfont/js/fonts.js\n" +config += "./sdkjs/cell/sdk-all.js\n" +config += "\n" +config += "" + +file = codecs.open(work_dir + "/DoctRenderer.config", "w", "utf-8") +file.write(config) +file.close() +print("-----------------------------------------------") \ No newline at end of file