From a744e02c9f9c94f707d02af2d8020c31abc4ff1c Mon Sep 17 00:00:00 2001 From: williambl Date: Wed, 18 Oct 2017 20:25:19 +0100 Subject: [PATCH 1/4] Made a test script Attempts to install MinecraftForge, using pexpect. --- run_tests.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 run_tests.py diff --git a/run_tests.py b/run_tests.py new file mode 100644 index 0000000..fc6b61e --- /dev/null +++ b/run_tests.py @@ -0,0 +1,10 @@ +import pexpect +import sys + +print("Running tests on " + sys.platform) +deltamc = pexpect.spawn("python3 ./deltamc.py", encoding="UTF-8") +deltamc.logfile = sys.stdout +deltamc.expect("> ") +deltamc.sendline("install MinecraftForge") +deltamc.expect("Done. Please run the installer.") +deltamc.expect("> ") From 84658c10e8bfe64851f6d8d2748651c87b4b9534 Mon Sep 17 00:00:00 2001 From: williambl Date: Wed, 18 Oct 2017 20:33:45 +0100 Subject: [PATCH 2/4] Added tests to .travis.yml --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f96e042..36efdf2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,4 +2,6 @@ language: python python: - "3.6" install: - - pip install requests + - pip install requests pexpect +script: + - python3 run_tests.py From 96a379fadd93a21949b9b5e461925895b5ab66f4 Mon Sep 17 00:00:00 2001 From: williambl Date: Wed, 18 Oct 2017 21:00:10 +0100 Subject: [PATCH 3/4] Made tests work with a clean installation --- run_tests.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/run_tests.py b/run_tests.py index fc6b61e..4eb220b 100644 --- a/run_tests.py +++ b/run_tests.py @@ -4,6 +4,12 @@ print("Running tests on " + sys.platform) deltamc = pexpect.spawn("python3 ./deltamc.py", encoding="UTF-8") deltamc.logfile = sys.stdout +deltamc.expect("Enter mod folder location for instance default \(absolute path\)\: ") +deltamc.sendline(".") +deltamc.expect("Enter jar folder location for instance default \(absolute path\)\:") +deltamc.sendline(".") +deltamc.expect("Enter Minecraft version for instance default:") +deltamc.sendline("1.12") deltamc.expect("> ") deltamc.sendline("install MinecraftForge") deltamc.expect("Done. Please run the installer.") From 32487358b91d2faefc85581eccb6d51c607838d6 Mon Sep 17 00:00:00 2001 From: williambl Date: Wed, 18 Oct 2017 21:09:06 +0100 Subject: [PATCH 4/4] Added info messages to test --- run_tests.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/run_tests.py b/run_tests.py index 4eb220b..27a9073 100644 --- a/run_tests.py +++ b/run_tests.py @@ -4,13 +4,16 @@ print("Running tests on " + sys.platform) deltamc = pexpect.spawn("python3 ./deltamc.py", encoding="UTF-8") deltamc.logfile = sys.stdout +print("\n *** Attempting to set up the default instance... *** \n") deltamc.expect("Enter mod folder location for instance default \(absolute path\)\: ") deltamc.sendline(".") deltamc.expect("Enter jar folder location for instance default \(absolute path\)\:") deltamc.sendline(".") deltamc.expect("Enter Minecraft version for instance default:") deltamc.sendline("1.12") +print("\n *** Attempting to install MinecraftForge... ***\n") deltamc.expect("> ") deltamc.sendline("install MinecraftForge") deltamc.expect("Done. Please run the installer.") deltamc.expect("> ") +print("\n *** Test passed! *** \n")