-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #59 from pecoose/main
Update testing scripts and descriptions in README
- Loading branch information
Showing
6 changed files
with
80 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[submodule "enre-java-test"] | ||
path = enre-java-test | ||
url = git@github.com:ba1man/enre-java-test.git | ||
url = git@github.com:xjtu-enre/enre-java-test.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#! /usr/bin/env python3 | ||
|
||
import sys | ||
import os | ||
import shutil | ||
import subprocess | ||
|
||
ENRE_REPO = os.getcwd() | ||
TEST_REPO = os.path.join(ENRE_REPO, "enre-java-test") | ||
|
||
enre_paths = { | ||
"docs": os.path.join(ENRE_REPO, "docs"), | ||
"suites": os.path.join(ENRE_REPO, "src", "test", "java", "client"), | ||
"cases": os.path.join(ENRE_REPO, "src", "test", "resources", "cases"), | ||
} | ||
|
||
test_paths = { | ||
"docs": os.path.join(TEST_REPO, "docs"), | ||
"tests": os.path.join(TEST_REPO, "tests"), | ||
"suites": os.path.join(TEST_REPO, "tests", "suites"), | ||
"cases": os.path.join(TEST_REPO, "tests", "cases"), | ||
} | ||
|
||
def preprocess(): | ||
if os.path.isdir(test_paths["docs"]): | ||
shutil.rmtree(test_paths["docs"]) | ||
if os.path.isdir(test_paths["tests"]): | ||
shutil.rmtree(test_paths["tests"]) | ||
if os.path.isdir(enre_paths["suites"]): | ||
shutil.rmtree(enre_paths["suites"]) | ||
if os.path.isdir(enre_paths["cases"]): | ||
shutil.rmtree(enre_paths["cases"]) | ||
shutil.copytree(enre_paths["docs"], test_paths["docs"]) | ||
os.makedirs(enre_paths["suites"], exist_ok=True) | ||
# os.makedirs(enre_paths["cases"], exist_ok=True) | ||
return | ||
|
||
def build(): | ||
os.chdir(TEST_REPO) | ||
subprocess.run(["npm", "install"]) | ||
subprocess.run(["node", "--experimental-specifier-resolution", "node", os.path.join("src", "index.js")]) | ||
os.chdir(ENRE_REPO) | ||
for file in os.listdir(test_paths["suites"]): | ||
if not file.endswith(".java"): | ||
continue | ||
shutil.copy(os.path.join(test_paths["suites"], file), enre_paths["suites"]) | ||
shutil.copytree(test_paths["cases"], enre_paths["cases"]) | ||
|
||
if __name__ == '__main__': | ||
preprocess() | ||
build() |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#! /usr/bin/env python3 | ||
|
||
import subprocess | ||
import os | ||
|
||
ENRE_REPO = os.getcwd() | ||
TEST_REPO = "enre-java-test" | ||
|
||
subprocess.run(["git", "submodule", "init"]) | ||
subprocess.run(["git", "submodule", "update"]) | ||
os.chdir(TEST_REPO) | ||
subprocess.run(["git", "pull", "origin", "main"]) | ||
subprocess.run(["git", "checkout", "main"]) | ||
os.chdir(ENRE_REPO) |