summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson@vistahigherlearning.com>2021-04-25 19:19:01 -0400
committerDavid Thompson <dthompson@vistahigherlearning.com>2021-04-25 19:19:01 -0400
commit5d59ced441dc2027f544e80125d202f2aa946a97 (patch)
tree30de83affc139f39563dd833abff22977868f3ae
parent8fc01b81e0f95c8ea187d179b6f6a6b9afc4e79e (diff)
Add TEST_SUBJECT_DATADIR env var logic.
-rw-r--r--test-subject/assets.scm50
1 files changed, 27 insertions, 23 deletions
diff --git a/test-subject/assets.scm b/test-subject/assets.scm
index 76f0d6d..68d3101 100644
--- a/test-subject/assets.scm
+++ b/test-subject/assets.scm
@@ -27,26 +27,30 @@
gameplay-music
credits-music))
-(define-asset dialog-box-texture (load-image "assets/images/dialog-box.png"))
-(define-asset button-press-texture (load-image "assets/images/button-press.png"))
-(define-asset darkness (load-image "assets/images/darkness.png"))
-(define-asset lightness (load-image "assets/images/lightness.png"))
-(define-asset room-background (load-image "assets/images/room.png"))
-(define-asset door-lock-texture (load-image "assets/images/door-lock.png"))
-(define-asset pin-entry-background (load-image "assets/images/pin-entry-background.png"))
-(define-asset door-texture (load-image "assets/images/door.png"))
-(define-asset terminal-texture (load-image "assets/images/terminal.png"))
-(define-asset terminal-background (load-image "assets/images/terminal-background.png"))
-(define-asset control-panel-texture (load-image "assets/images/control-panel.png"))
-(define-asset fridge-texture (load-image "assets/images/fridge.png"))
-(define-asset window-texture (load-image "assets/images/window.png"))
-(define-asset notebook-texture (load-image "assets/images/notebook.png"))
-(define-asset notebook-background (load-image "assets/images/notebook-background.png"))
-(define-asset monogram-font (load-font "assets/fonts/monogram_extended.ttf" 12))
-(define-asset monogram-font-big (load-font "assets/fonts/monogram_extended.ttf" 24))
-(define-asset old-fax-font (load-font "assets/fonts/old-fax.ttf" 12))
-(define-asset click-sound (load-audio "assets/sounds/click1.wav"))
-(define-asset key-press-sound (load-audio "assets/sounds/switch6.wav"))
-(define-asset device-sound (load-audio "assets/sounds/switch38.wav"))
-(define-asset gameplay-music (load-audio "assets/sounds/ambientmain_0.ogg" #:mode 'stream))
-(define-asset credits-music (load-audio "assets/sounds/end-theme.mp3" #:mode 'stream))
+(define (scope-datadir file-name)
+ (let ((prefix (or (getenv "TEST_SUBJECT_DATADIR") (getcwd))))
+ (string-append prefix "/" file-name)))
+
+(define-asset dialog-box-texture (load-image (scope-datadir "assets/images/dialog-box.png")))
+(define-asset button-press-texture (load-image (scope-datadir "assets/images/button-press.png")))
+(define-asset darkness (load-image (scope-datadir "assets/images/darkness.png")))
+(define-asset lightness (load-image (scope-datadir "assets/images/lightness.png")))
+(define-asset room-background (load-image (scope-datadir "assets/images/room.png")))
+(define-asset door-lock-texture (load-image (scope-datadir "assets/images/door-lock.png")))
+(define-asset pin-entry-background (load-image (scope-datadir "assets/images/pin-entry-background.png")))
+(define-asset door-texture (load-image (scope-datadir "assets/images/door.png")))
+(define-asset terminal-texture (load-image (scope-datadir "assets/images/terminal.png")))
+(define-asset terminal-background (load-image (scope-datadir "assets/images/terminal-background.png")))
+(define-asset control-panel-texture (load-image (scope-datadir "assets/images/control-panel.png")))
+(define-asset fridge-texture (load-image (scope-datadir "assets/images/fridge.png")))
+(define-asset window-texture (load-image (scope-datadir "assets/images/window.png")))
+(define-asset notebook-texture (load-image (scope-datadir "assets/images/notebook.png")))
+(define-asset notebook-background (load-image (scope-datadir "assets/images/notebook-background.png")))
+(define-asset monogram-font (load-font (scope-datadir "assets/fonts/monogram_extended.ttf") 12))
+(define-asset monogram-font-big (load-font (scope-datadir "assets/fonts/monogram_extended.ttf") 24))
+(define-asset old-fax-font (load-font (scope-datadir "assets/fonts/old-fax.ttf") 12))
+(define-asset click-sound (load-audio (scope-datadir "assets/sounds/click1.wav")))
+(define-asset key-press-sound (load-audio (scope-datadir "assets/sounds/switch6.wav")))
+(define-asset device-sound (load-audio (scope-datadir "assets/sounds/switch38.wav")))
+(define-asset gameplay-music (load-audio (scope-datadir "assets/sounds/ambientmain_0.ogg") #:mode 'stream))
+(define-asset credits-music (load-audio (scope-datadir "assets/sounds/end-theme.mp3") #:mode 'stream))