mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Fix golden tests to use the "target" Bazel configuration (#581)
In practice, this means that `executable_semantics` will be built and run using the configuration specified on the command line, rather than e.g. always using `-c opt`. Also fix a bug exposed by this change.
This commit is contained in:
@@ -92,17 +92,12 @@ EXAMPLES = [
|
||||
"experimental_continuation9",
|
||||
]
|
||||
|
||||
[genrule(
|
||||
name = "%s_out" % e,
|
||||
srcs = ["testdata/%s.carbon" % e],
|
||||
outs = ["testdata/%s.out" % e],
|
||||
# Suppress command errors.
|
||||
cmd = "$(location executable_semantics) $< > $@ 2>&1 || echo EXIT CODE: $$? >> $@",
|
||||
tools = [":executable_semantics"],
|
||||
) for e in EXAMPLES]
|
||||
|
||||
[golden_test(
|
||||
name = "%s_test" % e,
|
||||
cmd = "'$(location executable_semantics) $(location testdata/%s.carbon)'" % e,
|
||||
data = [
|
||||
":executable_semantics",
|
||||
"testdata/%s.carbon" % e,
|
||||
],
|
||||
golden = "testdata/%s.golden" % e,
|
||||
subject = "testdata/%s.out" % e,
|
||||
) for e in EXAMPLES]
|
||||
|
||||
@@ -149,8 +149,8 @@ auto TypeCheckExp(const Expression* e, TypeEnv types, Env values,
|
||||
return TCResult(new_e, t, types);
|
||||
}
|
||||
case ExpressionKind::Index: {
|
||||
auto res = TypeCheckExp(e->GetFieldAccess().aggregate, types, values,
|
||||
nullptr, TCContext::ValueContext);
|
||||
auto res = TypeCheckExp(e->GetIndex().aggregate, types, values, nullptr,
|
||||
TCContext::ValueContext);
|
||||
auto t = res.type;
|
||||
switch (t->tag) {
|
||||
case ValKind::TupleV: {
|
||||
|
||||
@@ -47,7 +47,7 @@ cc_test(
|
||||
name = "paren_contents_test",
|
||||
srcs = ["paren_contents_test.cpp"],
|
||||
env = {
|
||||
# FIXME: Remove this when leaks are fixed.
|
||||
# TODO(#580): Remove this when leaks are fixed.
|
||||
"ASAN_OPTIONS": "detect_leaks=0",
|
||||
},
|
||||
deps = [
|
||||
|
||||
Reference in New Issue
Block a user