Page MenuHomeFreeBSD

Add `pwd` test
AbandonedPublic

Authored by ngie on Jun 19 2023, 5:27 PM.
Tags
None
Referenced Files
F160363858: D40611.id127703.diff
Tue, Jun 23, 5:38 PM
F160330713: D40611.id126064.diff
Tue, Jun 23, 8:49 AM
F160321898: D40611.id126014.diff
Tue, Jun 23, 6:28 AM
Unknown Object (File)
Thu, Jun 11, 11:51 AM
Unknown Object (File)
Wed, Jun 10, 6:51 AM
Unknown Object (File)
Sat, May 30, 3:10 PM
Unknown Object (File)
Sat, May 30, 1:35 PM
Unknown Object (File)
Sat, May 30, 8:41 AM

Details

Reviewers
lwhsu
yanhaowang
Group Reviewers
tests

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 53106
Build 49997: arc lint + arc unit

Event Timeline

I use the output of getcwd, realpath C functions, and $PWD environment variable to ensure the output of the pwd is correct.

  1. realpath -> absolute path
  2. getcwd -> absolute path
  3. $PWD -> logical path

There are two positive test cases and one negative test case here.

  1. positive test case 1: pwd in the common path.
  2. positive test case 2: pwd in the path has soft_link.
  3. negative test case3: pwd in the path has broken soft_link.

Problems:

  1. In the pwd source code, it also uses the $PWD and getcwd function. My test case also uses this, will it a little duplicate?

After discussing with @bses30074_gmail.com , we will remove the use of get_path.c.

  • use different way to test.
ngie added inline comments.
bin/pwd/Makefile
5–6

Please put this down near .include <bsd.prog.mk>.

12

This seems superfluous.

bin/pwd/tests/pwd_test.sh
1

Copyright?

39

Bad indentation?

etc/mtree/BSD.tests.dist
42

This line shouldn't have been touched: please check to make sure the indentation is correct here.

yanhaowang marked 4 inline comments as done.
  • Fix the file format.

I'll work on getting this over the finish line.

ngie added a reviewer: yanhaowang.
ngie added a subscriber: des.

It looks like @des wrote tests with similar coverage in D55153 and merged them into :main back in February. Taking differential/abandoning revision.