Page MenuHomeFreeBSD

printenv: Add test for printenv.
ClosedPublic

Authored by yanhaowang on Aug 15 2023, 7:09 AM.
Tags
None
Referenced Files
F102164692: D41468.id126065.diff
Fri, Nov 8, 10:07 AM
F102155887: D41468.id127790.diff
Fri, Nov 8, 7:37 AM
F102109307: D41468.id127790.diff
Thu, Nov 7, 5:41 PM
Unknown Object (File)
Thu, Nov 7, 11:50 AM
Unknown Object (File)
Thu, Oct 31, 5:42 PM
Unknown Object (File)
Wed, Oct 30, 8:34 AM
Unknown Object (File)
Thu, Oct 10, 7:58 PM
Unknown Object (File)
Oct 2 2024, 5:13 PM
Subscribers

Details

Diff Detail

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

Event Timeline

Only simple two test cases.

  1. using echo to check the environment value is correct and the environment variable is actually exist.
  2. try add env and delete the env, then use printenv to check that env.
asomers requested changes to this revision.Sep 21 2023, 3:33 PM
asomers added a subscriber: asomers.
asomers added inline comments.
usr.bin/printenv/tests/Makefile
2–3

You can get rid of the old SVN tag.

usr.bin/printenv/tests/printenv_test.sh
30–32

Also, get rid of the SVN tag here.

37

Let me suggest some more natural English.

42–43

You don't need to invoke awk if you use fancy parameter expansion.

44

This line can be a lot simpler.

52

Let me suggest some more natural English.

56

What is the purpose of this line?

66–67

Inconsistent white space here.

This revision now requires changes to proceed.Sep 21 2023, 3:33 PM
  • Remove unnecessary code and simplify
yanhaowang marked 5 inline comments as done.
  • Remove unnecessary code and simplify again.
This revision is now accepted and ready to land.Sep 23 2023, 2:36 PM
asomers requested changes to this revision.Sep 23 2023, 2:39 PM
asomers added inline comments.
etc/mtree/BSD.tests.dist
76

This is in the wrong section. Instead of cddl/usr.bin , it should be in usr.bin

This revision now requires changes to proceed.Sep 23 2023, 2:39 PM

In its current state, the "base" test doesn't pass. It seems like the expected_value variable isn't getting correctly expanded. Its value is just the name of the variable. Could you please fix that?

  • Fix expected_value variable

In its current state, the "base" test doesn't pass. It seems like the expected_value variable isn't getting correctly expanded. Its value is just the name of the variable. Could you please fix that?

Yes, expected_value utilizes the value of env_name as a variable name. In a POSIX shell, the primary method to achieve this is through the use of eval. If there is an alternative approach, please feel free to share it. I will update immediately. Thank you for your assistance in reviewing the code, which contained several careless mistakes XD.

This revision is now accepted and ready to land.Sep 25 2023, 4:04 PM
This revision was automatically updated to reflect the committed changes.