commit 06f8826c1f582c48841003c9dae859703139659d
Author: Jon Bell <j.to.the.bell@gmail.com>
AuthorDate: Fri Apr 23 20:04:59 2021 -0600
Commit: jtothebell <j.to.the.bell@gmail.com>
CommitDate: Sun May 2 13:31:33 2021 -0600
Add failing includes end to end test
---
test/carts/includetest.p8 | 11 +++++++++++
test/carts/screenshots/includetest_f01.png | Bin 0 -> 325 bytes
test/carts/testinclude.blah | 4 ++++
test/endtoendtests.cpp | 14 ++++++++++++++
4 files changed, 29 insertions(+)
diff --git a/test/carts/includetest.p8 b/test/carts/includetest.p8
new file mode 100644
index 0000000..02b0288
--- /dev/null
+++ b/test/carts/includetest.p8
@@ -0,0 +1,11 @@
+pico-8 cartridge // http://www.pico-8.com
+version 32
+__lua__
+#include testinclude.blah
+__gfx__
+00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+00700700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+00077000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+00077000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+00700700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
diff --git a/test/carts/screenshots/includetest_f01.png b/test/carts/screenshots/includetest_f01.png
new file mode 100644
index 0000000..c8b934c
Binary files /dev/null and b/test/carts/screenshots/includetest_f01.png differ
diff --git a/test/carts/testinclude.blah b/test/carts/testinclude.blah
new file mode 100644
index 0000000..03708a8
--- /dev/null
+++ b/test/carts/testinclude.blah
@@ -0,0 +1,4 @@
+function _draw()
+ cls()
+ print("included successfully!")
+end
\ No newline at end of file
diff --git a/test/endtoendtests.cpp b/test/endtoendtests.cpp
index 7eda84e..816daed 100644
--- a/test/endtoendtests.cpp
+++ b/test/endtoendtests.cpp
@@ -520,6 +520,20 @@ TEST_CASE("Loading and running carts") {
CHECK_EQ(vm->vm_peek(0x7fff), 0);
+ vm->CloseCart();
+ }
+ SUBCASE("#include test"){
+ vm->LoadCart("carts/includetest.p8");
+
+ SUBCASE("No error reported"){
+ CHECK(vm->GetBiosError() == "");
+ }
+ SUBCASE("sceen matches screenshot"){
+ vm->UpdateAndDraw();
+
+ CHECK(verifyScreenshot(vm, "carts/screenshots/includetest_f01.png"));
+ }
+
vm->CloseCart();
}