Skip to content

Commit

Permalink
✅tests(suite): Now clean the files generated by the tests correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeioth committed Jan 17, 2024
1 parent b5a40d0 commit 632ac0e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
6 changes: 0 additions & 6 deletions .gitignore

This file was deleted.

1 change: 0 additions & 1 deletion lua/dooku/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ function M.find_project_root(roots)
return nil -- If no root directory is found, return nil
end


---Returns the plugin dir of dooku.nvim + a subdir if specified.
--We use this function to assert tests.
---@param path string (optional) A subdirectory to append to he returned dir.
Expand Down
13 changes: 7 additions & 6 deletions tests/tests.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@


local utils = require("dooku.utils")
local examples_dir = utils.os_path((debug.getinfo(1, 'S').source:sub(2):match '(.*/)') .. "/examples/")
local tests_dir = utils.os_path((debug.getinfo(1, 'S').source:sub(2):match '(.*/)') .. "/tests/")

-- Clean
--vim.fn.chdir(examples_dir)
--os.execute("git checkout -- .")
local examples_dir = utils.os_path((debug.getinfo(1, 'S').source:sub(2):match '(.*/)') .. "examples/")
local tests_dir = utils.os_path((debug.getinfo(1, 'S').source:sub(2):match '(.*/)') .. "tests/")

-- Disable default opts
local config = require("dooku.config")
config.set({ on_generate_open = false })

-- Clean
vim.fn.chdir(examples_dir)
io.popen("git clean -xdf .")
vim.wait(1000)

-- Run tests
dofile(tests_dir .. 'doxygen.lua')
dofile(tests_dir .. 'rustdoc.lua')
Expand Down

0 comments on commit 632ac0e

Please sign in to comment.