diff --git a/run.translations.spellcheck.test.sh b/run.translations.spellcheck.test.sh deleted file mode 100755 index 7ced8a70cf..0000000000 --- a/run.translations.spellcheck.test.sh +++ /dev/null @@ -1,17 +0,0 @@ -rd="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -echo "Run script directory:" $dir - -dir=$(builtin cd $rd/../; pwd) - -save=false - -while getopts s: flag -do - case "${flag}" in - s) save=${OPTARG};; - esac -done - -echo "Root directory:" $dir - -dotnet test $dir/client/common/Tests/Frontend.Translations.Tests/Frontend.Translations.Tests.csproj --filter Name~SpellCheckTest -l:html --results-directory "$dir/TestsResults" --environment "BASE_DIR=$dir" --environment "SAVE=$save" \ No newline at end of file diff --git a/run.translations.spellcheck.tests.py b/run.translations.spellcheck.tests.py new file mode 100755 index 0000000000..32506ee0d7 --- /dev/null +++ b/run.translations.spellcheck.tests.py @@ -0,0 +1,46 @@ +import os +import subprocess +import sys +import getopt + + +def help(): + # Display Help + print("Run spellcheck tests.") + print() + print("Syntax: available params [-h|s") + print("options:") + print("h Print this Help.") + print("s Force save.") + print() + + +force = False + +# Get the options +opts, args = getopt.getopt(sys.argv[1:], "hf") +for opt, arg in opts: + if opt == "-h": + help() + sys.exit() + elif opt == "-f": + force = arg if arg else True + else: + print("Error: Invalid '-" + opt + "' option") + sys.exit() + +sd = os.path.dirname(os.path.abspath(__file__)) +dir = os.path.abspath(os.path.join(sd, "..")) +clientDir = os.path.abspath(os.path.join(dir, "client")) +projFile = os.path.abspath(os.path.join(clientDir, "common", "Tests", + "Frontend.Translations.Tests", "Frontend.Translations.Tests.csproj")) +resultDir = os.path.abspath(os.path.join(dir, "TestsResults")) + +print("Script directory:", sd) +print("Root directory:", dir) + +print("FORCE SAFE:", force) # --environment "SAVE=$save" + +print(f"== Run {projFile} ==") +subprocess.run(["dotnet", "test", projFile, "--filter", "Name~SpellCheckTest", + "-l:html", "--results-directory", resultDir, "--environment", f"BASE_DIR={clientDir}", "--environment", f"SAVE={force}"]) diff --git a/run.translations.tests.py b/run.translations.tests.py new file mode 100755 index 0000000000..fbf8991839 --- /dev/null +++ b/run.translations.tests.py @@ -0,0 +1,16 @@ +import os +import subprocess + +sd = os.path.dirname(os.path.abspath(__file__)) +dir = os.path.abspath(os.path.join(sd, "..")) +clientDir = os.path.abspath(os.path.join(dir, "client")) +projFile = os.path.abspath(os.path.join(clientDir, "common", "Tests", + "Frontend.Translations.Tests", "Frontend.Translations.Tests.csproj")) +resultDir = os.path.abspath(os.path.join(dir, "TestsResults")) + +print("Script directory:", sd) +print("Root directory:", dir) + +print(f"== Run {projFile} ==") +subprocess.run(["dotnet", "test", projFile, "--filter", "TestCategory=Locales", + "-l:html", "--results-directory", resultDir, "--environment", f"BASE_DIR={clientDir}"]) diff --git a/run.translations.tests.sh b/run.translations.tests.sh deleted file mode 100755 index ced8d7652e..0000000000 --- a/run.translations.tests.sh +++ /dev/null @@ -1,8 +0,0 @@ -rd="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -echo "Run script directory:" $dir - -dir=$(builtin cd $rd/../; pwd) - -echo "Root directory:" $dir - -dotnet test $dir/client/common/Tests/Frontend.Translations.Tests/Frontend.Translations.Tests.csproj --filter "TestCategory=Locales" -l:html --results-directory "$dir/TestsResults" --environment "BASE_DIR=$dir/client" \ No newline at end of file