Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 7c822e4

Browse files
committed
lc-run: Add basic functionality tests.
1 parent 12edbf2 commit 7c822e4

File tree

4 files changed

+38
-3
lines changed

4 files changed

+38
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ xcuserdata/
8686
_build/
8787
_cache/
8888
build/
89+
/_tests/
8990

9091
# SDKs #
9192
#################

Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,11 @@ lc-test: libstdscript libfoundation
215215
$(MAKE) -C ./toolchain lc-test
216216

217217
########## Tests
218-
lc-test-check: lc-test
218+
lc-run-check: lc-compile lc-run
219+
$(MAKE) -C ./tests/lc-run check
220+
lc-test-check: lc-compile lc-test
219221
$(MAKE) -C ./toolchain lc-test-check
220-
.PHONY: mlc-check
222+
.PHONY: lc-run-check lc-test-check
221223

222224
###############################################################################
223225
# All Targets
@@ -239,7 +241,7 @@ thirdparty: libffi libz libjpeg libpcre libpng libgif libopenssl libskia
239241
thirdparty: libcairopdf libpq libmysql libsqlite libiodbc libxml libxslt
240242
thirdparty: libzip
241243

242-
check: lc-test-check
244+
check: lc-run-check lc-test-check
243245

244246
clean:
245247
-rm -rf _build/linux _cache/linux

tests/lc-run/Makefile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
top_srcdir=../..
2+
3+
include $(top_srcdir)/rules/environment.linux.makefile
4+
5+
SOLUTION_DIR = $(top_srcdir)
6+
7+
LC_COMPILE ?= $(shell PATH=$(BUILD_DIR):$(PATH) \
8+
which lc-compile 2>/dev/null || \
9+
echo "lc-compile")
10+
LC_RUN ?= $(shell PATH=$(BUILD_DIR):$(PATH) \
11+
which lc-run 2>/dev/null || \
12+
echo "lc-run")
13+
14+
TEST_DIR = $(SOLUTION_DIR)/_tests/lc-run
15+
16+
# Basic functionality tests for lc-run
17+
#
18+
# 1) Does lc-run run a trivial program?
19+
# 2) Does lc-run list the handlers of a trivial program?
20+
check:
21+
mkdir -p $(TEST_DIR)
22+
$(LC_COMPILE) --modulepath $(TEST_DIR) --modulepath $(MODULE_DIR) \
23+
lc-run-test.mlc --output $(TEST_DIR)/lc-run-test.lcm
24+
$(LC_RUN) $(TEST_DIR)/lc-run-test.lcm
25+
test "`$(LC_RUN) --list-handlers $(TEST_DIR)/lc-run-test.lcm`" = "main"

tests/lc-run/lc-run-test.mlc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module com.livecode.lc_run_test
2+
3+
public handler main()
4+
-- nothing
5+
end handler
6+
7+
end module

0 commit comments

Comments
 (0)