foxygit / fake-08-xbox360 Log in
commit fe522768497d4cadf671e2bd1236016d08e505be
Author:     Jon Bell <j.to.the.bell@gmail.com>
AuthorDate: Mon Jun 13 20:44:49 2022 -0600
Commit:     Jon Bell <j.to.the.bell@gmail.com>
CommitDate: Sat Jun 18 15:20:02 2022 -0600

    progress getting tests working right with new makefile
---
 Makefile                 | 1 +
 test/Makefile            | 5 +----
 test/cartloadingtest.cpp | 9 ++++++---
 3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
index fcd7682..29cd662 100644
--- a/Makefile
+++ b/Makefile
@@ -101,3 +101,4 @@ clean-tests:

 tests:
 	@$(MAKE) -C test
+	cd test && ./testrunner.a
diff --git a/test/Makefile b/test/Makefile
index 0bb004d..442de1d 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -10,8 +10,6 @@ TARGET		:=	testrunner.a
 BUILD		:=	build
 SOURCES   	:= ../source ../libs/z8lua ../libs/utf8-util ../libs/lodepng ../libs/simpleini ../libs/miniz ./
 INCLUDES  	:= ../source ../include ../libs/z8lua ../libs/utf8-util ../libs/lodepng ../libs/simpleini ../libs/miniz ./
-#SOURCES		:=	${SOURCES} source
-#INCLUDES	:=	${INCLUDES}

 #---------------------------------------------------------------------------------
 # options for code generation
@@ -26,7 +24,6 @@ CFLAGS	+=	$(INCLUDE) -DVER_STR=\"$(APP_VERSION)\"
 CXXFLAGS	:= $(CFLAGS) -fno-rtti -fno-exceptions
 #-std=gnu++11 was used before... not sure of difference

-#LIBS	:= -lSDL2

 LDFLAGS	:= $(LIBS)

@@ -98,7 +95,7 @@ clean:

 #---------------------------------------------------------------------------------
 else
-.PHONY:	all run
+.PHONY:	all

 DEPENDS	:=	$(OFILES:.o=.d)

diff --git a/test/cartloadingtest.cpp b/test/cartloadingtest.cpp
index aad0c91..c625bab 100644
--- a/test/cartloadingtest.cpp
+++ b/test/cartloadingtest.cpp
@@ -23,7 +23,8 @@ TEST_CASE("Loading and running carts") {
     vector<string> carts;
     vector<string> errors;

-    std::string _cartDirectory = "/Users/jon/p8carts/old/shouldfail";
+    //TODO: build library of carts to test- set up compiler flag?
+    std::string _cartDirectory = "/Users/jon/p8carts/infinitelooptest";

     DIR *dir;
     struct dirent *ent;
@@ -39,13 +40,15 @@ TEST_CASE("Loading and running carts") {
         /* could not open directory */
         perror ("");
     }
+    sort(carts.begin(), carts.end());


     for(int i = 0; i < carts.size(); i++) {
-        vm->LoadCart(carts[i], false);
+        //printf("%s\n", carts[i].c_str());
+        vm->LoadCart(_cartDirectory + "/" + carts[i], false);

         if (vm->GetBiosError() != "") {
-            errors.push_back(carts[i] + vm->GetBiosError());
+            errors.push_back(carts[i] + ": " + vm->GetBiosError());
         }
         else
         {