17 #include "run_tests.h" 22 static char *Cmd =
"";
23 static char *CmdPre =
"";
24 static char *
File =
"";
25 static char *CmdPost =
"";
26 static char *Out =
"";
27 static char *Where =
"";
35 deleteTmpFiles(
"./test-result/");
38 File =
"../testdata/test.tar.Z";
39 CmdPost =
">/dev/null 2>&1";
44 FO_ASSERT_EQUAL(
exists, 0);
45 FO_ASSERT_EQUAL(
Result, 0);
53 deleteTmpFiles(
"./test-result/");
56 File =
"../testdata/test.tar.Z";
57 CmdPost =
"> '%s' 2>/dev/null";
58 Out =
"test.tar.Z.unpacked";
59 Where =
"./test-result";
62 FO_ASSERT_EQUAL(
exists, 1);
63 FO_ASSERT_EQUAL(
Result, 0);
71 deleteTmpFiles(
"./test-result/");
74 File =
"../testdata/test.pdf";
75 CmdPost =
"> '%s' 2>/dev/null";
76 Out =
"test.pdf.text";
77 Where =
"./test-result";
80 FO_ASSERT_EQUAL(
exists, 1);
81 FO_ASSERT_EQUAL(
Result, 0);
89 deleteTmpFiles(
"./test-result/");
92 File =
"../testdata/test.rpm";
93 CmdPost =
"> '%s' 2> /dev/null";
94 Out =
"test.rpm.unpacked";
95 Where =
"./test-result";
98 FO_ASSERT_EQUAL(
exists, 1);
99 FO_ASSERT_EQUAL(
Result, 0);
107 deleteTmpFiles(
"./test-result/");
110 CmdPre =
"--no-absolute-filenames -i -d <";
111 File =
"./test-result/test.rpm.unpacked";
112 CmdPost =
">/dev/null 2>&1";
113 Out =
"test.rpm.unpacked.dir";
114 Where =
"./test-result/test.rpm.unpacked.dir";
117 FO_ASSERT_EQUAL(
exists, 1);
118 FO_ASSERT_EQUAL(
Result, 0);
void testRunCommand4Zcat()
test the command zcat, unpack via zcat
void testRunCommand4ZcatTesting()
test the command zcat, just testing if the commmand can run
CU_TestInfo RunCommand_testcases[]
Run test cases.
static int Result
Result of calls.
int file_dir_exists(char *path_name)
test if a file or directory exists
void testRunCommand4Pdf()
test the command pdftotext
void testRunCommand4Rpm2()
test rpm file, the command is cpio
void testRunCommand4Rpm1()
test rpm file, the command is rmp2cpio
int RunCommand(char *Cmd, char *CmdPre, char *File, char *CmdPost, char *Out, char *Where)
Try a command and return command code.
int exists
Default not exists.