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

Commit 1b27df1

Browse files
committed
[[ Tests ]] Specify log file as environment variable
1 parent 22481d1 commit 1b27df1

5 files changed

Lines changed: 18 additions & 14 deletions

tests/Makefile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ LCC_LOG = _compiler_test_suite.log
4949
LC_RUN_TESTS ?= $(top_srcdir)/tests/_lcruntests.livecodescript
5050
LC_RUN_TEST_CMD = $(LCS_ENGINE) -ui $(LC_RUN_TESTS)
5151

52+
LC_RUN_LOG = _lc_run_test_suite.log
53+
5254
########## Java FFI DSL test parameters
5355

5456
JAVA_DSL_PARSER ?= $(bin_dir)/java-dsl-parse
@@ -129,7 +131,8 @@ $(LCM_DIR)/%.lcm: %.lcb | $(LCM_DIR)
129131

130132
lcs-check: $(LCS_ENGINE) lcm_compile
131133
@rm -f $(LCS_LOG)
132-
@cmd="$(LCS_CMD)"; \
134+
@export TEST_SUITE_LOG_FILE="$(LCS_LOG)"; \
135+
cmd="$(LCS_CMD)"; \
133136
echo "$$cmd" $(_PRINT_RULE); \
134137
$$cmd
135138

@@ -143,6 +146,7 @@ compiler-check: $(LC_COMPILE)
143146
@rm -f $(LCC_LOG)
144147
@export LC_COMPILE="$(LC_COMPILE)"; \
145148
export LCC_VERBOSE="$(LCC_VERBOSE)"; \
149+
export TEST_SUITE_LOG_FILE="$(LCC_LOG)"; \
146150
cmd="$(LCC_CMD)"; \
147151
echo "$$cmd" $(_PRINT_RULE); \
148152
$$cmd
@@ -154,6 +158,7 @@ compiler-check: $(LC_COMPILE)
154158
lc-run-check: $(LC_RUN) lcm_compile
155159
@export LC_RUN="$(LC_RUN)"; \
156160
export LCM_DIR="$(LCM_DIR)/lc-run"; \
161+
export TEST_SUITE_LOG_FILE="$(LC_RUN_LOG)"; \
157162
cmd="$(LC_RUN_TEST_CMD)"; \
158163
echo "$$cmd" $(_PRINT_RULE); \
159164
$$cmd
@@ -170,6 +175,7 @@ LC_RUN_FLAGS += -l $(LCB_TESTLIB)
170175

171176
lcb-check: lcm_compile
172177
@set -e; \
178+
export TEST_SUITE_LOG_FILE="$(LCB_LOG)"; \
173179
for lcbfile in $(LCM_TEST_SOURCES); do \
174180
lcmfile="$(LCM_DIR)/`echo $$lcbfile | sed -e 's:lcb$$:lcm:'`" ; \
175181
logfile="$(TEST_DIR)/`echo $$lcbfile | sed -e's:lcb$$:log:'`" ; \
@@ -191,7 +197,8 @@ lcb-check: lcm_compile
191197
java-ffi-dsl-check: $(JAVA_DSL_PARSE)
192198
@rm -f $(JAVA_DSL_PARSER_LOG)
193199
@export JAVA_DSL_PARSER="$(JAVA_DSL_PARSER)"; \
194-
export JAVA_DSL_PARSE_VERBOSE="$(JAVA_DSL_PARSE_VERBOSE)"; \
200+
export LCC_VERBOSE="$(JAVA_DSL_PARSE_VERBOSE)"; \
201+
export TEST_SUITE_LOG_FILE="$(JAVA_DSL_PARSER_LOG)"; \
195202
cmd="$(JAVA_DSL_PARSER_CMD)"; \
196203
echo "$$cmd" $(_PRINT_RULE); \
197204
$$cmd

tests/_compilertestrunner.livecodescript

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ for more details.
1616
You should have received a copy of the GNU General Public License
1717
along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
1818

19-
-- FIXME provide this on the command line
20-
constant kLogFilename = "_compiler_test_suite.log"
21-
2219
private function getTestRunnerBehavior
2320
-- Compute the filename of the compiler test runner behavior
2421
local tTestsPath, tStack

tests/_javadslparsertestrunner.livecodescript

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ for more details.
1616
You should have received a copy of the GNU General Public License
1717
along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
1818

19-
-- FIXME provide this on the command line
20-
constant kLogFilename = "_java_dsl_parser_test_suite.log"
21-
2219
private function getTestRunnerBehavior
2320
-- Compute the filename of the compiler test runner behavior
2421
local tTestsPath, tStack

tests/_testrunner.livecodescript

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ for more details.
1616
You should have received a copy of the GNU General Public License
1717
along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
1818

19-
-- FIXME provide this on the command line
20-
constant kLogFilename = "_test_suite.log"
21-
2219
private function getTestRunnerBehavior
2320
-- Compute the filename of the test runner
2421
local tTestsPath, tStack

tests/_testrunnerbehavior.livecodescript

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ for more details.
1616
You should have received a copy of the GNU General Public License
1717
along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
1818

19-
-- FIXME provide this on the command line
20-
constant kLogFilename = "_test_suite.log"
19+
constant kDefaultLogFilename = "_test_suite.log"
2120

2221
----------------------------------------------------------------
2322
-- Top-level actions
@@ -99,7 +98,14 @@ private command doRun pInfo
9998
if the platform is "win32" then
10099
replace return with numToChar(13) & numToChar(10) in tLogForWriting
101100
end if
102-
put tLogForWriting into url ("binfile:" & kLogFilename)
101+
102+
local tLogFilename
103+
put $TEST_SUITE_LOG_FILE into tLogFilename
104+
if tLogFilename is empty then
105+
put kDefaultLogFilename into tLogFilename
106+
end if
107+
108+
put tLogForWriting into url ("binfile:" & tLogFilename)
103109

104110
if TesterTapGetWorstResult(tAnalysis) is "FAIL" then
105111
quit 1

0 commit comments

Comments
 (0)