proot icon indicating copy to clipboard operation
proot copied to clipboard

Meaningful names for tests

Open oxr463 opened this issue 5 years ago • 6 comments

As a new contributor, I am finding a hard time figuring out what the tests actually do; the names aren't very descriptive. Perhaps we should include a comment in each test summarizing what the test does? --Travis CI and pull requests

See also: https://github.com/proot-me/PRoot/pull/96#issuecomment-309299229

Many of these tests contain a valid git commit id, which can be used to reference the functionality of the test in question.

Additionally, all shell scripts should be modified to pass shellcheck (See also: CII Best Practices Badge Program).

Finally, old tests should simply be removed. If we really need them, they can be found in the git history or in a previous release.

  • [ ] tests/test-00000000.sh : boolean logic for shell scripts
  • [ ] tests/test-0228fbe7.sh : fix sigtrap events caused by execve
  • [ ] tests/test-0238c7f1.sh : fix regression for support of root directory in asymmetric bindings
  • [ ] tests/test-03969e70.sh : fix searching for commands in path
  • [ ] tests/test-071599da.sh : ensure sysexit for execve under seccomp
  • [ ] tests/test-0830d8a8.sh : fix 32bit execution from 64bit
  • [ ] tests/test-092c5e26.sh : fix regression for execve support of foreign binaries (emulation)
  • [x] tests/test-0cf405b0.c : fix memory corruption for execve on /proc/self/exe
  • [ ] tests/test-11111111.sh : linux behavior conformance
  • [ ] tests/test-16573e73.c : seccomp support on x86_64
  • [ ] tests/test-1743dd3d.sh : guest root filesystem
  • [ ] tests/test-1c68c218.c : fix x86_64 ABI regression for linkat and fchownat syscalls
  • [ ] tests/test-1cd9d8f9.sh : print name of working directory
  • [ ] tests/test-1fedd9a3.sh : simplify fake_id0 + fix support for chmod-like and stat-like syscalls
  • [ ] tests/test-1ffc8309.c : TODO
  • [ ] tests/test-1ffc8309.sh : TODO
  • [ ] tests/test-22222222.sh : TODO
  • [ ] tests/test-230f47cf.sh : FIXME (See: https://github.com/proot-me/PRoot/issues/122#issuecomment-437136309)
  • [ ] tests/test-230f47cg.sh.deprecated : REMOVE
  • [ ] tests/test-230f47ch.sh : TODO
  • [ ] tests/test-2401b850.sh : TODO
  • [ ] tests/test-25069c12.c : TODO
  • [ ] tests/test-25069c13.c : TODO
  • [ ] tests/test-2db65cd2.sh : TODO
  • [ ] tests/test-305ae31d.c : TODO
  • [ ] tests/test-305ae31d.sh : TODO
  • [ ] tests/test-311b7a95.sh : TODO
  • [ ] tests/test-33333333.c : TODO
  • [ ] tests/test-33333334.c : TODO
  • [x] tests/test-3624be91.sh : TODO
  • [ ] tests/test-3dec4597.sh : TODO
  • [ ] tests/test-44444444.c : TODO
  • [ ] tests/test-517e1d6a.sh : TODO
  • [ ] tests/test-517e1d6b.sh : TODO
  • [ ] tests/test-51943658.c : TODO
  • [ ] tests/test-53355a5b.sh : TODO
  • [ ] tests/test-5467b986.sh : TODO
  • [ ] tests/test-55b731d3.sh : TODO
  • [ ] tests/test-55fd1da5.sh : TODO
  • [ ] tests/test-5996858d.sh : TODO
  • [ ] tests/test-5bed7141.c : TODO
  • [ ] tests/test-5bed7142.sh : TODO
  • [ ] tests/test-5bed7143.c : TODO
  • [ ] tests/test-654decce.sh : TODO
  • [ ] tests/test-66666666.c : TODO
  • [ ] tests/test-67972fbe.sh : TODO
  • [ ] tests/test-691786c8.sh : TODO - expects echo to be in /usr/bin
  • [ ] tests/test-6b5a254a.sh : TODO
  • [ ] tests/test-6d1e2650.sh : TODO
  • [ ] tests/test-6fb08ce1.sh : TODO
  • [ ] tests/test-713b6910.sh : TODO
  • [ ] tests/test-7601199b.sh : TODO
  • [ ] tests/test-77777777.c.unreliable : REMOVE
  • [ ] tests/test-79cf6614.c : TODO
  • [ ] tests/test-82ba4ba1.c : TODO
  • [ ] tests/test-82ba4ba1.sh : TODO
  • [ ] tests/test-88888888.c : TODO
  • [ ] tests/test-8a83376a.sh : TODO
  • [ ] tests/test-8e5fa256.sh : TODO
  • [ ] tests/test-99999999.sh : TODO
  • [ ] tests/test-9c07fad8.c : TODO
  • [ ] tests/test-9f5eeb72.sh : TODO
  • [ ] tests/test-a3e68988.c : TODO
  • [ ] tests/test-a4d7ed70.sh : TODO
  • [ ] tests/test-a8e69d6f.c : TODO
  • [ ] tests/test-aaaaaaaa.sh : TODO
  • [ ] tests/test-af062114.c : TODO
  • [ ] tests/test-b161bc0a.sh : TODO
  • [ ] tests/test-b6df3cbe.sh : TODO
  • [ ] tests/test-b94dd86a.sh : TODO
  • [ ] tests/test-bbbbbbbb.sh : TODO
  • [ ] tests/test-bdc90417.c : TODO
  • [ ] tests/test-c10e2073.c : TODO
  • [ ] tests/test-c15999f9.sh : TODO
  • [ ] tests/test-c47aeb7d.c : TODO
  • [ ] tests/test-c5a7a0f0.c : TODO
  • [ ] tests/test-c68d18dc.sh : TODO
  • [ ] tests/test-c6b77b77.mk : TODO
  • [ ] tests/test-c6b77b77.sh : TODO
  • [ ] tests/test-careauth.sh : TODO
  • [ ] tests/test-careexit.sh : TODO
  • [ ] tests/test-carehwcp.sh : TODO
  • [ ] tests/test-carequot.sh : TODO
  • [ ] tests/test-cb1143ab.sh : TODO
  • [ ] tests/test-cccccccc.sh : TODO
  • [ ] tests/test-cdd39012.sh : TODO - see ptrace-2 issue above.
  • [ ] tests/test-cea75343.sh : TODO
  • [ ] tests/test-commmmmm.sh : TODO
  • [ ] tests/test-d1be631a.sh : TODO (See: https://github.com/proot-me/PRoot/commit/d1be631ae1dc59533b5ac5ffc7de39fe3275ac37).
  • [ ] tests/test-d1da0d8d.sh : TODO
  • [ ] tests/test-d2175fc3.sh : TODO
  • [ ] tests/test-d2175fc4.c : TODO
  • [ ] tests/test-d92b57ca.sh : TODO
  • [ ] tests/test-dddddddd.sh : TODO
  • [ ] tests/test-de756935.sh : TODO
  • [ ] tests/test-df4de4db.sh : TODO
  • [ ] tests/test-dfb0c3b6.sh : TODO
  • [ ] tests/test-e87b34ae.c : TODO
  • [ ] tests/test-e87ca6ca.sh : TODO
  • [ ] tests/test-e940896f.sh : TODO
  • [ ] tests/test-e99993c8.sh : TODO
  • [ ] tests/test-eddeba0e.sh : TODO
  • [ ] tests/test-f7089d4f.sh : TODO
  • [ ] tests/test-fa205b56.c : TODO
  • [ ] tests/test-fbca9cc2.sh : TODO
  • [ ] tests/test-fdf487a0.c : TODO
  • [ ] tests/test-ffffffff.sh : TODO
  • [ ] tests/test-getres32.sh : TODO
  • [ ] tests/test-getresid.sh : TODO - fails on musl
  • [ ] tests/test-gggggggg.sh : TODO
  • [ ] tests/test-hhhhhhhh.sh : TODO
  • [ ] tests/test-iiiiiiii.c : TODO
  • [ ] tests/test-killexit.sh : TODO
  • [ ] tests/test-kkkkkkkk.c : TODO
  • [ ] tests/test-mmmmmmmm.sh : TODO
  • [ ] tests/test-nnnnnnnn.c : TODO
  • [ ] tests/test-oooooooo.c : TODO
  • [ ] tests/test-pppppppp.sh : TODO
  • [ ] tests/test-proocare.sh : TODO
  • [ ] tests/test-ptrace00.c : TODO
  • [ ] tests/test-ptrace01.c : TODO
  • [ ] tests/test-python01.sh : TODO
  • [ ] tests/test-rrrrrrrr.sh : TODO
  • [ ] tests/test-sockets1.sh : TODO
  • [ ] tests/test-sockets2.sh : TODO
  • [ ] tests/test-sockets3.sh : TODO
  • [ ] tests/test-ssssssss.c : TODO
  • [ ] tests/test-tempdire.sh : TODO
  • [ ] tests/test-wwwwwwww.sh : TODO
  • [ ] tests/test-xxxxxxxx.c : TODO
  • [ ] tests/test-yyyyyyyy.sh : TODO

oxr463 avatar Feb 22 '19 02:02 oxr463

Shell Script Test Template

#!/bin/sh
set -eu

# Check dependencies

# Create temporary directory

# Run test

# Cleanup

See also: https://github.com/qemu/qemu/blob/master/tests/docker/common.rc

oxr463 avatar Feb 23 '19 14:02 oxr463

  • [x] VERBOSE environment variable for debugging failing tests.

Simply run make -C tests V=99 for verbose output.

For a specific test, run make -C tests check-test-<commit id?>(.sh).

oxr463 avatar Feb 24 '19 15:02 oxr463

https://github.com/proot-me/proot/commit/4be67b60ef22d78c91800306c5ec995fdd022c02#diff-354f30a63fb0907d4ad57269548329e3

oxr463 avatar Apr 02 '19 21:04 oxr463

Resources:

  • https://github.com/sstephenson/bats
  • https://github.com/libcheck/check

oxr463 avatar May 02 '19 20:05 oxr463

oneline.txt

oxr463 avatar Apr 24 '23 02:04 oxr463

#!/bin/bash

# Set the path to the subdirectory containing the files of interest
path_to_files="${1}”

# Iterate through the files in the subdirectory
for file in $path_to_files/*; do
  echo "File: $file"
  echo "------------------------------"
  # Iterate through the Git commit history of the file
  git log --follow --pretty=format:"%h %ad %s" --date=short $file | while read commit; do
    echo $commit
  done
  echo ""
done

oxr463 avatar May 07 '23 11:05 oxr463