1% These tests load the uninstalled version of slsh.rc.  The
2% installation script appends code for SLSH_PATH processing.  Since
3% the uninstalled version of slsh.rc lacks this code, it is added here.
4prepend_to_slang_load_path(getenv("SLSH_PATH"));
5
6define start_test (m)
7{
8   () = fprintf (stdout, "Testing %s functions...", m);
9   () = fflush (stdout);
10}
11
12private variable tests_failed = 0;
13
14define failed ()
15{
16   variable s = __pop_args (_NARGS);
17   s = sprintf (__push_args(s));
18   () = fprintf (stderr, "Failed: %s\n", s);
19   tests_failed++;
20   throw RunTimeError;
21}
22
23define end_test ()
24{
25   if (tests_failed)
26     exit (tests_failed);
27
28   () = fprintf(stdout, "OK\n");
29   () = fflush (stdout);
30}
31
32
33