GameLib is a collection of libraries for creating applications in Cakelisp.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

58 lines
2.2 KiB

;; (skip-build)
(set-cakelisp-option cakelisp-src-dir "Dependencies/cakelisp/src")
(add-cakelisp-search-directory "Dependencies/cakelisp/runtime")
(import &comptime-only "BuildTools.cake" "ComptimeHelpers.cake" "CHelpers.cake" "Cakelisp.cake")
;; We don't actually test anything here; we use comptime to run the tests
(defun main (&return int)
(return 0))
(defmacro gamelib-run-test (test-name string files array)
(tokenize-push output
(scope
(var files ([] (* (const char))) (token-splice files))
(Logf "\n===============\n%s\n\n" (token-splice test-name))
(unless (cakelisp-evaluate-build-execute-files files (array-size files))
(Logf "error: test %s failed\n" (token-splice test-name))
(return false))
(Logf "\n%s succeeded\n" (token-splice test-name))))
(return true))
(defmacro gamelib-build (test-name string files array)
(tokenize-push output
(scope
(var files ([] (* (const char))) (token-splice files))
(Logf "\n===============\nBuild %s\n\n" (token-splice test-name))
(unless (cakelisp-evaluate-build-files files (array-size files))
(return false))))
(return true))
(defun-comptime run-tests (manager (& ModuleManager) module (* Module) &return bool)
(var platform-config (* (const char))
(comptime-cond
('Windows
"src/Config_Windows.cake")
(true
"src/Config_Linux.cake")))
(gamelib-run-test "Ogre" (array platform-config "src/OgreApp.cake"))
(gamelib-run-test "SDL Ogre" (array platform-config "src/SDLOgreApp.cake"))
(gamelib-run-test "Auto Test"
(array platform-config
"../src/AutoTest.cake" "../src/SDL.cake" "../src/Math.cake"
"../src/Aubio.cake" "../src/ImGui.cake" "../src/Dictionary.cake"))
(gamelib-build "Vocal Game (hot reload)"
(array platform-config "src/MakeHotReload.cake" "src/VocalGame.cake"))
(gamelib-run-test "Hot-loader"
(array platform-config "src/Loader.cake"))
(gamelib-run-test "Vocal Game (no reload)"
(array platform-config "src/NoHotReload.cake" "src/VocalGame.cake"))
(Log "\nGameLibTests: All tests succeeded!\n")
(return true))
(add-compile-time-hook-module pre-build run-tests)