Browse Source

Added minimal and all tests scripts

* Add separate scripts because the all tests script requires human
intervention
* Fix Tracy to now point to the new locations of Tracy.h and
TracyClient.cpp
master
Macoy Madson 6 months ago
parent
commit
1107f16b86
  1. 16
      src/Tracy.cake
  2. 4
      test/Build.sh
  3. 19
      test/BuildRunAllTests.sh
  4. 7
      test/src/GameLibTests.cake
  5. 1
      test/src/TestConfig_AllTests.cake
  6. 1
      test/src/TestConfig_Minimal.cake

16
src/Tracy.cake

@ -54,12 +54,22 @@
(comptime-cond
('auto-test
(import
;; Cakelisp/runtime
"RunProcess.cake")
;; TODO: Linux only
(c-import "unistd.h")
(defun test--tracy-main (&return int)
(ZoneScopedN "main")
(var status int 0)
(runtime-start-process-or
("Dependencies/tracy/profiler/build/unix/Tracy-release") (addr status)
(fprintf stderr "Failed to run Tracy profiler\n")
(return 1))
(fprintf stderr "Waiting for profiler to connect...\n")
(while (not (call-on IsConnected (call (in tracy GetProfiler))))
(ZoneScopedN "wait for profiler")
@ -106,9 +116,11 @@
(export-and-evaluate
(add-build-options "-DTRACY_ENABLE")
;; (add-build-options "-DTRACY_CALLSTACK=10") ;; TODO: Causes exit code 134, failing in tracy alloc
(add-c-search-directory-module "Dependencies/tracy"))
(add-c-search-directory-module "Dependencies/tracy/public")
(add-c-search-directory-module "Dependencies/tracy/public/tracy"))
(add-c-search-directory-module "Dependencies/tracy")
(add-c-search-directory-module "Dependencies/tracy/public")
(add-c-search-directory-module "Dependencies/tracy/public/tracy")
(add-cpp-build-dependency "TracyClient.cpp")
(comptime-cond

4
test/Build.sh

@ -14,4 +14,6 @@ cd ../..
CAKELISP=./Dependencies/cakelisp/bin/cakelisp
$CAKELISP src/Config_Linux.cake src/GameLibTests.cake --verbose-processes || exit $?
echo "Building and running minimal tests"
$CAKELISP src/Config_Linux.cake src/TestConfig_Minimal.cake src/GameLibTests.cake --verbose-processes || exit $?

19
test/BuildRunAllTests.sh

@ -0,0 +1,19 @@
#!/bin/sh
CAKELISP_DIR=Dependencies/cakelisp
# Link Cakelisp if necessary
[ ! -d "$CAKELISP_DIR" ] && git clone git@github.com:makuto/cakelisp.git Dependencies/cakelisp
# Build Cakelisp itself
echo "\n\nCakelisp\n\n"
cd $CAKELISP_DIR
./Build.sh || exit $?
cd ../..
CAKELISP=./Dependencies/cakelisp/bin/cakelisp
echo "Building and running all tests"
$CAKELISP src/Config_Linux.cake src/TestConfig_AllTests.cake src/GameLibTests.cake --verbose-processes || exit $?

7
test/src/GameLibTests.cake

@ -42,8 +42,11 @@
;; (var test-network bool true)
(var test-network bool false)
(var test-minimal bool true)
;; (var test-minimal bool false)
(comptime-cond
('Test-Minimal
(var test-minimal bool true))
(true
(var test-minimal bool false)))
;; (var test-opengl-only bool true)
(var test-opengl-only bool false)

1
test/src/TestConfig_AllTests.cake

@ -0,0 +1 @@
(comptime-define-symbol 'Test-All)

1
test/src/TestConfig_Minimal.cake

@ -0,0 +1 @@
(comptime-define-symbol 'Test-Minimal)
Loading…
Cancel
Save