mirror of
				https://github.com/neovim/neovim.git
				synced 2025-11-04 01:34:25 +00:00 
			
		
		
		
	test: move oldtests to test directory (#22536)
The new oldtest directory is in test/old/testdir. The reason for this is that many tests have hardcoded the parent directory name to be 'testdir'.
This commit is contained in:
		
							
								
								
									
										2
									
								
								.gitattributes
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.gitattributes
									
									
									
									
										vendored
									
									
								
							@@ -8,6 +8,4 @@ src/xdiff/**    linguist-vendored
 | 
			
		||||
src/cjson/**    linguist-vendored
 | 
			
		||||
src/unicode/**  linguist-vendored
 | 
			
		||||
 | 
			
		||||
src/nvim/testdir/test42.in diff
 | 
			
		||||
 | 
			
		||||
.github/    export-ignore
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								.github/workflows/test.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/test.yml
									
									
									
									
										vendored
									
									
								
							@@ -366,5 +366,5 @@ jobs:
 | 
			
		||||
          # But would break functionaltest, where its `more` would be used then.
 | 
			
		||||
          $OldPath = $env:PATH
 | 
			
		||||
          $env:PATH = "C:\msys64\usr\bin;$env:PATH"
 | 
			
		||||
          & "C:\msys64\mingw64\bin\mingw32-make.exe" -C $(Convert-Path src\nvim\testdir) VERBOSE=1
 | 
			
		||||
          & "C:\msys64\mingw64\bin\mingw32-make.exe" -C $(Convert-Path test\old\testdir) VERBOSE=1
 | 
			
		||||
          $env:PATH = $OldPath
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										26
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										26
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -36,21 +36,21 @@ compile_commands.json
 | 
			
		||||
*.rej
 | 
			
		||||
 | 
			
		||||
# Generated by old (Vim) tests.
 | 
			
		||||
/src/nvim/testdir/del
 | 
			
		||||
/src/nvim/testdir/test*.out
 | 
			
		||||
/src/nvim/testdir/test*.res
 | 
			
		||||
/src/nvim/testdir/test*.log
 | 
			
		||||
/src/nvim/testdir/messages
 | 
			
		||||
/src/nvim/testdir/viminfo
 | 
			
		||||
/src/nvim/testdir/test.ok
 | 
			
		||||
/src/nvim/testdir/*.failed
 | 
			
		||||
/src/nvim/testdir/X*
 | 
			
		||||
/src/nvim/testdir/valgrind.*
 | 
			
		||||
/src/nvim/testdir/.gdbinit
 | 
			
		||||
/test/old/testdir/testdir/del
 | 
			
		||||
/test/old/testdir/testdir/test*.out
 | 
			
		||||
/test/old/testdir/testdir/test*.res
 | 
			
		||||
/test/old/testdir/testdir/test*.log
 | 
			
		||||
/test/old/testdir/testdir/messages
 | 
			
		||||
/test/old/testdir/testdir/viminfo
 | 
			
		||||
/test/old/testdir/testdir/test.ok
 | 
			
		||||
/test/old/testdir/testdir/*.failed
 | 
			
		||||
/test/old/testdir/testdir/X*
 | 
			
		||||
/test/old/testdir/testdir/valgrind.*
 | 
			
		||||
/test/old/testdir/testdir/.gdbinit
 | 
			
		||||
/runtime/indent/testdir/*.out
 | 
			
		||||
+runtime/indent/testdir/*.fail
 | 
			
		||||
# Generated by src/nvim/testdir/runnvim.sh.
 | 
			
		||||
/src/nvim/testdir/*.tlog
 | 
			
		||||
# Generated by test/old/testdir/testdir/runnvim.sh.
 | 
			
		||||
/test/old/testdir/testdir/*.tlog
 | 
			
		||||
 | 
			
		||||
# Generated by unit tests.
 | 
			
		||||
/test/includes/post/
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										12
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								Makefile
									
									
									
									
									
								
							@@ -113,17 +113,17 @@ build/.ran-deps-cmake::
 | 
			
		||||
 | 
			
		||||
# TODO: cmake 3.2+ add_custom_target() has a USES_TERMINAL flag.
 | 
			
		||||
oldtest: | nvim build/runtime/doc/tags
 | 
			
		||||
	+$(SINGLE_MAKE) -C src/nvim/testdir clean
 | 
			
		||||
	+$(SINGLE_MAKE) -C test/old/testdir clean
 | 
			
		||||
ifeq ($(strip $(TEST_FILE)),)
 | 
			
		||||
	+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG=$(NVIM_PRG) $(MAKEOVERRIDES)
 | 
			
		||||
	+$(SINGLE_MAKE) -C test/old/testdir NVIM_PRG=$(NVIM_PRG) $(MAKEOVERRIDES)
 | 
			
		||||
else
 | 
			
		||||
	@# Handle TEST_FILE=test_foo{,.res,.vim}.
 | 
			
		||||
	+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG=$(NVIM_PRG) SCRIPTS= $(MAKEOVERRIDES) $(patsubst %.vim,%,$(patsubst %.res,%,$(TEST_FILE)))
 | 
			
		||||
	+$(SINGLE_MAKE) -C test/old/testdir NVIM_PRG=$(NVIM_PRG) SCRIPTS= $(MAKEOVERRIDES) $(patsubst %.vim,%,$(patsubst %.res,%,$(TEST_FILE)))
 | 
			
		||||
endif
 | 
			
		||||
# Build oldtest by specifying the relative .vim filename.
 | 
			
		||||
.PHONY: phony_force
 | 
			
		||||
src/nvim/testdir/%.vim: phony_force
 | 
			
		||||
	+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG=$(NVIM_PRG) SCRIPTS= $(MAKEOVERRIDES) $(patsubst src/nvim/testdir/%.vim,%,$@)
 | 
			
		||||
test/old/testdir/%.vim: phony_force
 | 
			
		||||
	+$(SINGLE_MAKE) -C test/old/testdir NVIM_PRG=$(NVIM_PRG) SCRIPTS= $(MAKEOVERRIDES) $(patsubst test/old/testdir/%.vim,%,$@)
 | 
			
		||||
 | 
			
		||||
functionaltest-lua: | nvim
 | 
			
		||||
	$(BUILD_TOOL) -C build $@
 | 
			
		||||
@@ -143,7 +143,7 @@ iwyu: build/.ran-cmake
 | 
			
		||||
 | 
			
		||||
clean:
 | 
			
		||||
	+test -d build && $(BUILD_TOOL) -C build clean || true
 | 
			
		||||
	$(MAKE) -C src/nvim/testdir clean
 | 
			
		||||
	$(MAKE) -C test/old/testdir clean
 | 
			
		||||
	$(MAKE) -C runtime/indent clean
 | 
			
		||||
 | 
			
		||||
distclean:
 | 
			
		||||
 
 | 
			
		||||
@@ -226,6 +226,10 @@ preprocess_patch() {
 | 
			
		||||
' +w +q "$file"
 | 
			
		||||
 | 
			
		||||
  # Remove some *.po files. #5622
 | 
			
		||||
  local na_po='sjiscorr\.c\|ja\.sjis\.po\|ko\.po\|pl\.cp1250\.po\|pl\.po\|ru\.cp1251\.po\|uk\.cp1251\.po\|zh_CN\.cp936\.po\|zh_CN\.po\|zh_TW\.po'
 | 
			
		||||
  2>/dev/null $nvim --cmd 'set dir=/tmp' +'g@^diff --git a/src/po/\<\%('${na_po}'\)\>@norm! d/\v(^diff)|%$
 | 
			
		||||
' +w +q "$file"
 | 
			
		||||
 | 
			
		||||
  # Remove vimrc_example.vim
 | 
			
		||||
  local na_vimrcexample='vimrc_example\.vim'
 | 
			
		||||
  2>/dev/null $nvim --cmd 'set dir=/tmp' +'g@^diff --git a/runtime/\<\%('${na_vimrcexample}'\)\>@norm! d/\v(^diff)|%$
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@ Tests
 | 
			
		||||
 | 
			
		||||
Tests are broadly divided into *unit tests* ([test/unit](https://github.com/neovim/neovim/tree/master/test/unit/)),
 | 
			
		||||
*functional tests* ([test/functional](https://github.com/neovim/neovim/tree/master/test/functional/)),
 | 
			
		||||
and *old tests* ([src/nvim/testdir/](https://github.com/neovim/neovim/tree/master/src/nvim/testdir/)).
 | 
			
		||||
and *old tests* ([test/old/testdir/](https://github.com/neovim/neovim/tree/master/test/old/testdir/)).
 | 
			
		||||
 | 
			
		||||
- _Unit_ testing is achieved by compiling the tests as a shared library which is
 | 
			
		||||
  loaded and called by [LuaJit FFI](http://luajit.org/ext_ffi.html).
 | 
			
		||||
@@ -48,7 +48,7 @@ Layout
 | 
			
		||||
- `/test/*/**/*_spec.lua` : actual tests. Files that do not end with
 | 
			
		||||
  `_spec.lua` are libraries like `/test/**/helpers.lua`, except that they have
 | 
			
		||||
  some common topic.
 | 
			
		||||
- `/src/nvim/testdir` : old tests (from Vim)
 | 
			
		||||
- `/test/old/testdir` : old tests (from Vim)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Running tests
 | 
			
		||||
@@ -83,7 +83,7 @@ To run a *single* legacy test file you can use either:
 | 
			
		||||
 | 
			
		||||
or:
 | 
			
		||||
 | 
			
		||||
    make src/nvim/testdir/test_syntax.vim
 | 
			
		||||
    make test/old/testdir/test_syntax.vim
 | 
			
		||||
 | 
			
		||||
- Specify only the test file name, not the full path.
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -7,7 +7,7 @@ local clear, command = helpers.clear, helpers.command
 | 
			
		||||
-- Temporary file for gathering benchmarking results for each regexp engine.
 | 
			
		||||
local result_file = 'benchmark.out'
 | 
			
		||||
-- Fixture containing an HTML fragment that can make a search appear to freeze.
 | 
			
		||||
local sample_file = 'src/nvim/testdir/samples/re.freeze.txt'
 | 
			
		||||
local sample_file = 'test/old/testdir/samples/re.freeze.txt'
 | 
			
		||||
 | 
			
		||||
-- Vim script code that does both the work and the benchmarking of that work.
 | 
			
		||||
local measure_cmd =
 | 
			
		||||
 
 | 
			
		||||
@@ -898,7 +898,7 @@ local load_factor = 1
 | 
			
		||||
if global_helpers.is_ci() then
 | 
			
		||||
  -- Compute load factor only once (but outside of any tests).
 | 
			
		||||
  module.clear()
 | 
			
		||||
  module.request('nvim_command', 'source src/nvim/testdir/load.vim')
 | 
			
		||||
  module.request('nvim_command', 'source test/old/testdir/load.vim')
 | 
			
		||||
  load_factor = module.request('nvim_eval', 'g:test_load_factor')
 | 
			
		||||
end
 | 
			
		||||
function module.load_adjust(num)
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
-- See also: src/nvim/testdir/test_options.vim
 | 
			
		||||
-- See also: test/old/testdir/test_options.vim
 | 
			
		||||
local helpers = require('test.functional.helpers')(after_each)
 | 
			
		||||
local command, clear = helpers.command, helpers.clear
 | 
			
		||||
local source, expect = helpers.source, helpers.expect
 | 
			
		||||
 
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user