• source navigation  • diff markup  • identifier search  • freetext search  • 

Sources/ucode/tests/custom/99_bugs/52_ucode_option_arguments

  1 Test that ucode scripts can receive option arguments via ARGV.
  2 
  3 -- Testcase --
  4 {%
  5         // Strip valgrind from UCODE_BIN
  6         let ucode = UCODE_BIN;
  7         let i = rindex(ucode, ' ');
  8         if (i > -1)
  9                 ucode = substr(ucode, i + 1);
 10 
 11         system([ ucode, TESTFILES_PATH + '/testscripts/hello.uc', '--option', 'otherarg']);
 12 %}
 13 -- End --
 14 
 15 -- File testscripts/hello.uc --
 16 #!/usr/bin/ucode
 17 
 18 print("This is our test program running!\n");
 19 print("My arguments are:\n");
 20 
 21 for (arg in ARGV) {
 22         print(`<${arg}>\n`);
 23 }
 24 -- End --
 25 
 26 -- Expect stdout --
 27 This is our test program running!
 28 My arguments are:
 29 <--option>
 30 <otherarg>
 31 -- End --

This page was automatically generated by LXR 0.3.1.  •  OpenWrt