Skip to content

Commit

Permalink
Add more dynamic spec test cases
Browse files Browse the repository at this point in the history
This tests wrong/unknown tags and a doublicated Summary tag
  • Loading branch information
ffesti committed Oct 11, 2023
1 parent 8c02174 commit 6b876e0
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/data/SPECS/dynamic.spec
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ echo "License: GPL" >> %{specpartsdir}/mainpkg.specpart
echo "Distribution: RPM test suite." >> %{specpartsdir}/mainpkg.specpart
echo "URL: http://rpm.org" >> %{specpartsdir}/mainpkg.specpart
echo "Summary: dynamic hello -- hello, world rpm" >> %{specpartsdir}/mainpkg.specpart
%{?DOUBLESUMMARY:
echo "Summary: dynamic hello -- hello, world again" >> %{specpartsdir}/mainpkg.specpart
}
%{?WRONGTAG:
echo "LicenseToKill: True" >> %{specpartsdir}/mainpkg.specpart
}

}

echo "%package docs" >> %{specpartsdir}/docs.specpart
Expand Down
34 changes: 34 additions & 0 deletions tests/rpmbuild.at
Original file line number Diff line number Diff line change
Expand Up @@ -2449,6 +2449,40 @@ error: parsing failed

RPMTEST_CLEANUP

# ------------------------------
# Check failing dynamic spec generation
AT_SETUP([rpmbuild with dynamic spec generation fail])
AT_KEYWORDS([build])
RPMDB_INIT
RPMTEST_CHECK([

runroot rpmbuild --quiet -D "FULLDYNAMIC 1" -D "DOUBLESUMMARY 1" -ba /data/SPECS/dynamic.spec
],
[0],
[],
[warning: line 6: second Summary
])

RPMTEST_CLEANUP

# ------------------------------
# Check failing dynamic spec generation
AT_SETUP([rpmbuild with dynamic spec generation fail])
AT_KEYWORDS([build])
RPMDB_INIT
RPMTEST_CHECK([

runroot rpmbuild --quiet -D "FULLDYNAMIC 1" -D "WRONGTAG 1" -ba /data/SPECS/dynamic.spec
],
[1],
[],
[error: line 6: Unknown tag: LicenseToKill: True
error: parsing failed
])

RPMTEST_CLEANUP


# ------------------------------
# Check source name with space
AT_SETUP([rpmbuild source name with space])
Expand Down

0 comments on commit 6b876e0

Please sign in to comment.