-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile.eagle
More file actions
205 lines (178 loc) · 7.57 KB
/
Copy pathMakefile.eagle
File metadata and controls
205 lines (178 loc) · 7.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
###############################################################################
#
# Makefile.eagle --
#
# Extensible Adaptable Generalized Logic Engine (Eagle)
# Official Makefile Helper for POSIX
#
# Copyright (c) 2007-2012 by Joe Mistachkin. All rights reserved.
#
# See the file "license.terms" for information on usage and redistribution of
# this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# RCS: @(#) $Id: $
#
###############################################################################
apply [list [list channel quiet] {
#
# NOTE: This is a script snippet to dump the GitHub Actions CI workflow
# variables to the test log file(s), for troubleshooting purposes.
# It will be used twice within this anonymous procedure.
#
set tqputs_workflow_environment {
foreach name [lsort [array names ::env]] {
if {$name eq "CI" || \
[string match GITHUB_* $name] || \
[string match RUNNER_* $name]} then {
set value [getEnvironmentVariable $name]
if {[string length $value] == 0} then {
set value <none>
}
tqputs $channel [appendArgs \
"---- GitHub workflow variable \"" $name "\": " $value \n]
}
}
}
#############################################################################
#
# HACK: Since this script file is being evaluated *prior* to the core
# script library being available we need to manually source the
# core script library files that contain the procedures we need.
#
source lib/Eagle1.0/platform.eagle; # [isEagle]
source lib/Eagle1.0/object.eagle; # [isNonNullObjectHandle]
source lib/Eagle1.0/auxiliary.eagle; # [getEnvironmentVariable]
source lib/Eagle1.0/testlog.eagle; # [tqputs]
set interpreter [object invoke -alias Interpreter GetActive]
if {![isNonNullObjectHandle $interpreter]} then {return}
set directory [getEnvironmentVariable SCRIPT_ROOT]
if {![string is directory -strict $directory]} then {set directory [pwd]}
#############################################################################
#
# HACK: Attempt to locate the optional pre-initialize / post-initialize
# script files typically used with the full Eagle test suite.
#
set fileName(1) [file normalize \
[file join $directory test_suite_pre_initialize.eagle]]
set fileName(2) [file normalize \
[file join $directory test_suite_post_initialize.eagle]]
set haveFile(1) [file exists $fileName(1)]
set haveFile(2) [file exists $fileName(2)]
#############################################################################
#
# HACK: Attempt to grab the private "extra" shell arguments list from
# the interpreter. Typically, this value will be null. In that
# case, they will be created automatically by this procedure.
#
set arguments [$interpreter \
-flags +NonPublic -create -alias ShellArguments]
if {![isNonNullObjectHandle $arguments]} then {
set arguments [object create -alias StringList]
$interpreter -flags +NonPublic ShellArguments $arguments
}
#############################################################################
#
# HACK: Make sure the initial GitHub Actions CI workflow information ends
# up in the test log file(s), for troubleshooting purposes.
#
if {!$quiet} then {
set toString [$arguments ToString]
if {[string length $toString] == 0} then {set toString <none>}
tqputs $channel [appendArgs \
"---- initial extra shell arguments: " $toString \n]
eval $tqputs_workflow_environment
}
#############################################################################
#
# NOTE: Are we doing a GitHub Actions CI workflow run?
#
set running_on_ci [string is true -strict [getEnvironmentVariable CI]]
#############################################################################
#
# NOTE: If there is no setup work required by the test run, do nothing
# and return now.
#
if {!$running_on_ci && !$haveFile(1) && !$haveFile(2)} then {
return
}
#############################################################################
#
# NOTE: Always reset the active trace listeners so that we start with a
# clean slate (i.e. zero trace listeners).
#
$arguments Add -preInitialize
$arguments Add [list debug trace -resetlisteners true]
#############################################################################
#
# NOTE: If a pre-initialize script file exists, attempt to arrange for
# that script file to be evaluated before the core script library
# is fully initialized.
#
# NOTE: Otherwise, are we doing a GitHub Actions CI workflow run? If so,
# there are several Eagle test suite "behavioral overrides" that we
# need to enable.
#
if {$haveFile(1) && \
![info exists ::no(NoTestSuitePreInitialize)] && \
![info exists ::env(NoTestSuitePreInitialize)]} then {
$arguments Add -preFile
$arguments Add $fileName(1)
} elseif {$running_on_ci} then {
$arguments Add -preInitialize
$arguments Add [list \
set ::getRuntimeCommandLine(dotNetCoreExecArgs) \
[list --roll-forward Major]]
$arguments Add -preInitialize
$arguments Add [list \
set ::compileCSharp(dotNetCoreExecArgs) \
[list --roll-forward Major]]
$arguments Add -preInitialize
$arguments Add [list set ::no(cleanState) 1]
$arguments Add -preInitialize
$arguments Add [list set ::no(failTimingTests) 1]
$arguments Add -preInitialize
$arguments Add [list set ::no(leak,runTest) 1]
}
#############################################################################
#
# NOTE: Arrange for the core script library to be fully initialized at
# this point, as that is required by the next shell argument. It
# should be noted that the "-preInitialize" / "-preFile" options
# are not legal after this option and that the "-postInitialize"
# / "-postFile" options are not legal before this option.
#
$arguments Add -initialize
#############################################################################
#
# NOTE: If a post-initialize script file exists, attempt to arrange for
# that script file to be evaluated after the core script library
# is fully initialized.
#
# NOTE: Are we doing a GitHub Actions CI workflow run? If so, there are
# several tests that we want to skip as they intensive (e.g. time,
# memory, etc) and do not need to be run all the time.
#
if {$haveFile(2) && \
![info exists ::no(NoTestSuitePostInitialize)] && \
![info exists ::env(NoTestSuitePostInitialize)]} then {
$arguments Add -postFile
$arguments Add $fileName(2)
} elseif {$running_on_ci} then {
$arguments Add -postInitialize
$arguments Add [list package require Eagle.Test]
$arguments Add -postInitialize
$arguments Add [list addToArgv -skip [list interp-1.50000]]
}
#############################################################################
#
# HACK: Make sure the final GitHub Actions CI workflow information ends
# up in the test log file(s), for troubleshooting purposes.
#
if {!$quiet} then {
set toString [$arguments ToString]
if {[string length $toString] == 0} then {set toString <none>}
tqputs $channel [appendArgs \
"---- final extra shell arguments: " $toString \n]
eval $tqputs_workflow_environment
}
}] stdout false