File: common.sl

package info (click to toggle)
slang2 2.3.3-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 11,488 kB
  • sloc: ansic: 101,756; sh: 3,435; makefile: 1,046; pascal: 440
file content (32 lines) | stat: -rw-r--r-- 704 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
% These tests load the uninstalled version of slsh.rc.  The
% installation script appends code for SLSH_PATH processing.  Since
% the uninstalled version of slsh.rc lacks this code, it is added here.
prepend_to_slang_load_path(getenv("SLSH_PATH"));

define start_test (m)
{
   () = fprintf (stdout, "Testing %s functions...", m);
   () = fflush (stdout);
}

private variable tests_failed = 0;

define failed ()
{
   variable s = __pop_args (_NARGS);
   s = sprintf (__push_args(s));
   () = fprintf (stderr, "Failed: %s\n", s);
   tests_failed++;
   throw RunTimeError;
}

define end_test ()
{
   if (tests_failed)
     exit (tests_failed);

   () = fprintf(stdout, "OK\n");
   () = fflush (stdout);
}