Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Short-circuit check --rerun if testdir doesn't exist #316

Merged
merged 1 commit into from
Nov 6, 2023

Conversation

muzimuzhi
Copy link
Contributor

@muzimuzhi muzimuzhi commented Nov 6, 2023

When corresponding testdir doesn't exist, currently l3build check --rerun exits with all testdirs created as files in builddir, not as directories.

Unfortunately a following l3build check without --rerun won't reset this wrong state, because none of mkdir() and cleandir() ensures the the created/cleaned object is a directory. Thus user has to clean builddir manually to recover from the problem.

This PR adds a guard to check() so that l3build check --rerun will complain and short-circuit when the corresponding testdir doesn't exist.

  • Before
    $ git clone [email protected]:latex3/l3build.git && cd l3build
    # specify a config file to get shorter stdout/stderr
    $ texlua ./l3build check -c build --rerun
    Running checks on
      00-test-1 (1/1)
    ./l3build-file-functions.lua:184: Unable to change working directory to './build/test'
    Not a directory
    $ tree build
    build
    └── test
    
    1 directory, 1 file
    Note the ./build/test is created as a file, not a directory.
  • After
    $ texlua ./l3build.lua check --rerun -c build
    
      Test directory "./build/test" doesn't exist. Try again without "--rerun".
    $ tree build
    build  [error opening dir]
    
    0 directories, 0 files
    Without -c build
    $ texlua ./l3build.lua check --rerun
    Running l3build with target "check" and configuration "build"
    
      Test directory "./build/test" doesn't exist. Try again without "--rerun".
    
    Running l3build with target "check" and configuration "config-pdf"
    
      Test directory "./build/test-config-pdf" doesn't exist. Try again without "--rerun".
    
    Running l3build with target "check" and configuration "config-plain"
    
      Test directory "./build/test-config-plain" doesn't exist. Try again without "--rerun".
    
    Running l3build with target "check" and configuration "config-context"
    
      Test directory "./build/test-config-context" doesn't exist. Try again without "--rerun".
    
    Failed tests for configuration "build":
    
      Check failed with difference files
    
    ...
    
    $ tree build
    build  [error opening dir]
    
    0 directories, 0 files

l3build-check.lua Outdated Show resolved Hide resolved
@josephwright josephwright merged commit 6014344 into latex3:main Nov 6, 2023
1 check passed
@muzimuzhi muzimuzhi deleted the fix/check-rerun branch November 6, 2023 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants