interactive testing
[gnucap-felix.git] / src / c_expect.cc
blob9d9f3b64b36dfe031119bb5d86333b4cd464f107
1 /*--------------------------------------------------------------------------
2 * expect makes the following simulation commands expect output
3 * this is for testing purposes. see ../tests
4 * (does not really make sense currently)
5 */
6 class CMD_EXPECT : public CMD {
7 public:
8 virtual ~CMD_EXPECT(){
11 void do_it(CS& cmd, CARD_LIST* )
13 trace0("CMD_EXPECT::do_it");
14 unsigned here = cmd.cursor();
15 try {
16 std::string file_name;
17 cmd >> file_name;
18 CS* file = new CS(CS::_INC_FILE, file_name);
19 trace1( (" CMD_EXPECT::do_it > " +file_name).c_str() , (long int)(OPT::language) );
21 _sim->expect(file);
24 }catch (Exception_File_Open& e) {
25 cmd.warn(bDANGER, here, e.message() + '\n');
26 }catch (Exception_End_Of_Input& e) {
27 // done
30 } p0x;
31 DISPATCHER<CMD>::INSTALL d0x(&command_dispatcher, "expect", &p0x);