18c2ecf20Sopenharmony_ciFutex Test
28c2ecf20Sopenharmony_ci==========
38c2ecf20Sopenharmony_ciFutex Test is intended to thoroughly test the Linux kernel futex system call
48c2ecf20Sopenharmony_ciAPI.
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ciFunctional tests shall test the documented behavior of the futex operation
78c2ecf20Sopenharmony_cicode under test. This includes checking for proper behavior under normal use,
88c2ecf20Sopenharmony_ciodd corner cases, regression tests, and abject abuse and misuse.
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ciFutextest will also provide example implementation of mutual exclusion
118c2ecf20Sopenharmony_ciprimitives. These can be used as is in user applications or can serve as
128c2ecf20Sopenharmony_ciexamples for system libraries. These will likely be added to either a new lib/
138c2ecf20Sopenharmony_cidirectory or purely as header files under include/, I'm leaning toward the
148c2ecf20Sopenharmony_cilatter.
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ciQuick Start
178c2ecf20Sopenharmony_ci-----------
188c2ecf20Sopenharmony_ci# make
198c2ecf20Sopenharmony_ci# ./run.sh
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ciDesign and Implementation Goals
228c2ecf20Sopenharmony_ci-------------------------------
238c2ecf20Sopenharmony_cio Tests should be as self contained as is practical so as to facilitate sharing
248c2ecf20Sopenharmony_ci  the individual tests on mailing list discussions and bug reports.
258c2ecf20Sopenharmony_cio The build system shall remain as simple as possible, avoiding any archive or
268c2ecf20Sopenharmony_ci  shared object building and linking.
278c2ecf20Sopenharmony_cio Where possible, any helper functions or other package-wide code shall be
288c2ecf20Sopenharmony_ci  implemented in header files, avoiding the need to compile intermediate object
298c2ecf20Sopenharmony_ci  files.
308c2ecf20Sopenharmony_cio External dependencies shall remain as minimal as possible. Currently gcc
318c2ecf20Sopenharmony_ci  and glibc are the only dependencies.
328c2ecf20Sopenharmony_cio Tests return 0 for success and < 0 for failure.
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ciOutput Formatting
358c2ecf20Sopenharmony_ci-----------------
368c2ecf20Sopenharmony_ciTest output shall be easily parsable by both human and machine. Title and
378c2ecf20Sopenharmony_ciresults are printed to stdout, while intermediate ERROR or FAIL messages are
388c2ecf20Sopenharmony_cisent to stderr. Tests shall support the -c option to print PASS, FAIL, and
398c2ecf20Sopenharmony_ciERROR strings in color for easy visual parsing. Output shall conform to the
408c2ecf20Sopenharmony_cifollowing format:
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_citest_name: Description of the test
438c2ecf20Sopenharmony_ci	Arguments: arg1=val1 #units specified for clarity where appropriate
448c2ecf20Sopenharmony_ci	ERROR: Description of unexpected error
458c2ecf20Sopenharmony_ci	 FAIL: Reason for test failure
468c2ecf20Sopenharmony_ci	# FIXME: Perhaps an " INFO: informational message" option would be
478c2ecf20Sopenharmony_ci	#        useful here. Using -v to toggle it them on and off, as with -c.
488c2ecf20Sopenharmony_ci	# there may be multiple ERROR or FAIL messages
498c2ecf20Sopenharmony_ciResult: (PASS|FAIL|ERROR)
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_ciNaming
528c2ecf20Sopenharmony_ci------
538c2ecf20Sopenharmony_cio FIXME: decide on a sane test naming scheme.  Currently the tests are named
548c2ecf20Sopenharmony_ci  based on the primary futex operation they test. Eventually this will become a
558c2ecf20Sopenharmony_ci  problem as we intend to write multiple tests which collide in this namespace.
568c2ecf20Sopenharmony_ci  Perhaps something like "wait-wake-1" "wait-wake-2" is adequate, leaving the
578c2ecf20Sopenharmony_ci  detailed description in the test source and the output.
588c2ecf20Sopenharmony_ci
598c2ecf20Sopenharmony_ciCoding Style
608c2ecf20Sopenharmony_ci------------
618c2ecf20Sopenharmony_cio The Futex Test project adheres to the coding standards set forth by Linux
628c2ecf20Sopenharmony_ci  kernel as defined in the Linux source Documentation/process/coding-style.rst.
63