Skip to content

Wrong behaviour of environment variables in ocamltest #13941

@OlivierNicole

Description

@OlivierNicole

How to reproduce: run ocamltest on the following test.ml file:

(* TEST
   {
     bytecode;
   }
   {
     native;
   }

   {
     flags += " -runtime-variant d";
     unset OCAMLRUNPARAM;
     set OCAMLRUNPARAM=",v=0";
     bytecode;
   }
   {
     flags += " -runtime-variant d";
     unset OCAMLRUNPARAM;
     set OCAMLRUNPARAM=",v=0";
     native;
   }
 *)

Result:

array-functions/test.ml:18: Variable "OCAMLRUNPARAM" is already in the environment.
 ... testing 'test.ml' => failed
 ... testing 'test.ml' with line 3 (bytecode) => passed
 ... testing 'test.ml' with line 6 (native) => passed
 ... testing 'test.ml' with line 13 (bytecode) => passed
 ... testing 'test.ml' with line 18 => error in test script

This is a surprise to me. I would expect environment variables to be independent of the same variable set in a “parallel” block.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions