Commits

Brodie Rao committed 48d46b6

Add TESTFILE environment variable

  • Participants
  • Parent commits 61d8af6

Comments (0)

Files changed (2)

     abspath = os.path.abspath(path)
     env = os.environ.copy()
     env['TESTDIR'] = os.path.dirname(abspath)
+    env['TESTFILE'] = os.path.basename(abspath)
     p = subprocess.Popen([shell, '-'], bufsize=-1, stdin=subprocess.PIPE,
                          stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
                          universal_newlines=True, env=env,

File examples/env.t

   missingeol.t
   skip.t
   test.t
+  $ echo "$TESTFILE"
+  env.t
   $ pwd
   */cramtests*/env.t (glob)