add oil_disable test option

The `oil_skip` test option was added for tests that don't work under OIL
but do work under OID. However, we now have two classes of `oil_skip`ped
tests: those that could be fixed, and those that will never work.
Increase clarity by not generating the tests which do not make sense at
all, leaving us with a cleaner set of skipped (and fixable) tests.
This commit is contained in:
Jake Hillion 2022-12-21 14:43:56 +00:00 committed by Jake Hillion
parent 3f2ae5e56f
commit 358b4e9505
6 changed files with 15 additions and 12 deletions

View File

@ -95,7 +95,7 @@ definitions = '''
]}]'''
[cases.anon_struct]
oil_skip = "oil can't chase raw pointers safely"
oil_disable = "oil can't chase raw pointers safely"
param_types = ["const AnonStructContainer&"]
setup = '''
return AnonStructContainer{
@ -144,7 +144,7 @@ definitions = '''
cli_options = ["--chase-raw-pointers"]
[cases.anon_typedef]
oil_skip = "oil can't chase raw pointers safely"
oil_disable = "oil can't chase raw pointers safely"
param_types = ["const AnonTypedefContainer&"]
setup = '''
return AnonTypedefContainer{
@ -202,7 +202,7 @@ definitions = '''
}]'''
[cases.nested_anon_struct]
oil_skip = "oil can't chase raw pointers safely"
oil_disable = "oil can't chase raw pointers safely"
param_types = ["const NestedAnonContainer&"]
setup = 'return NestedAnonContainer{.m = { .v = {.as = {new Node{1, 2, 3}}}}};'
cli_options = ["--chase-raw-pointers"]

View File

@ -17,7 +17,7 @@ definitions = '''
'''
[cases]
[cases.raw_ptr]
oil_skip = "oil can't chase pointers safely"
oil_disable = "oil can't chase pointers safely"
param_types = ["RawNode*"]
setup = '''
RawNode *first = new RawNode{1, nullptr};

View File

@ -304,6 +304,9 @@ def add_oil_integration_test(f, config, case_name, case):
case_str = get_case_name(config["suite"], case_name)
exit_code = case.get("expect_oil_exit_code", 0)
if case.get("oil_disable", False):
return
f.write(
f"\n"
f'TEST_F(OilIntegration, {config["suite"]}_{case_name}) {{\n'

View File

@ -20,7 +20,7 @@ definitions = '''
# Test that TreeBuilder failing to run on the first arg doesn't impact the second arg
[cases.tb_fail_first_arg]
oil_skip = "oil doesn't handle invalid strings"
oil_disable = "treebuilder tests are oid specific"
param_types = ["const std::string&", "const NodeA&"]
args = "arg0,arg1"
setup = """
@ -32,7 +32,7 @@ definitions = '''
expect_json = '[{},{"staticSize":12, "dynamicSize":0}]'
[cases.tb_all_fail_crashes]
oil_skip = "oil doesn't handle invalid strings"
oil_disable = "treebuilder tests are oid specific"
param_types = ["const std::string&", "const std::string&"]
args = "arg0,arg1"
setup = """

View File

@ -15,7 +15,7 @@ definitions = '''
[cases]
[cases.int]
skip = "top-level pointers are skipped over"
oil_skip = "oil can't chase pointers safely"
oil_disable = "oil can't chase raw pointers safely"
param_types = ["int*"]
setup = "return new int(1);"
cli_options = ["--chase-raw-pointers"]
@ -94,7 +94,7 @@ definitions = '''
[cases.vector]
skip = "top-level pointers are skipped over"
oil_skip = "oil can't chase pointers safely"
oil_disable = "oil can't chase raw pointers safely"
param_types = ["std::vector<int>*"]
setup = "return new std::vector<int>{1,2,3};"
cli_options = ["--chase-raw-pointers"]
@ -136,7 +136,7 @@ definitions = '''
[cases.struct_primitive_ptrs]
oil_skip = "oil can't chase pointers safely"
oil_disable = "oil can't chase raw pointers safely"
param_types = ["const PrimitivePtrs&"]
setup = "return PrimitivePtrs{0, new int(0), new int(0)};"
cli_options = ["--chase-raw-pointers"]
@ -174,7 +174,7 @@ definitions = '''
[cases.struct_vector_ptr]
oil_skip = "oil can't chase pointers safely"
oil_disable = "oil can't chase raw pointers safely"
param_types = ["const VectorPtr&"]
setup = "return VectorPtr{new std::vector<int>{1,2,3}};"
cli_options = ["--chase-raw-pointers"]
@ -206,7 +206,7 @@ definitions = '''
[cases.vector_of_pointers]
oil_skip = "oil can't chase pointers safely"
oil_disable = "oil can't chase raw pointers safely"
param_types = ["const std::vector<int*>&"]
setup = "return {{new int(1), nullptr, new int(3)}};"
cli_options = ["--chase-raw-pointers"]

View File

@ -82,7 +82,7 @@ definitions = '''
expect_json = '[{"staticSize":16, "dynamicSize":0, "NOT":"members"}]'
[cases.containing_struct]
oil_skip = "oil can't chase pointers safely"
oil_disable = "oil can't chase raw pointers safely"
param_types = ["const IncompleteTypeContainer&"]
setup = "return IncompleteTypeContainer{};"
cli_options = ["--chase-raw-pointers"]