Skip to content

Commit

Permalink
more adaptation of rtest and partest for windows (#11973)
Browse files Browse the repository at this point in the history
  • Loading branch information
adrpo committed Feb 8, 2024
1 parent e971726 commit f1b9db4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
8 changes: 6 additions & 2 deletions testsuite/partest/runtests.pl
Expand Up @@ -493,8 +493,12 @@ sub run_tests {
# should not be needed anymore!
# unlink("Compiler");
# Clean up the temporary rtest directory, so it doesn't get overrun.
my $username = getpwuid($<);
my @dirs = glob "/tmp/omc-rtest-$username*";
my $username = ( $^O ne 'MSWin32' ? getpwuid($<) : undef )
|| getlogin()
|| $ENV{'USER'}
|| 'omtmpuser';
my $tmpvar=( $^O ne 'MSWin32' ? '/tmp' : $ENV{'TEMP'} );
my @dirs = glob "$tmpvar/omc-rtest-$username*";
if (@dirs) {
rmtree(@dirs);
}
Expand Down
12 changes: 8 additions & 4 deletions testsuite/rtest
Expand Up @@ -85,8 +85,10 @@ $log="";
my $username = ( $^O ne 'MSWin32' ? getpwuid($<) : undef )
|| getlogin()
|| $ENV{'USER'}
|| 'OM-tmp-user';
$tmpdir = "/tmp/omc-rtest-".$username."/$dirname";
|| 'omtmpuser';
$tmpvar=( $^O ne 'MSWin32' ? '/tmp' : $ENV{'TEMP'} );
$tmpdir = $tmpvar . "/omc-rtest-".$username."/$dirname";
# print("Directory: ", $tmpdir, "\n");
$tmpdir =~ s/\s/_/g;
system "mkdir -p $tmpdir";
$got = "$tmpdir/equations-got";
Expand Down Expand Up @@ -336,8 +338,10 @@ sub dofile
$log = "$tmpdir/log-$f";
$tc_err = 1;
# Find the expected result
open(OUT,">$expected");
open(IN,"<$f");
# print("Expected: ", $expected, "\n");
# print("In: ", $f, "\n");
open(OUT,">$expected") or die "$0: open $expected: $!";
open(IN,"<$f") or die "$0: open $f: $!";
while(<IN>) {
# @adrpo - uncomment for debugging
# print ($_);
Expand Down

0 comments on commit f1b9db4

Please sign in to comment.