Skip to content

add libxml2 tests #16593

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions libxml2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,40 @@ subpackages:
mkdir -p ${{targets.subpkgdir}}/usr/bin
mv ${{targets.destdir}}/usr/bin ${{targets.subpkgdir}}/usr
description: libxml2 utils
test:
pipeline:
- name: Verify libxml2 installation
runs: |
xml2-config --version || exit 1
- name: Basic XML parsing
runs: |
cat << EOF > example.xml
<note>
<to>User</to>
<from>Assistant</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
EOF
xmllint --noout example.xml || exit 1
- name: XML validation with DTD
runs: |
cat << 'EOF' > example.dtd
<!ELEMENT note (to,from,heading,body)>
<!ELEMENT to (#PCDATA)>
<!ELEMENT from (#PCDATA)>
<!ELEMENT heading (#PCDATA)>
<!ELEMENT body (#PCDATA)>
EOF
cat << 'EOF' > note.xml
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
EOF
xmllint --noout --dtdvalid example.dtd note.xml || exit 1

- name: libxml2-dev
pipeline:
Expand All @@ -75,6 +109,20 @@ subpackages:
- xz-dev
- libxml2-utils
description: libxml2 dev
test:
environment:
contents:
packages:
- gcc
- glibc-dev
- libxml2-utils
pipeline:
- name: Verify libxml2-dev installation
runs: |
echo '#include <libxml/parser.h>' > test.c
echo 'int main() {return 0;}' >> test.c
gcc -o test test.c $(xml2-config --cflags) $(xml2-config --libs)
./test || exit 1

update:
enabled: true
Expand Down
Loading