Changeset 6b8aae5 in git


Ignore:
Timestamp:
Jul 1, 1998, 12:39:10 PM (25 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'spielwiese', '6e12f9861a9fbafef8cfe9d754bf74a7d483a67b')
Children:
6d7a86a59473bc99949cb0e2ec4f38d7e3eec49c
Parents:
46976a68b5b1ef847ae27a04683148c9e8acb851
Message:
* better tst_status support


git-svn-id: file:///usr/local/Singular/svn/trunk@2272 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/tst.lib

    r46976a6 r6b8aae5  
    1 // $Id: tst.lib,v 1.9 1998-06-30 14:48:21 obachman Exp $
     1// $Id: tst.lib,v 1.10 1998-07-01 10:39:10 obachman Exp $
    22//(obachman, last modified 6/30/98)
    33/////////////////////////////////////////////////////////////////////////////
    44
    5 version="$Id: tst.lib,v 1.9 1998-06-30 14:48:21 obachman Exp $";
     5version="$Id: tst.lib,v 1.10 1998-07-01 10:39:10 obachman Exp $";
    66info="
    77LIBRARY:  tst.lib      PROCEDURES FOR RUNNING AUTOMATIC TST TESTS
     
    1010 tst_system(s)          returns string which is stdout of system(\"sh\", s)
    1111 tst_ignore(any,[keyword], [link]) writes string(any) to link (or stdout),
    12                                    prepending prefix \"// ignore:\"
     12                                   prepending prefix \"// tst_ignore:\"
    1313 tst_init()             writes some identification data to stdout
    1414                        with tst_ignore
     
    4343}
    4444
     45proc GetHostName
     46{
     47  string tst_hostname = tst_system("hostname");
     48  tst_hostname = tst_hostname[1..size(tst_hostname)-1];
     49  return (tst_hostname);
     50}
    4551
    4652proc tst_ignore
     
    5056            link    -- a link which can be written to
    5157RETURN:   none; writes string(any) to link (or stdout, if no link given),
    52           prepending prefix \"// ignore:\", or
    53                             \"// ignore:keyword hostname:\",
     58          prepending prefix \"// tst_ignore:\", or
     59                            \"// tst_ignore:keyword hostname:\",
    5460                            if keyword was given.
    5561          Should be used in tst files to output system dependent data
     
    113119  if (keyword != "")
    114120  {
    115     if (! defined(tst_hostname))
    116     {
    117       string tst_hostname = tst_system("hostname");
    118       tst_hostname = tst_hostname[1..size(tst_hostname)-1];
    119       export tst_hostname;
    120     }
    121 
    122     write(outlink, "// ignore:" + keyword + " " + tst_hostname + ":" + s);
     121    write(outlink,"// tst_ignore:" + keyword + " " + GetHostName() + ":" + s);
    123122  }
    124123  else
    125124  {
    126     write(outlink, "// ignore: " + s);
     125    write(outlink, "// tst_ignore: " + s);
    127126  }
    128127}
     
    140139}
    141140
     141static proc Get_tst_timer
     142{
     143  if (! defined (tst_timer))
     144  {
     145    string tst_timer = "// tst_ignore:0";
     146    export tst_timer;
     147    return (0);
     148  }
     149  else
     150  {
     151    execute "int tst_int_timer = " + tst_timer[15,size(tst_timer)] + ";";
     152    return (tst_int_timer);
     153  }
     154}
     155
     156static proc Set_tst_timer (int this_time)
     157{
     158  tst_timer = tst_timer[1,14] + string(this_time);
     159}
     160
    142161proc tst_status (list #)
    143162"USAGE:   tst_status([any])
     
    159178  else
    160179  {
    161     if (! defined(tst_timer))
    162     {
    163       int tst_timer = 0;
    164       export tst_timer;
    165     }
    166     tst_ignore(timer - tst_timer, "tst_timer");
    167     tst_timer = timer;
     180    tst_ignore(timer - Get_tst_timer(), "tst_timer");
     181    Set_tst_timer(timer);
    168182  }
    169183}
Note: See TracChangeset for help on using the changeset viewer.