xref: /freebsd/contrib/libarchive/cat/test/test_expand_zstd.c (revision bd66c1b43e33540205dbc1187c2f2a15c58b57ba)
15c831a5bSMartin Matuska /*-
2*bd66c1b4SMartin Matuska  * SPDX-License-Identifier: BSD-2-Clause
3*bd66c1b4SMartin Matuska  *
45c831a5bSMartin Matuska  * Copyright (c) 2017 Sean Purcell
55c831a5bSMartin Matuska  * All rights reserved.
65c831a5bSMartin Matuska  */
75c831a5bSMartin Matuska #include "test.h"
85c831a5bSMartin Matuska 
DEFINE_TEST(test_expand_zstd)95c831a5bSMartin Matuska DEFINE_TEST(test_expand_zstd)
105c831a5bSMartin Matuska {
115c831a5bSMartin Matuska 	const char *reffile = "test_expand.zst";
125c831a5bSMartin Matuska 	int f;
135c831a5bSMartin Matuska 
145c831a5bSMartin Matuska 	extract_reference_file(reffile);
155c831a5bSMartin Matuska 	f = systemf("%s %s >test.out 2>test.err", testprog, reffile);
165c831a5bSMartin Matuska 	if (f == 0 || canZstd()) {
175c831a5bSMartin Matuska 		assertEqualInt(0, f);
185c831a5bSMartin Matuska 		assertTextFileContents("contents of test_expand.zst.\n", "test.out");
195c831a5bSMartin Matuska 		assertEmptyFile("test.err");
205c831a5bSMartin Matuska 	} else {
215c831a5bSMartin Matuska 		skipping("It seems zstd is not supported on this platform");
225c831a5bSMartin Matuska 	}
235c831a5bSMartin Matuska }
24