11 static char *Cmd =
"";
12 static char *CmdPre =
"";
13 static char *
File =
"";
14 static char *CmdPost =
"";
15 static char *Out =
"";
16 static char *Where =
"";
24 deleteTmpFiles(
"./test-result/");
27 File =
"../testdata/test.tar.Z";
28 CmdPost =
">/dev/null 2>&1";
33 FO_ASSERT_EQUAL(
exists, 0);
34 FO_ASSERT_EQUAL(
Result, 0);
42 deleteTmpFiles(
"./test-result/");
45 File =
"../testdata/test.tar.Z";
46 CmdPost =
"> '%s' 2>/dev/null";
47 Out =
"test.tar.Z.unpacked";
48 Where =
"./test-result";
51 FO_ASSERT_EQUAL(
exists, 1);
52 FO_ASSERT_EQUAL(
Result, 0);
60 deleteTmpFiles(
"./test-result/");
63 File =
"../testdata/test.pdf";
64 CmdPost =
"> '%s' 2>/dev/null";
65 Out =
"test.pdf.text";
66 Where =
"./test-result";
69 FO_ASSERT_EQUAL(
exists, 1);
70 FO_ASSERT_EQUAL(
Result, 0);
78 deleteTmpFiles(
"./test-result/");
81 File =
"../testdata/test.rpm";
82 CmdPost =
"> '%s' 2> /dev/null";
83 Out =
"test.rpm.unpacked";
84 Where =
"./test-result";
87 FO_ASSERT_EQUAL(
exists, 1);
88 FO_ASSERT_EQUAL(
Result, 0);
96 deleteTmpFiles(
"./test-result/");
99 CmdPre =
"--no-absolute-filenames -i -d <";
100 File =
"./test-result/test.rpm.unpacked";
101 CmdPost =
">/dev/null 2>&1";
102 Out =
"test.rpm.unpacked.dir";
103 Where =
"./test-result/test.rpm.unpacked.dir";
106 FO_ASSERT_EQUAL(
exists, 1);
107 FO_ASSERT_EQUAL(
Result, 0);
static int Result
Result of calls.
void testRunCommand4Rpm1()
test rpm file, the command is rmp2cpio
void testRunCommand4Pdf()
test the command pdftotext
void testRunCommand4Zcat()
test the command zcat, unpack via zcat
void testRunCommand4ZcatTesting()
test the command zcat, just testing if the commmand can run
void testRunCommand4Rpm2()
test rpm file, the command is cpio
CU_TestInfo RunCommand_testcases[]
Run test cases.
int RunCommand(char *Cmd, char *CmdPre, char *File, char *CmdPost, char *Out, char *Where)
Try a command and return command code.
int file_dir_exists(char *path_name)
test if a file or directory exists
int exists
Default not exists.