Added json regression test
This commit is contained in:
parent
3c9086dd63
commit
a6ff1f110c
4 changed files with 245 additions and 0 deletions
|
@ -35,6 +35,7 @@ set(SAMPLES
|
|||
set(SCRIPTS
|
||||
tap_test
|
||||
xml_test
|
||||
json_test
|
||||
early_exit
|
||||
verbose
|
||||
list
|
||||
|
|
7
samples/tests/json_test.sh
Executable file
7
samples/tests/json_test.sh
Executable file
|
@ -0,0 +1,7 @@
|
|||
#!/bin/sh
|
||||
./simple.c.bin --json --always-succeed
|
||||
./signal.c.bin --json --always-succeed
|
||||
./asserts.c.bin --json --always-succeed
|
||||
./more-suites.c.bin --json --always-succeed
|
||||
./tests/long-messages.c.bin --json --always-succeed
|
||||
./description.c.bin --json --always-succeed
|
237
samples/tests/outputs/json_test.sh.err.expected
Normal file
237
samples/tests/outputs/json_test.sh.err.expected
Normal file
|
@ -0,0 +1,237 @@
|
|||
{
|
||||
"id": "Criterion v2.1.0",
|
||||
"passed": 1,
|
||||
"failed": 1,
|
||||
"errored": 0,
|
||||
"skipped": 0,
|
||||
"test_suites": [
|
||||
{
|
||||
"name": "misc",
|
||||
"passed": 1,
|
||||
"failed": 1,
|
||||
"errored": 0,
|
||||
"skipped": 0,
|
||||
"tests": [
|
||||
{
|
||||
"name": "passing",
|
||||
"assertions": 1,
|
||||
"status": "PASSED"
|
||||
},
|
||||
{
|
||||
"name": "failing",
|
||||
"assertions": 1,
|
||||
"status": "FAILED",
|
||||
"messages": [
|
||||
"simple.c:4: The expression 0 is false."
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
{
|
||||
"id": "Criterion v2.1.0",
|
||||
"passed": 1,
|
||||
"failed": 2,
|
||||
"errored": 1,
|
||||
"skipped": 0,
|
||||
"test_suites": [
|
||||
{
|
||||
"name": "simple",
|
||||
"passed": 1,
|
||||
"failed": 2,
|
||||
"errored": 1,
|
||||
"skipped": 0,
|
||||
"tests": [
|
||||
{
|
||||
"name": "wrong_signal",
|
||||
"assertions": 0,
|
||||
"status": "FAILED",
|
||||
"messages": [
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "uncaught",
|
||||
"assertions": 0,
|
||||
"status": "ERRORED",
|
||||
"messages": ["The test crashed."]
|
||||
},
|
||||
{
|
||||
"name": "caught",
|
||||
"assertions": 0,
|
||||
"status": "PASSED"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
{
|
||||
"id": "Criterion v2.1.0",
|
||||
"passed": 4,
|
||||
"failed": 2,
|
||||
"errored": 0,
|
||||
"skipped": 0,
|
||||
"test_suites": [
|
||||
{
|
||||
"name": "asserts",
|
||||
"passed": 4,
|
||||
"failed": 2,
|
||||
"errored": 0,
|
||||
"skipped": 0,
|
||||
"tests": [
|
||||
{
|
||||
"name": "string",
|
||||
"assertions": 10,
|
||||
"status": "PASSED"
|
||||
},
|
||||
{
|
||||
"name": "old_school",
|
||||
"assertions": 2,
|
||||
"status": "FAILED",
|
||||
"messages": [
|
||||
"asserts.c:18: The conditions for this assertion were not met.",
|
||||
"asserts.c:17: You can fail an assertion with a message from anywhere"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "native",
|
||||
"assertions": 8,
|
||||
"status": "PASSED"
|
||||
},
|
||||
{
|
||||
"name": "float",
|
||||
"assertions": 2,
|
||||
"status": "PASSED"
|
||||
},
|
||||
{
|
||||
"name": "base",
|
||||
"assertions": 6,
|
||||
"status": "FAILED",
|
||||
"messages": [
|
||||
"asserts.c:12: This assert runs",
|
||||
"asserts.c:11: assert is fatal, expect isn't"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "array",
|
||||
"assertions": 3,
|
||||
"status": "PASSED"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
{
|
||||
"id": "Criterion v2.1.0",
|
||||
"passed": 2,
|
||||
"failed": 0,
|
||||
"errored": 0,
|
||||
"skipped": 1,
|
||||
"test_suites": [
|
||||
{
|
||||
"name": "suite2",
|
||||
"passed": 1,
|
||||
"failed": 0,
|
||||
"errored": 0,
|
||||
"skipped": 0,
|
||||
"tests": [
|
||||
{
|
||||
"name": "test",
|
||||
"assertions": 1,
|
||||
"status": "PASSED"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "suite1",
|
||||
"passed": 1,
|
||||
"failed": 0,
|
||||
"errored": 0,
|
||||
"skipped": 0,
|
||||
"tests": [
|
||||
{
|
||||
"name": "test",
|
||||
"assertions": 1,
|
||||
"status": "PASSED"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "disabled",
|
||||
"passed": 0,
|
||||
"failed": 0,
|
||||
"errored": 0,
|
||||
"skipped": 1,
|
||||
"tests": [
|
||||
{
|
||||
"name": "test",
|
||||
"assertions": 0,
|
||||
"status": "SKIPPED",
|
||||
"messages": ["The test was skipped."]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
{
|
||||
"id": "Criterion v2.1.0",
|
||||
"passed": 0,
|
||||
"failed": 1,
|
||||
"errored": 0,
|
||||
"skipped": 0,
|
||||
"test_suites": [
|
||||
{
|
||||
"name": "sample",
|
||||
"passed": 0,
|
||||
"failed": 1,
|
||||
"errored": 0,
|
||||
"skipped": 0,
|
||||
"tests": [
|
||||
{
|
||||
"name": "long_msg",
|
||||
"assertions": 1,
|
||||
"status": "FAILED",
|
||||
"messages": [
|
||||
"long-messages.c:4: This is",
|
||||
" A long message",
|
||||
" Spawning multiple lines.",
|
||||
" Formatting is respected."
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
{
|
||||
"id": "Criterion v2.1.0",
|
||||
"passed": 0,
|
||||
"failed": 1,
|
||||
"errored": 0,
|
||||
"skipped": 1,
|
||||
"test_suites": [
|
||||
{
|
||||
"name": "misc",
|
||||
"passed": 0,
|
||||
"failed": 1,
|
||||
"errored": 0,
|
||||
"skipped": 1,
|
||||
"tests": [
|
||||
{
|
||||
"name": "skipped",
|
||||
"assertions": 0,
|
||||
"status": "SKIPPED",
|
||||
"messages": ["The test was skipped."]
|
||||
},
|
||||
{
|
||||
"name": "failing",
|
||||
"assertions": 1,
|
||||
"status": "FAILED",
|
||||
"messages": [
|
||||
"description.c:4: The expression 0 is false."
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
0
samples/tests/outputs/json_test.sh.out.expected
Normal file
0
samples/tests/outputs/json_test.sh.out.expected
Normal file
Loading…
Add table
Reference in a new issue