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

3C output is not cleaned up when a test fails. #378

Closed
sulekhark opened this issue Jan 14, 2021 · 4 comments · Fixed by #412 or #452
Closed

3C output is not cleaned up when a test fails. #378

sulekhark opened this issue Jan 14, 2021 · 4 comments · Fixed by #412 or #452
Assignees
Labels

Comments

@sulekhark
Copy link

When a 3C test case passes:

$ ls ../src/clang/test/3C/arrbothmulti1*
../src/clang/test/3C/arrbothmulti1.c

$ ./bin/llvm-lit.py ../src/clang/test/3C/arrbothmulti1.c
-- Testing: 1 tests, single process --
PASS: Clang :: 3C/arrbothmulti1.c (1 of 1)
llvm-lit.py: C:/Users/sukulka/Work/checkedc-clang/src/llvm\utils\lit\lit\llvm\config.py:340: note: using clang: c:\users\sukulka\work\checkedc-clang\build\bin\clang.exe
Testing Time: 1.77s
Expected Passes : 1

$ ls ../src/clang/test/3C/arrbothmulti1*
../src/clang/test/3C/arrbothmulti1.c

When a 3C test case fails:

$ ls ../src/clang/test/3C/arrbothmulti1*
../src/clang/test/3C/arrbothmulti1.c

$ ./bin/llvm-lit.py ../src/clang/test/3C/arrbothmulti1.c
-- Testing: 1 tests, 1 workers --
FAIL: Clang :: 3C/arrbothmulti1.c (1 of 1)
llvm-lit.py: C:\Users\sukulka\Work\Upgrade\build\bin....\src\llvm\utils\lit\lit\llvm\config.py:345: note: using clang: c:\users\sukulka\work\upgrade\build\bin\clang.exe

Failed Tests (1):
Clang :: 3C/arrbothmulti1.c

Testing Time: 0.63s
Failed: 1

$ ls ../src/clang/test/3C/arrbothmulti1*
../src/clang/test/3C/arrbothmulti1.c ../src/clang/test/3C/arrbothmulti1.checkedALL.c ../src/clang/test/3C/arrbothmulti1.checkedNOALL.c

@mattmccutchen-cci mattmccutchen-cci self-assigned this Jan 14, 2021
@mattmccutchen-cci
Copy link
Member

mattmccutchen-cci commented Jan 14, 2021

Thanks for filing an issue. This is a long-standing known problem, currently planned to be addressed as part of #355 in the next few weeks (and then we'll figure out how to get that change quickly into the Microsoft repository). As a workaround, can you run git clean -f -d -x clang/test/3C between test runs?

@sulekhark
Copy link
Author

Yes, we can work around this issue.

@mattmccutchen-cci
Copy link
Member

Update: #355 will be significantly farther off than I thought, so now I'm planning to fix the temporary file cleanup as part of #412, which I hope will be done within a week.

mattmccutchen-cci added a commit that referenced this issue Feb 13, 2021
- Add -output-dir option to write updated files to a directory structure
  parallel to the base dir (#347). When -output-dir is used, a source
  file outside the base dir can't be handled because there is no way to
  compute its output path. For consistency, this is now an error even
  when -output-dir is not used.

- Convert all 3C regression tests from -output-postfix to -output-dir to
  avoid leaving temporary files in the clang/test/3C directory (#378).

- Expand "3c -help" documentation. In particular, direct the user to pass
  "--" when they don't want to use a compilation database to avoid
  accidentally using unwanted compiler options and suppress the warning
  if no compilation database is found (#343).

- For consistency, have stdout mode output the main file even if it is
  unchanged (#328).

- Fix bugs in matching of file paths against the base dir (#327).

- Other minor bug fixes: see the pull request description for details.

Co-authored-by: John Kastner <[email protected]>
@mattmccutchen-cci
Copy link
Member

While #412 fixed the many tests that used -output-postfix, I noticed that we still have one test that creates a temporary file in clang/test/3C by ad-hoc means: bodiless.c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment