PhoenixGenerator  2.0.0
Set of tools to generate code
main.cpp File Reference
#include <iostream>
#include <vector>
#include "phoenix_assert.h"
#include "phoenix_system.h"
+ Include dependency graph for main.cpp:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 
void testPhoenixPOpen ()
 Test the phoenix popen function. More...
 

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 39 of file main.cpp.

39  {
41  return 0;
42 }
void testPhoenixPOpen()
Test the phoenix popen function.
Definition: main.cpp:14

References testPhoenixPOpen().

+ Here is the call graph for this function:

◆ testPhoenixPOpen()

void testPhoenixPOpen ( )

Test the phoenix popen function.

Definition at line 14 of file main.cpp.

14  {
15  PString resCmd1(phoenix_popen("echo \"test command\""));
16  std::cout << "testPhoenixPOpen : resCmd1 = '" << resCmd1 << "'" << std::endl;
17  phoenix_assert(resCmd1 == "test command\n");
18  phoenix_assert(phoenix_popen("") == "");
19  PString resCmd3(phoenix_popen("someUnexistingCommad"));
20  std::cout << "testPhoenixPOpen : resCmd3 = '" << resCmd3 << "'" << std::endl;
21  phoenix_assert(resCmd3 == "\0");
22  int exitStatus1 = phoenix_popen(resCmd1, "echo \"test command\"");
23  phoenix_assert(resCmd1 == "test command\n");
24  phoenix_assert(exitStatus1 == 0);
25  PString resEmptyCmd("");
26  int exitStatus2 = phoenix_popen(resEmptyCmd, "");
27  phoenix_assert(resEmptyCmd == "");
28  phoenix_assert(exitStatus2 == -1);
29  PString resUnexistingCmd("");
30  int exitStatus3 = phoenix_popen(resUnexistingCmd, "someUnexistingCommad");
31  phoenix_assert(resUnexistingCmd == "");
32  phoenix_assert(exitStatus3 == 32512);
33  phoenix_assert(phoenix_popen(PPath("command.log"), "echo \"test command\"", true));
34  phoenix_assert(phoenix_popen(PPath("command.log"), "echo \"test command\"", false));
35  phoenix_assert(!phoenix_popen(PPath("command_unexistingCommand.log"), "someUnexistingCommand", true));
36  phoenix_assert(!phoenix_popen(PPath("command_unexistingCommand.log"), "someUnexistingCommand", false));
37 }
Path of a directory or a file.
Definition: PPath.h:17
Extends the std::string.
Definition: PString.h:16
#define phoenix_assert(isOk)
PString phoenix_popen(const PString &command)
Execute the given command and returns the output of this command.

References phoenix_assert, and phoenix_popen().

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: