From 5eecbd6ef771a54b455d96f4033212062d7c3f8f Mon Sep 17 00:00:00 2001 From: SoniEx2 Date: Wed, 29 May 2024 23:00:53 -0300 Subject: Implement cratera bootstrap --- test/crateratests.cratera.d/bootstrap.cratera | 7 +++++++ test/luafile.lua | 8 ++++++++ test/test_bootstrap.lua | 9 +++++++++ 3 files changed, 24 insertions(+) create mode 100644 test/crateratests.cratera.d/bootstrap.cratera create mode 100644 test/luafile.lua create mode 100644 test/test_bootstrap.lua (limited to 'test') diff --git a/test/crateratests.cratera.d/bootstrap.cratera b/test/crateratests.cratera.d/bootstrap.cratera new file mode 100644 index 0000000..618b0fb --- /dev/null +++ b/test/crateratests.cratera.d/bootstrap.cratera @@ -0,0 +1,7 @@ +-- test that cratera can require lua modules + +require "test.luafile" + +-- also check that we do have craterapath + +assert(craterapath) diff --git a/test/luafile.lua b/test/luafile.lua new file mode 100644 index 0000000..3ec81cd --- /dev/null +++ b/test/luafile.lua @@ -0,0 +1,8 @@ +-- yes, this is a very small test file and it doesn't get invoked by +-- build.sh directly. +-- +-- it's used to check if lua modules can still be used from cratera. + +print "all good" + +assert(not craterapath) diff --git a/test/test_bootstrap.lua b/test/test_bootstrap.lua new file mode 100644 index 0000000..7edad26 --- /dev/null +++ b/test/test_bootstrap.lua @@ -0,0 +1,9 @@ +-- test cratera.bootstrap functions + +local bootstrap = require "cratera.bootstrap" + +-- loadfile is defined in bootstrap +assert(bootstrap.loadfile("test/tests.cratera")) + +-- bootstrap sets up a loader +require "crateratests.bootstrap" -- cgit 1.4.1