162306a36Sopenharmony_ciFutex Test
262306a36Sopenharmony_ci==========
362306a36Sopenharmony_ciFutex Test is intended to thoroughly test the Linux kernel futex system call
462306a36Sopenharmony_ciAPI.
562306a36Sopenharmony_ci
662306a36Sopenharmony_ciFunctional tests shall test the documented behavior of the futex operation
762306a36Sopenharmony_cicode under test. This includes checking for proper behavior under normal use,
862306a36Sopenharmony_ciodd corner cases, regression tests, and abject abuse and misuse.
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ciFutextest will also provide example implementation of mutual exclusion
1162306a36Sopenharmony_ciprimitives. These can be used as is in user applications or can serve as
1262306a36Sopenharmony_ciexamples for system libraries. These will likely be added to either a new lib/
1362306a36Sopenharmony_cidirectory or purely as header files under include/, I'm leaning toward the
1462306a36Sopenharmony_cilatter.
1562306a36Sopenharmony_ci
1662306a36Sopenharmony_ciQuick Start
1762306a36Sopenharmony_ci-----------
1862306a36Sopenharmony_ci# make
1962306a36Sopenharmony_ci# ./run.sh
2062306a36Sopenharmony_ci
2162306a36Sopenharmony_ciDesign and Implementation Goals
2262306a36Sopenharmony_ci-------------------------------
2362306a36Sopenharmony_cio Tests should be as self contained as is practical so as to facilitate sharing
2462306a36Sopenharmony_ci  the individual tests on mailing list discussions and bug reports.
2562306a36Sopenharmony_cio The build system shall remain as simple as possible, avoiding any archive or
2662306a36Sopenharmony_ci  shared object building and linking.
2762306a36Sopenharmony_cio Where possible, any helper functions or other package-wide code shall be
2862306a36Sopenharmony_ci  implemented in header files, avoiding the need to compile intermediate object
2962306a36Sopenharmony_ci  files.
3062306a36Sopenharmony_cio External dependencies shall remain as minimal as possible. Currently gcc
3162306a36Sopenharmony_ci  and glibc are the only dependencies.
3262306a36Sopenharmony_cio Tests return 0 for success and < 0 for failure.
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_ciOutput Formatting
3562306a36Sopenharmony_ci-----------------
3662306a36Sopenharmony_ciTest output shall be easily parsable by both human and machine. Title and
3762306a36Sopenharmony_ciresults are printed to stdout, while intermediate ERROR or FAIL messages are
3862306a36Sopenharmony_cisent to stderr. Tests shall support the -c option to print PASS, FAIL, and
3962306a36Sopenharmony_ciERROR strings in color for easy visual parsing. Output shall conform to the
4062306a36Sopenharmony_cifollowing format:
4162306a36Sopenharmony_ci
4262306a36Sopenharmony_citest_name: Description of the test
4362306a36Sopenharmony_ci	Arguments: arg1=val1 #units specified for clarity where appropriate
4462306a36Sopenharmony_ci	ERROR: Description of unexpected error
4562306a36Sopenharmony_ci	 FAIL: Reason for test failure
4662306a36Sopenharmony_ci	# FIXME: Perhaps an " INFO: informational message" option would be
4762306a36Sopenharmony_ci	#        useful here. Using -v to toggle it them on and off, as with -c.
4862306a36Sopenharmony_ci	# there may be multiple ERROR or FAIL messages
4962306a36Sopenharmony_ciResult: (PASS|FAIL|ERROR)
5062306a36Sopenharmony_ci
5162306a36Sopenharmony_ciNaming
5262306a36Sopenharmony_ci------
5362306a36Sopenharmony_cio FIXME: decide on a sane test naming scheme.  Currently the tests are named
5462306a36Sopenharmony_ci  based on the primary futex operation they test. Eventually this will become a
5562306a36Sopenharmony_ci  problem as we intend to write multiple tests which collide in this namespace.
5662306a36Sopenharmony_ci  Perhaps something like "wait-wake-1" "wait-wake-2" is adequate, leaving the
5762306a36Sopenharmony_ci  detailed description in the test source and the output.
5862306a36Sopenharmony_ci
5962306a36Sopenharmony_ciCoding Style
6062306a36Sopenharmony_ci------------
6162306a36Sopenharmony_cio The Futex Test project adheres to the coding standards set forth by Linux
6262306a36Sopenharmony_ci  kernel as defined in the Linux source Documentation/process/coding-style.rst.
63