test_parser = executable('test-css-parser',
  sources: ['test-css-parser.c', '../../testutils.c'],
  c_args: common_cflags,
  dependencies: libgtk_dep,
)

test_data = [
  'animation-crash-3.12.css',
  'animation-crash-3.12.errors',
  'animation-crash-3.12.ref.css',
  'animation-delay.css',
  'animation-delay.ref.css',
  'animation-direction.css',
  'animation-direction.ref.css',
  'animation-duration.css',
  'animation-duration.ref.css',
  'animation-fill-mode.css',
  'animation-fill-mode.ref.css',
  'animation-iteration-count.css',
  'animation-iteration-count.ref.css',
  'animation-name.css',
  'animation-name.ref.css',
  'animation-play-state.css',
  'animation-play-state.ref.css',
  'animation-shorthand-crash.css',
  'animation-shorthand-crash.ref.css',
  'animation-timing-function.css',
  'animation-timing-function.ref.css',
  'at-invalid-01.css',
  'at-invalid-01.errors',
  'at-invalid-01.ref.css',
  'at-invalid-02.css',
  'at-invalid-02.errors',
  'at-invalid-02.ref.css',
  'at-invalid-03.css',
  'at-invalid-03.errors',
  'at-invalid-03.ref.css',
  'at-invalid-04.css',
  'at-invalid-04.errors',
  'at-invalid-04.ref.css',
  'at-invalid-05.css',
  'at-invalid-05.errors',
  'at-invalid-05.ref.css',
  'at-invalid-06.css',
  'at-invalid-06.errors',
  'at-invalid-06.ref.css',
  'at-invalid-07.css',
  'at-invalid-07.errors',
  'at-invalid-07.ref.css',
  'at-invalid-08.css',
  'at-invalid-08.errors',
  'at-invalid-08.ref.css',
  'at-invalid-09.css',
  'at-invalid-09.errors',
  'at-invalid-09.ref.css',
  'at-invalid-10.css',
  'at-invalid-10.errors',
  'at-invalid-10.ref.css',
  'at-invalid-11.css',
  'at-invalid-11.errors',
  'at-invalid-11.ref.css',
  'at-invalid-12.css',
  'at-invalid-12.errors',
  'at-invalid-12.ref.css',
  'at-invalid-13.css',
  'at-invalid-13.errors',
  'at-invalid-13.ref.css',
  'at-invalid-14.css',
  'at-invalid-14.errors',
  'at-invalid-14.ref.css',
  'at-invalid-15.css',
  'at-invalid-15.errors',
  'at-invalid-15.ref.css',
  'at-invalid-16.css',
  'at-invalid-16.errors',
  'at-invalid-16.ref.css',
  'at-invalid-17.css',
  'at-invalid-17.errors',
  'at-invalid-17.ref.css',
  'at-invalid-18.css',
  'at-invalid-18.errors',
  'at-invalid-18.ref.css',
  'at-invalid-19.css',
  'at-invalid-19.errors',
  'at-invalid-19.ref.css',
  'at-invalid-20.css',
  'at-invalid-20.errors',
  'at-invalid-20.ref.css',
  'at-invalid-21.css',
  'at-invalid-21.errors',
  'at-invalid-21.ref.css',
  'at-valid-01.css',
  'at-valid-01.ref.css',
  'at-valid-02.css',
  'at-valid-02.ref.css',
  'at-valid-03.css',
  'at-valid-03.ref.css',
  'at-valid-04.css',
  'at-valid-04.ref.css',
  'at-valid-05.css',
  'at-valid-05.ref.css',
  'at-valid-06.css',
  'at-valid-06.ref.css',
  'at-valid-07.css',
  'at-valid-07.errors',
  'at-valid-08.css',
  'at-valid-08.ref.css',
  'at-valid-09.css',
  'at-valid-09.ref.css',
  'at-valid-10.css',
  'at-valid-10.errors',
  'at-valid-10.ref.css',
  'at-valid-11.css',
  'at-valid-11.errors',
  'at-valid-11.ref.css',
  'at-valid-12.css',
  'at-valid-12.errors',
  'at-valid-12.ref.css',
  'at-valid-13.css',
  'at-valid-13.errors',
  'at-valid-13.ref.css',
  'at-valid-14.css',
  'at-valid-14.errors',
  'at-valid-14.ref.css',
  'at-valid-15.css',
  'at-valid-15.ref.css',
  'at-valid-16.css',
  'at-valid-16.errors',
  'at-valid-16.ref.css',
  'at-valid-17.css',
  'at-valid-17.errors',
  'at-valid-18.css',
  'at-valid-18.ref.css',
  'background-blend-mode.css',
  'background-blend-mode.ref.css',
  'background-clip.css',
  'background-clip.ref.css',
  'background-image.css',
  'background-image.ref.css',
  'background-origin.css',
  'background-origin.ref.css',
  'background-position.css',
  'background-position.errors',
  'background-position-errors.css',
  'background-position-errors.errors',
  'background-position-errors.ref.css',
  'background-position.ref.css',
  'background-repeat.css',
  'background-repeat.ref.css',
  'background-shorthand.css',
  'background-shorthand.errors',
  'background-shorthand.ref.css',
  'background-shorthand-single.css',
  'background-shorthand-single.ref.css',
  'background-size.css',
  'background-size.ref.css',
  'backslash.css',
  'backslash.errors',
  'backslash.ref.css',
  'backslash-eof-is-identifier.css',
  'backslash-eof-is-identifier.errors',
  'backslash-eof-is-identifier.ref.css',
  'border.css',
  'border.errors',
  'border-color.css',
  'border-color-currentcolor.css',
  'border-color-currentcolor.ref.css',
  'border-color.ref.css',
  'border-crash-3.24.css',
  'border-crash-3.24.errors',
  'border-crash-3.24.ref.css',
  'border-image-repeat.css',
  'border-image-repeat.ref.css',
  'border-image-slice.css',
  'border-image-slice.ref.css',
  'border-image-source.css',
  'border-image-source.ref.css',
  'border-image-width.css',
  'border-image-width.ref.css',
  'border-infloop-3.12.css',
  'border-infloop-3.12.errors',
  'border-infloop-3.12.ref.css',
  'border-radius.css',
  'border-radius.ref.css',
  'border-radius-shorthand.css',
  'border-radius-shorthand.errors',
  'border-radius-shorthand.ref.css',
  'border.ref.css',
  'border-shorthand.css',
  'border-shorthand.ref.css',
  'border-spacing.css',
  'border-spacing.ref.css',
  'border-style.css',
  'border-style.ref.css',
  'border-width.css',
  'border-width.ref.css',
  'box-shadow.css',
  'box-shadow.ref.css',
  'calc.css',
  'calc-errors.css',
  'calc-errors.errors',
  'calc-errors.ref.css',
  'calc.ref.css',
  'calc-simple.css',
  'calc-simple.ref.css',
  'cdo-cdc.css',
  'cdo-cdc.ref.css',
  'close-at-end-of-file.css',
  'close-at-end-of-file.errors',
  'close-at-end-of-file.ref.css',
  'color.css',
  'color.errors',
  'color.ref.css',
  'colors-errors.css',
  'colors-errors.errors',
  'colors-errors.ref.css',
  'color-mix.css',
  'color-mix.errors',
  'color-mix.ref.css',
  'colors-red.css',
  'colors-red.ref.css',
  'comment-detection.css',
  'comment-detection.ref.css',
  'cross-fade-basic.css',
  'cross-fade-crash-4101.css',
  'cross-fade-crash-4101.errors',
  'cross-fade-crash-4101.ref.css',
  'css-21-malformed-declarations.css',
  'css-21-malformed-declarations.errors',
  'css-21-malformed-declarations.ref.css',
  'css-21-malformed-statements.css',
  'css-21-malformed-statements.errors',
  'css-21-malformed-statements.ref.css',
  'currentcolor-everywhere.css',
  'currentcolor-everywhere.ref.css',
  'currentcolor-everywhere.errors',
  'dash-backslash-eof-is-identifier.ref.css',
  'dash-backslash-eof-is-identifier.css',
  'dash-backslash-eof-is-identifier.errors',
  'dash-backslash-newline-is-delim.ref.css',
  'dash-backslash-newline-is-delim.errors',
  'dash-backslash-newline-is-delim.css',
  'dash-dash-eof-is-identifier.ref.css',
  'dash-dash-eof-is-identifier.css',
  'dash-dash-eof-is-identifier.errors',
  'dash-eof-is-delim.ref.css',
  'dash-eof-is-delim.css',
  'dash-eof-is-delim.errors',
  'declarations.css',
  'declarations.errors',
  'declarations-invalid-01.css',
  'declarations-invalid-01.errors',
  'declarations-invalid-01.ref.css',
  'declarations-invalid-02.css',
  'declarations-invalid-02.errors',
  'declarations-invalid-02.ref.css',
  'declarations-invalid-03.css',
  'declarations-invalid-03.errors',
  'declarations-invalid-03.ref.css',
  'declarations-invalid-04.css',
  'declarations-invalid-04.errors',
  'declarations-invalid-04.ref.css',
  'declarations-invalid-05.css',
  'declarations-invalid-05.errors',
  'declarations-invalid-05.ref.css',
  'declarations-invalid-06.css',
  'declarations-invalid-06.errors',
  'declarations-invalid-06.ref.css',
  'declarations-invalid-07.css',
  'declarations-invalid-07.errors',
  'declarations-invalid-07.ref.css',
  'declarations-invalid-08.css',
  'declarations-invalid-08.errors',
  'declarations-invalid-08.ref.css',
  'declarations.ref.css',
  'declarations-valid-01.css',
  'declarations-valid-01.ref.css',
  'declarations-valid-02.css',
  'declarations-valid-02.errors',
  'declarations-valid-02.ref.css',
  'declarations-valid-03.css',
  'declarations-valid-03.ref.css',
  'declarations-valid-04.css',
  'declarations-valid-04.ref.css',
  'declarations-valid-05.css',
  'declarations-valid-05.ref.css',
  'declarations-valid-06.css',
  'declarations-valid-06.ref.css',
  'declarations-valid-07.css',
  'declarations-valid-07.ref.css',
  'declarations-valid-08.css',
  'declarations-valid-08.ref.css',
  'declarations-valid-09.css',
  'declarations-valid-09.errors',
  'declarations-valid-09.ref.css',
  'declarations-valid-10.css',
  'declarations-valid-10.ref.css',
  'declarations-valid-11.css',
  'declarations-valid-11.ref.css',
  'declarations-valid-12.css',
  'declarations-valid-12.ref.css',
  'declarations-valid-13.css',
  'declarations-valid-13.ref.css',
  'declarations-valid-14.css',
  'declarations-valid-14.ref.css',
  'declarations-valid-15.css',
  'declarations-valid-15.ref.css',
  'declarations-valid-16.css',
  'declarations-valid-16.ref.css',
  'declarations-valid-17.css',
  'declarations-valid-17.ref.css',
  'declarations-valid-18.css',
  'declarations-valid-18.ref.css',
  'declarations-valid-22.css',
  'declarations-valid-22.ref.css',
  'declarations-valid-23.css',
  'declarations-valid-23.ref.css',
  'declarations-valid-24.css',
  'declarations-valid-24.ref.css',
  'declarations-valid-25.css',
  'declarations-valid-25.ref.css',
  'declarations-valid-26.css',
  'declarations-valid-26.ref.css',
  'does-not-exist.css',
  'does-not-exist.errors',
  'does-not-exist.ref.css',
  'doubled.css',
  'doubled.ref.css',
  'empty.css',
  'filter.css',
  'filter.ref.css',
  'filter-invalid1.css',
  'filter-invalid1.errors',
  'filter-invalid1.ref.css',
  'filter-invalid2.css',
  'filter-invalid2.errors',
  'filter-invalid2.ref.css',
  'filter-invalid3.css',
  'filter-invalid3.errors',
  'filter-invalid3.ref.css',
  'filter-invalid4.css',
  'filter-invalid4.errors',
  'filter-invalid4.ref.css',
  'filter-invalid5.css',
  'filter-invalid5.errors',
  'filter-invalid5.ref.css',
  'filter-invalid6.css',
  'filter-invalid6.errors',
  'filter-invalid6.ref.css',
  'filter-invalid7.css',
  'filter-invalid7.errors',
  'filter-invalid7.ref.css',
  'filter-invalid8.css',
  'filter-invalid8.errors',
  'filter-invalid8.ref.css',
  'filter-invalid9.css',
  'filter-invalid9.errors',
  'filter-invalid9.ref.css',
  'font-family.css',
  'font-family.ref.css',
  'font-features.css',
  'font-features.ref.css',
  'font-features-invalid1.css',
  'font-features-invalid1.errors',
  'font-features-invalid1.ref.css',
  'font-features-invalid2.css',
  'font-features-invalid2.errors',
  'font-features-invalid2.ref.css',
  'font-features-invalid3.css',
  'font-features-invalid3.errors',
  'font-features-invalid3.ref.css',
  'font-size.css',
  'font-size.ref.css',
  'font-stretch.css',
  'font-stretch.ref.css',
  'font-style.css',
  'font-style.ref.css',
  'font-variant.css',
  'font-variant.ref.css',
  'font-weight.css',
  'font-weight.ref.css',
  'font-weight-invalid.css',
  'font-weight-invalid.errors',
  'font-weight-invalid.ref.css',
  'font-weight-invalid2.css',
  'font-weight-invalid2.errors',
  'font-weight-invalid2.ref.css',
  'freed-string-in-error-messages.css',
  'freed-string-in-error-messages.errors',
  'freed-string-in-error-messages.ref.css',
  'hsl.css',
  'hsl.errors',
  'hsl.ref.css',
  'import-cyclic-1.css',
  'import-cyclic-1.errors',
  'import-cyclic-1.ref.css',
  'import-cyclic-2.css',
  'import-cyclic-2.errors',
  'import-cyclic-2.ref.css',
  'import-cyclic-3.css',
  'import-cyclic-3.errors',
  'import-cyclic-3.ref.css',
  'import-nonexistant.css',
  'import-nonexistant.errors',
  'import-nonexistant.ref.css',
  'import-recursive.css',
  'import-recursive.errors',
  'import-recursive.ref.css',
  'integer.css',
  'integer.errors',
  'integer.ref.css',
  'keyframes-empty.css',
  'keyframes-empty.ref.css',
  'keyframes-ordering.css',
  'keyframes-ordering.ref.css',
  'letter-spacing.css',
  'letter-spacing.ref.css',
  'linear-gradient.css',
  'linear-gradient.ref.css',
  'line-height.css',
  'line-height.ref.css',
  'line-height-invalid1.css',
  'line-height-invalid1.errors',
  'line-height-invalid1.ref.css',
  'line-height-invalid2.css',
  'line-height-invalid2.errors',
  'line-height-invalid2.ref.css',
  'line-height-invalid3.css',
  'line-height-invalid3.errors',
  'line-height-invalid3.ref.css',
  'margin.css',
  'margin.ref.css',
  'math.css',
  'math.ref.css',
  'math2.css',
  'math2.ref.css',
  'min-height.css',
  'min-height.ref.css',
  'min-width.css',
  'min-width.ref.css',
  'newline-after-backslash.css',
  'newline-after-backslash.errors',
  'newline-after-backslash.ref.css',
  'newline-after-backslash-original.css',
  'newline-after-backslash-original.errors',
  'newline-after-backslash-original.ref.css',
  'no-semicolon.css',
  'no-semicolon.errors',
  'no-semicolon.ref.css',
  'not.css',
  'not.ref.css',
  'not-unclosed.css',
  'not-unclosed.errors',
  'not-unclosed.ref.css',
  'nth-child.css',
  'nth-child.ref.css',
  'number-values.css',
  'number-values.ref.css',
  'opacity.css',
  'opacity.ref.css',
  'outline-color.css',
  'outline-color.ref.css',
  'outline-offset.css',
  'outline-offset.ref.css',
  'outline-radius.css',
  'outline-radius.ref.css',
  'outline-style.css',
  'outline-style.ref.css',
  'outline-width.css',
  'outline-width.ref.css',
  'padding.css',
  'padding.ref.css',
  'property-name-errors.css',
  'property-name-errors.errors',
  'property-name-errors.ref.css',
  'pseudo-classes-known.css',
  'pseudo-classes-known.ref.css',
  'pseudo-classes-unknown.css',
  'pseudo-classes-unknown.errors',
  'pseudo-classes-unknown.ref.css',
  'radial-background-position-error.css',
  'radial-background-position-error.errors',
  'radial-background-position-error.ref.css',
  'radial.css',
  'radial-positions.css',
  'radial-positions.errors',
  'radial-positions.ref.css',
  'radial.ref.css',
  'relative-color.css',
  'relative-color.errors',
  'relative-color.ref.css',
  'resource-url.css',
  'resource-url.ref.css',
  'rotate3d-crash.css',
  'rotate3d-crash.errors',
  'rotate3d-crash.ref.css',
  'selector.css',
  'selector.ref.css',
  'selector-original.css',
  'selector-original.ref.css',
  'shadow.css',
  'shadow.errors',
  'shadow.ref.css',
  'shadow-ordering.css',
  'shadow-ordering.ref.css',
  'shorthand.css',
  'shorthand.ref.css',
  'simple.css',
  'single-slash.css',
  'single-slash.errors',
  'single-slash.ref.css',
  'string-values.css',
  'string-values.ref.css',
  'test.png',
  'text-decoration.css',
  'text-decoration.ref.css',
  'text-decoration-color.css',
  'text-decoration-color.ref.css',
  'text-decoration-line.css',
  'text-decoration-line.ref.css',
  'text-decoration-style.css',
  'text-decoration-style.ref.css',
  'text-shadow.css',
  'text-shadow-invalid-but-worked-in-3.12.css',
  'text-shadow-invalid-but-worked-in-3.12.errors',
  'text-shadow-invalid-but-worked-in-3.12.ref.css',
  'text-shadow.ref.css',
  'text-transform.css',
  'text-transform.ref.css',
  'transform.css',
  'transform.ref.css',
  'transform-invalid1.css',
  'transform-invalid1.errors',
  'transform-invalid1.ref.css',
  'transform-invalid2.css',
  'transform-invalid2.errors',
  'transform-invalid2.ref.css',
  'transform-invalid3.css',
  'transform-invalid3.errors',
  'transform-invalid3.ref.css',
  'transform-invalid4.css',
  'transform-invalid4.errors',
  'transform-invalid4.ref.css',
  'transform-invalid5.css',
  'transform-invalid5.errors',
  'transform-invalid5.ref.css',
  'transform-invalid6.css',
  'transform-invalid6.errors',
  'transform-invalid6.ref.css',
  'transform-invalid7.css',
  'transform-invalid7.errors',
  'transform-invalid7.ref.css',
  'transform-invalid8.css',
  'transform-invalid8.errors',
  'transform-invalid8.ref.css',
  'transform-invalid9.css',
  'transform-invalid9.errors',
  'transform-invalid9.ref.css',
  'transform-invalid10.css',
  'transform-invalid10.errors',
  'transform-invalid10.ref.css',
  'transform-invalid11.css',
  'transform-invalid11.errors',
  'transform-invalid11.ref.css',
  'transform-invalid12.css',
  'transform-invalid12.errors',
  'transform-invalid12.ref.css',
  'transform-invalid13.css',
  'transform-invalid13.errors',
  'transform-invalid13.ref.css',
  'transform-invalid14.css',
  'transform-invalid14.errors',
  'transform-invalid14.ref.css',
  'transform-invalid15.css',
  'transform-invalid15.errors',
  'transform-invalid15.ref.css',
  'transform-invalid16.css',
  'transform-invalid16.errors',
  'transform-invalid16.ref.css',
  'transform-invalid17.css',
  'transform-invalid17.errors',
  'transform-invalid17.ref.css',
  'transform-invalid18.css',
  'transform-invalid18.errors',
  'transform-invalid18.ref.css',
  'transform-invalid19.css',
  'transform-invalid19.errors',
  'transform-invalid19.ref.css',
  'transition.css',
  'transition-delay.css',
  'transition-delay.ref.css',
  'transition-duration.css',
  'transition-duration.ref.css',
  'transition-property.css',
  'transition-property.ref.css',
  'transition.ref.css',
  'transition-timing-function.css',
  'transition-timing-function.ref.css',
  'transition-timing-function-invalid.css',
  'transition-timing-function-invalid.errors',
  'transition-timing-function-invalid.ref.css',
  'transition-timing-function-invalid2.css',
  'transition-timing-function-invalid2.errors',
  'transition-timing-function-invalid2.ref.css',
  'transition-timing-function-invalid3.css',
  'transition-timing-function-invalid3.errors',
  'transition-timing-function-invalid3.ref.css',
  'url-invalid1.css',
  'url-invalid1.errors',
  'url-invalid1.ref.css',
  'url-invalid2.css',
  'url-invalid2.errors',
  'url-invalid2.ref.css',
  'url-valid1.css',
  'url-valid1.ref.css',
  'url-valid2.css',
  'url-valid2.ref.css',
  'url-valid3.css',
  'url-valid3.ref.css',
  'value-inherit.css',
  'value-inherit.ref.css',
  'value-inherit.errors',
  'value-inherit-shorthand.css',
  'value-inherit-shorthand.ref.css',
  'value-initial.css',
  'value-initial.ref.css',
  'value-initial.errors',
  'value-initial-shorthand.css',
  'value-initial-shorthand.ref.css',
  'value-none.css',
  'value-none.errors',
  'value-none.ref.css',
  'variables.css',
  'variables.ref.css',
  'variables-invalid-01.css',
  'variables-invalid-01.errors',
  'variables-invalid-01.ref.css',
  'variables-invalid-02.css',
  'variables-invalid-02.errors',
  'variables-invalid-02.ref.css',
  'variables-invalid-03.css',
  'variables-invalid-03.errors',
  'variables-invalid-03.ref.css',
  'variables-invalid-04.css',
  'variables-invalid-04.errors',
  'variables-invalid-04.ref.css',
  'variables-invalid-05.css',
  'variables-invalid-05.errors',
  'variables-invalid-05.ref.css',
]

foreach testname : test_data
  if testname.endswith('.css') and not testname.endswith('.ref.css')
    test('parser ' + testname, test_parser,
         args: [ '--tap',
                 '-k',
                 join_paths(meson.current_source_dir(), testname),
               ],
         protocol: 'tap',
         env: [
                'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
                'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir())
              ],
         suite: 'css')
  endif
endforeach
